nagios监控nginx

监控NGINX 进程是否运行(所有进程都适用哦。很有用)

在被监控机(10.1.1.2)上运行,可以测试是否有进程运行
/usr/local/nagios/libexec/check_procs -c 1:30 -C nginx

在被监控机上编辑 /usr/local/nagios/etc/nrpe_local.cfg
加入:
command[check_nginx]=/usr/local/nagios/libexec/check_procs -c 1:30 -C nginx

 

进入监控机
/usr/local/nagios/etc/services.cfg

define service {
host_name nginx1.dog.com
service_description CHECK_NGINX
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 3
contact_groups sagroup
notification_interval 480
notification_period 24x7
notification_options w,u,c,r
check_command check_nrpe!check_nginx
notifications_enabled 1
}

重启nagios服务

 

你可能感兴趣的:(监控)