HAProxy provides a socket file which can be used to do maintenance (enable/ disable backends, retrieve information and statistics, …). The statistics part contains quite some interesting information for monitoring and alerting. The below Perl code snippit will loop over a glob of socket files (for instance when you have multiple HAProxy configurations running as…