Removing an asset from Noagios Core monitoring..Issues
Removing an asset from Noagios Core monitoring..Issues
I have recently taken support of our Nagios Core and we monitor several types of devices. I have a server that was taken out of production and shut down. Nagios now shows it as red and I need to remove it from being monitored. I see it and have removed it from the following cfg files. HOST.CFG, HOSTGROUPS.CFG, SERVICES.CFG AND WINDOWS.CFG. I have remove server from each one at a time and I have removed the server from all at once before restarting. I get error messages every time and it never gets removed from monitoring. As I have no documentation I am needing the proper way to completely remove a server from Nagios? Thanks
Re: Removing an asset from Noagios Core monitoring..Issues
After you removed the entry from the config files, did you restart nagios, so that changes can take effect? I would recommend verifying configuration first:
Note: Change the path to the binary or config file if it is different on your system.
If you don't see any config errors, restart nagios:
Let us know if this helped.
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
If you don't see any config errors, restart nagios:
Code: Select all
service nagios restart
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Removing an asset from Noagios Core monitoring..Issues
After I remove all instances of the server from each of the 4 sperate cfg files I do a restart. This is when I receive an error and nagios goes offline.Here is the error I received.
Error: Could not find any host matching '(server name)' (config file '/etc/nagios/objects/hostgroups.cfg', starting on line 6)
Error: Could not expand members specified in hostgroup (config file '/etc/nagios/objects/hostgroups.cfg', starting on line 6
There is no reference to the server in the hostgroup or any other of the cfg files. Added question....The server was taken offline before being removed from Nagios, is that an issue? Also, is there an order to remove from each cfg or can they be removed at once?
Error: Could not find any host matching '(server name)' (config file '/etc/nagios/objects/hostgroups.cfg', starting on line 6)
Error: Could not expand members specified in hostgroup (config file '/etc/nagios/objects/hostgroups.cfg', starting on line 6
There is no reference to the server in the hostgroup or any other of the cfg files. Added question....The server was taken offline before being removed from Nagios, is that an issue? Also, is there an order to remove from each cfg or can they be removed at once?
Re: Removing an asset from Noagios Core monitoring..Issues
Did you forget to remove the host from the hostgroup? What do you have on (around) line 6 in /etc/nagios/objects/hostgroups.cfg? You need to make all of the changes, verify configuration, and ONLY if there are no config errors, restart nagios. It doesn't matter if your server (the host) is UP or DOWN.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Removing an asset from Noagios Core monitoring..Issues
I removed all instances of the host(server) from the hostgroup, host, service and windows cfg files. Still received the error on restart. You mentioned testing to verify the cfg before restarting? What is the best way to do that? I typically make a copy of the good cfg, make changes and do a restart of Nagios service. If I can test each file before restarting that would help.
Re: Removing an asset from Noagios Core monitoring..Issues
You need to run:You mentioned testing to verify the cfg before restarting?
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Be sure to check out our Knowledgebase for helpful articles and solutions!