Page 1 of 1

Ghost contact preventing changes

Posted: Tue Aug 27, 2019 2:56 pm
by NMFSTeam
We have Nagios XI 5.6.5. We are trying to add a new host to the configuration for monitoring, via the standard Windows SNMP wizard, but when it goes to write the config, it fails, and we are getting an error message about "john.doe" on a .cfg file. The user "john.doe" was deleted, but apparently is still present on three .cfg files. How do we get rid of him, and proceed?

Full error is:

Code: Select all

Website: https://www.nagios.org
Reading configuration data...
   Read main config file okay...
Error: Contact 'john.doe' is not defined anywhere!
Error: Could not add contact 'john.doe' to host (config file '/usr/local/nagios/etc/hosts/HQ-TRANSIT-SW.cfg', starting on line 16)
   Error processing object config files!


***> One or more problems was encountered while processing the config files...

     Check your configuration file(s) to ensure that they contain valid
     directives and data definitions.  If you are upgrading from a previous
     version of Nagios, you should be aware that some variables/definitions
     may have been removed or modified in this version.  Make sure to read
     the HTML documentation regarding the config files, as well as the
     'Whats New' section to find out what has changed.
Found three entries that still have this user:

Code: Select all

[root@nagios01 ~]# find /usr/local/nagios/etc/hosts/ -type f -exec grep -H 'john.doe' {} \;
/usr/local/nagios/etc/hosts/HQ-BACKBONE-SW.cfg:    contacts                    john.doe
/usr/local/nagios/etc/hosts/HQ-TRANSIT-SW.cfg:    contacts                 john.doe
/usr/local/nagios/etc/hosts/HQ-WAN_TRANSIT-SW.cfg:    contacts                    john.doe

Re: Ghost contact preventing changes

Posted: Tue Aug 27, 2019 3:21 pm
by mbellerue
Looks like you've done most of the leg work. Just go to Configure -> Core Configuration Manager -> Hosts -> <One of the three hosts you found> -> Alert Settings -> Manage Contacts.

Your ghost should show up there under the Assigned section. You can just remove them from there, apply your configuration, and be good to go.

Re: Ghost contact preventing changes

Posted: Tue Aug 27, 2019 3:48 pm
by NMFSTeam
The ghost contact does not appear there. If I go through the standard interface (not the CCM), pull up the host, and go to Configure, Contacts, he shows up there, I can uncheck him, but then when I click save, I get the same error.

Re: Ghost contact preventing changes

Posted: Tue Aug 27, 2019 4:13 pm
by mbellerue
Drat, I thought that was going to be too easy.

Let's try it this way. This is a slightly different problem, but the resolution is what I'd like you to try.

https://support.nagios.com/kb/article/n ... d-144.html

Basically we're just going to try destroying the config files and rebuilding them based on what is in the database.

Re: Ghost contact preventing changes

Posted: Tue Aug 27, 2019 7:01 pm
by NMFSTeam
Worked like a charm! Had to write the files out, then delete them, write them out again, verify, and restart. Thank you so much!

Re: Ghost contact preventing changes

Posted: Wed Aug 28, 2019 7:36 am
by scottwilkerson
mblower wrote:Worked like a charm! Had to write the files out, then delete them, write them out again, verify, and restart. Thank you so much!
Great!

Locking