Page 1 of 2

Changes to nagios config nto taking effect on nagios webadmi

Posted: Tue Jan 28, 2020 5:47 am
by sahasra
Hi ,

We have Nagios core 4.4.1 installed and running for the past 1 year and it is monitoring few windows machine for diskspace,memory etc.

We have added a new windows configuration and verified the configuration using the command below and there are no errors but the Nagios webadmin host list is not showing this windows machine even after restart of Nagios and reboot of nagios server. Windows machine NSCLient++ installed,configured and running.

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



Then we just removed couple of windows machines check from Nagios.cfg and restart Nagios. Nagios web admins till showing those hosts.

So looks like any changes are getting reflected on web admin.

PLease advise..


Thanks,
Sahasra.

Re: Changes to nagios config nto taking effect on nagios web

Posted: Tue Jan 28, 2020 8:13 pm
by Box293
You may have multiple nagios processes running.

Can you please follow this guide, under the section "Check For Multiple Nagios Processes":

https://support.nagios.com/kb/article.php?id=19

Even though the guide is for Nagios XI the same applies for Nagios Core.

Re: Changes to nagios config nto taking effect on nagios web

Posted: Wed Jan 29, 2020 7:57 am
by sahasra
Only single Nagios process running


nagios 4707 1 0 Jan22 ? 00:03:52 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
nagios 4726 4707 0 Jan22 ? 00:00:59 /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg

Re: Changes to nagios config nto taking effect on nagios web

Posted: Wed Jan 29, 2020 9:58 am
by tgriep
Can you post your /usr/local/nagios/etc/nagios.cfg file and the location of where the cfg files are for the new host and also, the names and locations of the hosts that were removed?

Please run the verbose output of the verification and post the output here. Notice the 2 v's.

Code: Select all

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

Re: Changes to nagios config nto taking effect on nagios web

Posted: Fri Jan 31, 2020 3:59 am
by sahasra
Hi,

The config files are in /usr/local/nagios/etc/objects and the new windows host added is CIMTONE.cfg and the ones, we have removed are CI_PGC_PROD_114.cfg and CI_NCL_PROD_116.cfg.

Here is the verbose result below:

[root@CI-NagiosNOC ~]# /usr/local/nagios/bin/nagios -vv /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.4.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 2018-06-25
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/templates.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/localhost.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/CI_64MS_101.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/CI_64MS_104.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/CI_64MS_99.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/CI_PGC_PROD_112.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/CI_NCL_PROD_115.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/CI-PD-PROD-102.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/CI-PERDUE-103.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/CI-MHOST-1.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/CIELI_BLU_39.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/CIELI_BLU_40.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/CI-PD-PROD-105.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/CI_PGC_PROD_113.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/CI_NCL_110.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/CIMTONE.cfg'...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 44 services.
Checked 15 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 8 contacts.
Checked 1 contact groups.
Checked 53 commands.
Checked 6 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 15 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 6 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0

Things look okay - No serious problems were detected during the pre-flight check

Re: Changes to nagios config nto taking effect on nagios web

Posted: Fri Jan 31, 2020 10:02 am
by tgriep
Go to the /usr/local/nagios/var folder and look at the objects.cache and the retention.dat and status.dat file and note the date - time stamp.
Restart the nagios process. Did the date and time changed on those files?
They hold the current configs and the status on the checks so they should update when nagios is restarted.

Another question, do you have any brokers setup in nagios like ndoutils, livestatus, Gearman, etc?

Re: Changes to nagios config nto taking effect on nagios web

Posted: Mon Feb 03, 2020 4:18 am
by sahasra
Hi,
I don't see the timestamp change happening for objects.cache and retention.dat file after restarting Nagios but can the timestamp changing for status.dat file. No brokers setup.

Re: Changes to nagios config nto taking effect on nagios web

Posted: Mon Feb 03, 2020 10:03 am
by tgriep
Run this as root to stop the nagios process and kill off and other processes and then start it up.

Code: Select all

service nagios stop
killall -9 nagios
pkill -9 -u nagios
service nagios start
See if the date time stamps update on the files.
If not, I recommend updating Core to the latest version.

Re: Changes to nagios config nto taking effect on nagios web

Posted: Wed Feb 05, 2020 7:19 am
by sahasra
Thank you so much. The above steps worked.

Can now see new host added and the ones removed not getting listed on the web admin

Re: Changes to nagios config nto taking effect on nagios web

Posted: Wed Feb 05, 2020 3:28 pm
by benjaminsmith
Hello,
Thank you so much. The above steps worked.
Great. Did you have any other questions or may we close this thread?