{"id":26128303,"url":"https://github.com/dinotools/monitoring-check_haproxy","last_synced_at":"2025-10-03T22:50:33.127Z","repository":{"id":39879809,"uuid":"422560526","full_name":"DinoTools/monitoring-check_haproxy","owner":"DinoTools","description":"Monitoring plugin to check HAProxy with Icinga, Nagios and other compatible monitoring solutions","archived":false,"fork":false,"pushed_at":"2025-09-08T18:08:35.000Z","size":96,"stargazers_count":6,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-21T07:09:21.800Z","etag":null,"topics":["haproxy","icinga-plugin","icinga2-plugin","monitoring-plugin","nagios-plugin"],"latest_commit_sha":null,"homepage":"https://DinoTools.github.io/monitoring-check_haproxy/","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DinoTools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-29T12:08:07.000Z","updated_at":"2025-01-27T15:24:09.000Z","dependencies_parsed_at":"2023-01-24T06:45:28.696Z","dependency_job_id":"2a38dd8f-45ca-46ba-a36d-d0d5497b3207","html_url":"https://github.com/DinoTools/monitoring-check_haproxy","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/DinoTools/monitoring-check_haproxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DinoTools%2Fmonitoring-check_haproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DinoTools%2Fmonitoring-check_haproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DinoTools%2Fmonitoring-check_haproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DinoTools%2Fmonitoring-check_haproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DinoTools","download_url":"https://codeload.github.com/DinoTools/monitoring-check_haproxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DinoTools%2Fmonitoring-check_haproxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278239968,"owners_count":25954097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haproxy","icinga-plugin","icinga2-plugin","monitoring-plugin","nagios-plugin"],"created_at":"2025-03-10T18:59:55.062Z","updated_at":"2025-10-03T22:50:33.100Z","avatar_url":"https://github.com/DinoTools.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# check_haproxy Nagios Check Script\n\nThis is a Nagios plugin to check the status of HAProxy over a socket connection\n(by default, /var/run/haproxy.sock) and parse the statistics to ensure that it\nis operating within accepted limits, as per the defaults, or as set for each\nfrontend/backend.\n\n[![docs](https://github.com/DinoTools/monitoring-check_haproxy/actions/workflows/docs.yml/badge.svg)](https://dinotools.github.io/monitoring-check_haproxy/)\n\n## Usage\n\n    check_haproxy [--defaults (defaults)] [--overrides (override 1)]\n      [--overrides (override 2)] [--overrides (override n)]\n      [--[no]frontends] [--[no]backends] [--[no]servers]\n      [--socket (path)] [--help]\n\n### -f, --[no]frontends\n\nEnable/disable checks for the frontends in HAProxy (that they're marked as OPEN\nand the session limits haven't been reached).\n\n### -b, --[no]backends\n\nEnable/disable checks for the backends in HAProxy (that they have the required\nquorum of servers, and that the session limits haven't been reached).\n\n### -s, --[no]servers\n\nEnable/disable checks for the servers in HAProxy (that they haven't reached the\nlimits for the sessions or for queues).\n\n### -D, --defaults (defaults)\n\nSet/Override the defaults which will be applied to all checks (unless\nspecifically set by --overrides). Takes the form:\n\n    {u,d,x},{svr_warn},{svr_crit},{sess_warn},{sess_crit}\n\nEach of these is optional, but the positioning is important. To fully override,\nset (for example):\n\n    u,10,5,.25,0.5\n\nwhich means:\n\n* `u`: Check for servers up (`u`) or servers down (`d`), or disable all checks\n  on that particular frontend/backend (`x`).\n* `10`: WARNING if less than 10 servers are up, or if at least that many servers\n  are down.\n* `5`: CRITICAL if less than 5 servers are available, or if at least that many\n  have gone away.\n* `.25`: WARNING if more any frontend, backend, or individual server has gone\n  over 25% of it's maximum allowed sessions (or any queue for any server on the\n  backend is at least 25% full).\n* `0.5`: CRITICAL for the same reasons as previous, but we've reached 50% of\n  these levels.\n\nTo override only some of these values from the pre-set defaults\n(`u,5,2,.75,.9`), simply leave the others as empty, for example: `,10,7` will\nleave checks as up, but increase the server WARN/CRIT to 10/7. or to switch to\nuse down, use `d,`, or off with `x`.\n\nEach number has two meanings:\n\n* `less than 1`: Where any number is less than (but not equal to) 1, then the\n  value is understood as a percentage of the available servers or session\n  limits. If you have 20 servers and set a threshold of .25 then that would\n  mean 5 servers either up or down.\n* `greater than, or equal to 1`: Where any number is greater than, or equal\n  to, 1, then this is a fixed value. By setting 5 you are hard-coding the\n  number of servers or sessions, regardless of the limit or number available\n  to HAProxy.\n\nThe code **does not** alter this limit if it is greater than the available\nservers or sessions so there are situations where the alert may not trigger.\nFor example, in the event of `down` being the trigger and the number of servers\nis less than the Warning or Critical thresholds, the error may never trigger.\nIt is generally better to use `up` and percentage values where you are going\nto have a flexible number of backends.\n\n### -O, --overrides (override)\n\nOverride the defaults for a particular frontend or backend, in the form\n`name:override`, where `override` is the same format as `--defaults` above. For\nexample, to override the frontend called \"api\" and allow that to increase to\nlimits of 15/10 for WARN/CRIT, use `api:,15,10`. Add as many as you like by\nspecifing the flag multiple times:\n\n    --overrides api:,15,10 --overrides assets:d,2,5 --overrides webmail:u,3,2\n\n### -S, --socket /path/to/socket\n\nPath to the socket `check_haproxy` should connect to (requires read/write\npermissions and must be at least user level; no operator or admin privileges\nneeded).\n\n## Icinga2 configuration\n\nCopy `check_haproxy.icinga2.conf` to the icinga2 zone and define a new service for all Linux hosts with `vars.haproxy`, for example:\n\n```\napply Service \"Haproxy stats\" {\n  import \"generic-service\"\n  check_command = \"haproxy\"\n  vars.haproxy_socket = \"/var/run/haproxy/admin.sock\"\n  vars.haproxy_default = \"d,1,1,75,90\"\n  command_endpoint = host.vars.client_endpoint\n  assign where host.vars.client_endpoint \u0026\u0026 host.vars.os == \"Linux\" \u0026\u0026 host.vars.haproxy\n}\n```\n\n## Licence\n\nThis program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU General Public License\nas published by the Free Software Foundation; either version 2\nof the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program; if not, write to the Free Software\nFoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinotools%2Fmonitoring-check_haproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinotools%2Fmonitoring-check_haproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinotools%2Fmonitoring-check_haproxy/lists"}