Hi,
I am new to Nagios but have so far managed to get it to work and I’m monitoring some simple pings and a windows server fine with no problems.
I now want to set up something to monitor if a website is up or not.
I have created a .cfg file called “URL” in /usr/local/nagios/etc/objects which looks like this:-
define host{
use generic-host
host_name Google
alias Google
address 209.85.225.99
}
define service{
use generic-service
host_name Google
service_description http
check_command check_http
}
I have pointed it to the .cfg in /usr/local/nagios/etc/nagios.cfg like this -:
# Definitions for monitoring a URL
cfg_file=/usr/local/nagios/etc/objects/url.cfg
When I go to check it with /usr/local/nagios/bin/nagios –v /usr/local/etc/nagios.cfg I get this error.
processing object config file "/usr/local/nagios/etc/objects/url.cfg"...
Error: Invalid max_check_attemps value for host "Google"
Error: Could not register host (config file "/usr/local/nagios/etc/objects/url.cfg" , starting on line 2)
Error processing object config files!
Can anyone help please. Thanks.
help with check_http
Re: help with check_http
Problem solved. You need to add some other commands when not using a template.
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: help with check_http
It may be helpful if you show the commands you used, or where you found out you needed to add them if possible. It may help someone in the future 
- inventsekar
- Posts: 37
- Joined: Fri Jul 20, 2012 11:29 am
Re: help with check_http
to help others, from the official pdf document:
-------------------------------------------------------
max_check_attempts:
This directive is used to define the number of times that Nagios
will retry the host check command if it returns any state other than
an OK state. Setting this value to 1 will cause Nagios to generate
an alert without retrying the host check. Note: If you do not want
to check the status of the host, you must still set this to a minimum
value of 1. To bypass the host check, just leave the check_command
option blank.
5 is the value they have shown in the pdf document, you can keep 3, maybe...
Thanks,
Sekar
-------------------------------------------------------
max_check_attempts:
This directive is used to define the number of times that Nagios
will retry the host check command if it returns any state other than
an OK state. Setting this value to 1 will cause Nagios to generate
an alert without retrying the host check. Note: If you do not want
to check the status of the host, you must still set this to a minimum
value of 1. To bypass the host check, just leave the check_command
option blank.
5 is the value they have shown in the pdf document, you can keep 3, maybe...
Thanks,
Sekar