Clean Install: Nagios not displaying newly created host

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
umuzitech
Posts: 6
Joined: Mon Jun 15, 2015 11:06 am

Clean Install: Nagios not displaying newly created host

Post 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?
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Clean Install: Nagios not displaying newly created host

Post 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
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
umuzitech
Posts: 6
Joined: Mon Jun 15, 2015 11:06 am

Re: Clean Install: Nagios not displaying newly created host

Post 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.
umuzitech
Posts: 6
Joined: Mon Jun 15, 2015 11:06 am

Re: Clean Install: Nagios not displaying newly created host

Post 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
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Clean Install: Nagios not displaying newly created host

Post 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!
Former Nagios employee
Locked