check_http 404 not found
-
nickanderson82
- Posts: 29
- Joined: Wed Sep 27, 2017 11:27 am
check_http 404 not found
Nagios server cfg file is:
# Define host for the local machine
define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name xxx.xxx.com
alias xxx.xxx.com
address xxx.xxx.com
}
###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################
# Define a service to "ping" the local machine
define service{
use generic-service ; Name of service template to use
host_name xxx.xxx.com
service_description PING
check_command check_ping!100.0,20%!500.0,60% -4
}
# Define a service to check HTTP on the local machine.
# Disable notifications for this service by default, as not all users may have HTTP enabled.
define service{
use generic-service ; Name of service template to use
host_name xxx.xxx.com
service_description HTTP
check_command check_http
notifications_enabled 0
}
-------
Nagios status information displays warning:
HTTP WARNING: HTTP/1.1 404 Not Found - 492 bytes in 5.007 second response time
I am not sure what the check_command edit should be or if i need to look elsewhere. The ping works as intended
# Define host for the local machine
define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name xxx.xxx.com
alias xxx.xxx.com
address xxx.xxx.com
}
###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################
# Define a service to "ping" the local machine
define service{
use generic-service ; Name of service template to use
host_name xxx.xxx.com
service_description PING
check_command check_ping!100.0,20%!500.0,60% -4
}
# Define a service to check HTTP on the local machine.
# Disable notifications for this service by default, as not all users may have HTTP enabled.
define service{
use generic-service ; Name of service template to use
host_name xxx.xxx.com
service_description HTTP
check_command check_http
notifications_enabled 0
}
-------
Nagios status information displays warning:
HTTP WARNING: HTTP/1.1 404 Not Found - 492 bytes in 5.007 second response time
I am not sure what the check_command edit should be or if i need to look elsewhere. The ping works as intended
-
kyang
Re: check_http 404 not found
Try doing this
in the index.html add this
save the file
Does this solve the http error on localhost?
Code: Select all
vi /var/www/html/index.htmlCode: Select all
<HTML>
<BODY>
Nagios Server
</BODY>
</HTML>Code: Select all
:wqCode: Select all
chmod 755 /var/www/html/index.html
chown apache:apache /var/www/html/index.html
service httpd restart-
nickanderson82
- Posts: 29
- Joined: Wed Sep 27, 2017 11:27 am
Re: check_http 404 not found
What exactly is that changing? I don't want to affect something that doesn't need to be changed
That HTTP WARNING: HTTP/1.1 404 Not Found - 492 bytes in 5.007 second response time
/\/\/\ That is listed in the status on my nagios page
Its like the check_command for check_http is wrong in my cfg file
That HTTP WARNING: HTTP/1.1 404 Not Found - 492 bytes in 5.007 second response time
/\/\/\ That is listed in the status on my nagios page
Its like the check_command for check_http is wrong in my cfg file
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: check_http 404 not found
We'd need to see how the command is defined, probably in the commands.cfg.
-
nickanderson82
- Posts: 29
- Joined: Wed Sep 27, 2017 11:27 am
Re: check_http 404 not found
# 'check_http' command definition
define command{
command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
}
define command{
command_name check_http
command_line $USER1$/check_http -I $HOSTADDRESS$ $ARG1$
}
-
dwhitfield
- Former Nagios Staff
- Posts: 4583
- Joined: Wed Sep 21, 2016 10:29 am
- Location: NoLo, Minneapolis, MN
- Contact:
Re: check_http 404 not found
Please run /usr/local/nagios/libexec/check_http xxx.xxx.com and post the output here in a code block.
Also, can you PM me the URL so I can test it?
Also, can you PM me the URL so I can test it?
-
nickanderson82
- Posts: 29
- Joined: Wed Sep 27, 2017 11:27 am
Re: check_http 404 not found
I pm-ed the url
but I get
HTTP WARNING: HTTP/1.1 404 Not Found - 492 bytes in 0.007 second response time |time=0.006990s;;;0.000000 size=492B;;;0
but I get
HTTP WARNING: HTTP/1.1 404 Not Found - 492 bytes in 0.007 second response time |time=0.006990s;;;0.000000 size=492B;;;0
-
nickanderson82
- Posts: 29
- Joined: Wed Sep 27, 2017 11:27 am
Re: check_http 404 not found
Any ideas?
-
kyang
Re: check_http 404 not found
@dwhitfield has informed me with your url.
It seems to work when using the -H for host address instead of -I for IP address.
Output
It seems to work when using the -H for host address instead of -I for IP address.
Code: Select all
/usr/local/nagios/libexec/check_http -H xxx.xxx.comCode: Select all
HTTP OK: HTTP/1.1 302 Found - 501 bytes in 0.182 second response time |time=0.182388s;;;0.000000 size=501B;;;0
-
nickanderson82
- Posts: 29
- Joined: Wed Sep 27, 2017 11:27 am
Re: check_http 404 not found
Should I change it to:
# 'check_http' command definition
define command{
command_name check_http
command_line $USER1$/check_http -H $HOSTADDRESS$ $ARG1$
}
Instead of the -I
# 'check_http' command definition
define command{
command_name check_http
command_line $USER1$/check_http -H $HOSTADDRESS$ $ARG1$
}
Instead of the -I