Created
August 29, 2012 21:31
-
-
Save srinivasmohan/3519231 to your computer and use it in GitHub Desktop.
Nagios config blocks for check_haproxy_all.pl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Add to commands.cfg: | |
#Note that I have the password to http://haproxyname:8080/statspath defined in resources.cfg as USER6 | |
#And the perl script must be chmodded 555 or even better chowned to nagios:nagios and chmodded 550 | |
define command{ | |
command_name poll_haproxy_consolidated | |
command_line /etc/nagios3/scripts/check_haproxy_all.pl -U $ARG1$ -u $ARG2$ -a $ARG3$ -P $USER6$ | |
} | |
# Add to hosts.cfg: | |
#Add a template called external-hosts - I use this for hosts that need not be health checked at host level | |
define host{ | |
name external-host ; The name of this host template | |
notifications_enabled 1 ; Host notifications are enabled | |
event_handler_enabled 1 ; Host event handler is enabled | |
flap_detection_enabled 1 ; Flap detection is enabled | |
failure_prediction_enabled 1 ; Failure prediction is enabled | |
process_perf_data 1 ; Process performance data | |
retain_status_information 1 ; Retain status information across program restarts | |
retain_nonstatus_information 1 ; Retain non-status information across program restarts | |
max_check_attempts 10 | |
notification_interval 0 | |
notification_period 24x7 | |
notification_options d,u,r | |
contact_groups admins | |
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE! | |
#Uncomment the action_url if you already have nagiosgraph setup for graph perf data. | |
#action_url /nagiosgraph/cgi-bin/showhost.cgi?host=$HOSTNAME$ | |
} | |
#Add a "virtual" host to hosts.cfg - this is set to be 127.0.0.1 but we will never poll this really.. | |
define host{ | |
use external-host | |
host_name onepwr-east-haproxy-group | |
alias Virtual host to consolidate all US-EAST HaProxy stats | |
address 127.0.0.1 | |
} | |
#Add to services.cfg: | |
#Monitor haproxy stats and "sum" them up | |
define service { | |
host_name onepwr-east-haproxy-group | |
service_description US-East HAProxy Stats Consolidation | |
check_command poll_haproxy_consolidated!admin!lb1.dom.com,lb2.dom.com,lb3.dom.com!/statspath | |
use generic-service | |
notification_interval 0 | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment