本文共 1269 字,大约阅读时间需要 4 分钟。
nagios 监控nginx 返回状态插件 如502 504网络用法的naigos监控nginx主要是根据nginx,status提供的连接数据来设置报警值的。对NGINX 出现502,504状态报警不足我这里提供另个方法,使用方法cd /usr/local/nagios/libexecwgethttp://www.9ai9.net/download/shell/qhappy_check_nginx.shchmod 755 qhappy_check_nginx.shvim /usr/local/nagios/etc/object/command.cfg添加以下内容 #qhappy_check_nginx define command{ command_name qhappy_check_nginx command_line $USER1$/qhappy_check_nginx.sh --url $ARG1$ --host $ARG2$ } 复制代码 定义的主机里添加 define service{ use generic-service host_name zy_web_01 notifications_enabled 1 service_description Nginx_Status check_command qhappy_check_nginx!http://174.36.186.59/index.php!www.9ai9.net! } 复制代码 以下是用法说明./qhappy_check_nginx.sh --helpA This Program is a plug of nagios to monitor WebServer , special for Nginx!This Program base on WebServer's respond status report an emergencyIt usefull on nginx repond 502 and 504 status2011, Qhappy (http://www.9ai9.net/)lxy1234@163.comHow to use Eg 1./qhappy_check_nginx.sh --urlhttp://www.9ai9.net/index.phpHow to use Eg 2./qhappy_check_nginx.sh --hostwww.9ai9.net--urlhttp://174.36.186.59/index.phpwww.9ai9.netPleace 174.36.186.69 replace of you site and IP!nginx返回502 504 和不能连接web服务器报告CRASHINGnginx返回200 报告正常 OK其他返回结果报 WARNING |
转载于:https://blog.51cto.com/study86/1331553