Nagios rules on host
On my systems I’ve standardized nagios to monitor the following services via nrpe , this is a good starting point. Plugins called here are for debian systems , for other distros the plugins paths are different.
command[lv3_check_disk]=/usr/lib/nagios/plugins/check_disk
command[lv3_check_disk_www]=/usr/lib/nagios/plugins/check_disk
command[lv3_check_disk_mysql]=/usr/lib/nagios/plugins/check_disk
command[lv3_check_disk_vmail]=/usr/lib/nagios/plugins/check_disk
command[lv3_check_disk_home]=/usr/lib/nagios/plugins/check_disk
command[lv3_check_swap]=/usr/lib/nagios/plugins/check_swap
command[lv3_check_mem]=/usr/lib/nagios/plugins/check_memory
command[lv3_check_load]=/usr/lib/nagios/plugins/check_load
command[lv3_check_mysql]=/usr/lib/nagios/plugins/check_tcp
command[lv3_check_ftp]=/usr/lib/nagios/plugins/check_tcp
command[lv3_check_http]=/usr/lib/nagios/plugins/check_tcp
command[lv3_check_procs]=/usr/lib/nagios/plugins/check_procs
command[lv3_check_3306]=/usr/lib/nagios/plugins/check_tcp
command[lv3_check_mysql_connectionTime]=/usr/lib/nagios/plugins/check_mysql_health
command[lv3_check_mysql_uptime]=/usr/lib/nagios/plugins/check_mysql_health
command[lv3_check_mysql_slowQueries]=/usr/lib/nagios/plugins/check_mysql_health
command[lv3_check_mysql_threadConnected]=/usr/lib/nagios/plugins/check_mysql_health
command[lv3_check_baculaClient]=/usr/lib/nagios/plugins/check_procs
Command on nagios supervisor
I don’t like pass arguments via nrpe i prefer hardcode checks per rule via single comand with no arguments
# Simple service
define service{ use generic-service host_name hostNameDefinition service_description hostNameDescription /home disk check_command check_nrpe_1arg!lv3_check_disk_home }
The Command
# simple commandDefinition
define command {
command_name check_nrpe_1arg
# Host is mandatory as argument, in this case i don0t pass arguments except what is simply to manage , K.I.S.S.
# ARG1 , the one and only command defined on remote host
command_line /usr/lib/nagios/plugins/check_nrpe -n -H $HOSTADDRESS$ -c $ARG1$
# -n is called to avoid SSL usage
}