最近新裝的Nagios,localhost总是会报警告:“WARNING: HTTP/1.1 403 Forbidden ”,今天下午得空Google了一番,找到一个解决方法分享出来。
In dashboard it shows alert on localhost i.e our own newly set up nagios server.
在此目录创建一个index.html文件: /var/www/html
touch /var/www/html/index.html
重启httpd和nagios服务,等待几分钟警告就自动清除了。
/etc/init.d/nagios restart /etc/init.d/httpd restart
Wait for a few minutes the alert will be gone. Yes we are done here.
以下是操作步骤
[root@localhost html]# whoami root [root@localhost html]# /usr/local/nagios/libexec/check_http -I 127.0.0.1 HTTP WARNING: HTTP/1.1 403 Forbidden – 5237 bytes in 0.001 second response time |time=0.000719s;;;0.000000 size=5237B;;;0 [root@localhost html]# pwd /var/www/html [root@localhost html]# touch index.html [root@localhost html]#service nagios restart [root@localhost html]# service httpd restart [root@localhost html]# /usr/local/nagios/libexec/check_http -I 127.0.0.1 HTTP OK: HTTP/1.1 200 OK – 265 bytes in 0.001 second response time |time=0.000574s;;;0.000000 size=265B;;;0
Note: check your check_http plugin where it is located in server. 我的主机上此文件在:/usr/local/nagios/libexec/check_http
转载于:https://blog.51cto.com/freman/1213766