2、Nagios顯示類似錯誤:HTTP WARNING: HTTP/1.1 403 Forbidden - 5240 bytes in 0.002 second response time.
ommand.cfg:
define command{
command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
}
localhost.cfg:
define service{
use local-service
host_name localhost
service_description HTTP
check_command check_http
notifications_enabled 0
}
手動執行:
/usr/local/nagios/libexec
# ./check_http -I 127.0.0.1
HTTP WARNING: HTTP/1.1 403 Forbidden - 5240 bytes in 0.002 second response time.
該錯誤表明在apache web根目錄沒有index.html文件。
解決方法:在web根目錄(如:/var/www/html/目錄)建立index.html文件,重啓apache和nagios即可。