Page 1 of 1

Clean Install: Nagios not displaying newly created host

Posted: Mon Jun 15, 2015 11:10 am
by umuzitech
I've installed Nagios Core 4.1.0 with plugins onto a newly installed CentOS 6. The site is up and running correctly as well as successfully monitoring localhost.

I've created a new file in the objects directory ending with .cfg. Within this file I've defined a host and a service, only to check_http. I've created it exactly as outlined in http://nagios.sourceforge.net/docs/nagi ... vices.html

I've also matched the permissions of this new file to localhost.cfg.

I've both reloaded Nagios as well as rebooted the server, but the website doesn't show the new host. Why is that?

Re: Clean Install: Nagios not displaying newly created host

Posted: Mon Jun 15, 2015 11:47 am
by jolson
Please post the configuration in question.

In addition, try running the following command - it will check your configuration files for errors.

Code: Select all

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

Re: Clean Install: Nagios not displaying newly created host

Posted: Mon Jun 15, 2015 12:01 pm
by umuzitech
Configuration <sheller.cfg>

Code: Select all

define host{
        use             generic-host
        host_name       shellerwebsite
        alias           Sheller.com Website
        address         sheller.com
        hostgroups      allhosts
        }

define service{
        use             generic-service
        host_name       shellerwebsite
        service_description     HTTP
        check_command   check_http
        }
The config check reports no errors. I used this before per the article I linked above.

btw, the server can resolve sheller.com into the actual IP, not a problem here.

Re: Clean Install: Nagios not displaying newly created host

Posted: Mon Jun 15, 2015 12:50 pm
by umuzitech
I got it all figured out now.

The problem was that the nagios.cfg didn't specify any cfg_file or cfg_dir which would have included my new file. Once I did this, all is well.

/Closed

Re: Clean Install: Nagios not displaying newly created host

Posted: Mon Jun 15, 2015 12:51 pm
by tmcdonald
Great to hear.

I'll be closing this thread now, but feel free to open another if you need anything in the future!