Nagios3 - Check_HTTP Plugin

Hi Everyone,

I am newbie with Nagios. I have got the basic installation complete and monitoring the local host. I am currently trying to setup monitoring of my web servers on the internet (not on my local network). I have been working with the artcile on nagios.com and a nagios book I purchased but I am having trouble understanding a few things and getting it working to monitor the web servers.

Overall I am still getting use to woring with the .cfg files so here is what I have so far in my /etc/nagios3 directory

services.cfg
cgi.cfg
hosts.cfg
nagios.cfg
commands.cfg
resource.cfg
hosts.cfg~
services.cfg~

My host.cfg containts the following:

*define host{

use		generic-host		; Inherit default values from a template
            host_name	remotehost		; The name we're giving to this host
            alias		MyWebServer	                ; A longer name associated with the host
            address		72.74.50.XX		; IP address of the host
            hostgroups	allhosts       		; Host groups this host is associated with

}*

My commands.cfg contains the following:

*define command{

name		check_http
            command_name	check_http
            command_line	$USER1$/check_http -I $HOSTADDRESS$ $ARG1$

}*

My services.cfg contains the following:

*define service{

use		generic-service		; Inherit default values from a template
            host_name	remotehost
            service_description	HTTP
            check_command	check_http
}*

Those are basic configurations I pulled off the nagios web site. After I save all the configuration files and reload nagios, the MyWebServer is not being monitored or showing up in my list of hosts. I am just curious as to what I am missing.

Thanks!!

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

run this and check for errors :slight_smile:

Thanks luca. Looks like I have an issue with one of my config files…

my test results:

*Warning: Duplicate definition found for command ‘check_http’ (config file ‘/etc/nagios-plugins/config/http.cfg’, starting on line 2)
Error: Cound not add object property in file ‘/etc/nagios-plugins/config/http.cfg’ on line 3.

***> One of more problems was encountered while processing the config files…

Check your config files…*

It looks likes the check_http plug file is duplicated. What would be the next step?

Thanks!

During the installation it looks like I installed the plugins in two locations…

  1. /etc/nagios-plugins/config
  2. /usr/lib/nagios/plugins/

My installation of nagios is:

/etc/nagios3

Is it safe to delete the 2nd location of the plugins?

Thanks!

most probably your installation is NOT in /etc/nagios3 but there’s only the ocnfig files there…

a) check your config files looking for the dfuplicate definitions. you wrote them… you should know :slight_smile:
b) consider removing RPM packages and installing from scratch compiling nagios by yourself, takes a bit but you’ll have a better knowledge of where the files are located. :slight_smile:

Yes, I think I may start over from scratch. Im new to Nagios and Linux so Im still getting used the commands and understand file structure. I just purchased a Nagios book so I may work along with that. Thanks for the info!

check out the docs too: nagios.sourceforge.net/docs/3_0/ :slight_smile: