Page 1 of 2

Need some help for removing hosts in Nagios Core

Posted: Tue May 08, 2018 2:19 am
by sandeep027
Hi All,

I am new to nagios and I need some help for removing hosts in Nagios core.

I am using nagios core monitoring tool and we are going to decommissioning the few servers.

so i need to remove those servers from nagios monitoring tool.

could you please help on this.

Regards,
Sandeep.

Re: Need some help for removing hosts in Nagios Core

Posted: Tue May 08, 2018 10:07 am
by tmcdonald
What specifically do you need help with? Removing hosts and services in Core is as simple as editing or deleting the config files they reside in.

Re: Need some help for removing hosts in Nagios Core

Posted: Wed May 09, 2018 1:46 am
by sandeep027
Thank you for responding donald. I want to remove the 2 hosts and services from nagios.

i have tried to commented out in nrpe.cfg files, but its not working and i thought that this is not the right way .

can you please help on that ,where i have to delete that config files.

Re: Need some help for removing hosts in Nagios Core

Posted: Wed May 09, 2018 11:28 am
by tmcdonald
You need to remove them from the nagios-specific config files, not the nrpe-specific config files. I can't tell you what they are named because I did not set up your system, but whoever set the system up should be able to point you in the right direction. Usually they are in /usr/local/nagios/etc/ or /etc/nagios/.

Re: Need some help for removing hosts in Nagios Core

Posted: Thu May 10, 2018 2:26 am
by sandeep027
@Donald, for us there is no nagios folders under /usr/local or /etc/

Actually we have one physical server is there and all the hosts are configured in this server. so on this serer when i executed the command
ps -ef | grep -i nagios its showing as below

/tool/nagios/bin/nagios -d /tool/nagios/etc/nagios.cfg
/tool/nagios/bin/nagios --worker /tool/nagios/var/rw/nagios.qh
/tool/nagiosNRPE/bin/nrpe -d -c /tool/nagiosNRPE/etc/nrpe.cfg

my requirement is , I want to remove few hosts in Nagios, for example A and B hosts i want to remove, when i excuted the same command(ps -ef | grep -i nagios ) in A host and B host its showing as below

/data/nagiosNRPE/bin/nrpe -d -c /data/nagiosNRPE/etc/nrpe.cfg

so when i checked in under this /tool/nagios/bin/nagios -d /tool/nagios/etc/nagios.cfg path , i didn't find where i have to remove these hosts.

can you please help on this.

and i found two files under /var/ directory in nagios like objects.cache and objects.precache, in that i am able to see "define service" command for all the hosts. i think this is the right path to remove, but here two files are there. in that two files where i have remove ?

Re: Need some help for removing hosts in Nagios Core

Posted: Thu May 10, 2018 8:22 am
by mcapra
sandeep027 wrote: and i found two files under /var/ directory in nagios like objects.cache and objects.precache, in that i am able to see "define service" command for all the hosts. i think this is the right path to remove
Nope. Those are just caches of the object definitions as indicated by their names.

You'll need to take a look in this file (please attach a copy of it as well):

Code: Select all

/tool/nagios/etc/nagios.cfg
That file should contain one or more cfg_file or cfg_dir directives in it. Those are where Nagios loads it's object definitions (hosts, services, contacts, etc) from. You'll need to search through them to find the specific hosts you want to remove. Since no one here wrote those configuration files, it's difficult to tell you specifically where a given host is located in your configuration set.

Re: Need some help for removing hosts in Nagios Core

Posted: Thu May 10, 2018 4:07 pm
by tmcdonald
Thanks for the assist, @mcapra!

Re: Need some help for removing hosts in Nagios Core

Posted: Fri May 11, 2018 3:59 am
by sandeep027
Thank a lot mcapra and Donald.

i have seen some files under /tool/nagios/etc/nagios.cfg as below, i need to check these all files where i have to remove. here the thing is the guy left the company who configured all these things before i joined in this account. now i have to check the below files that which one is working correctly .

Thanks for your help. Really apprecaite

localhost.cfg_working
localhost.cfg_work_now
localhost.cfg_1
localhost.cfg_2
localhost.cfg_oct3-2016
localhost.cfg_aug8-17_working.cfg
commands.cfg_working
templates.cfg
contacts.cfg

Re: Need some help for removing hosts in Nagios Core

Posted: Fri May 11, 2018 3:21 pm
by tmcdonald
You will probably want to read the Nagios Core documentation if you are going to take over this system: https://assets.nagios.com/downloads/nag ... n/toc.html

Specifically, these three sections should get you most of what you need to know in order to update your configuration:

https://assets.nagios.com/downloads/nag ... onfig.html
https://assets.nagios.com/downloads/nag ... bject.html
https://assets.nagios.com/downloads/nag ... gmain.html

Give those a read, and it should all make sense. If it does not, please let us know specifically what doesn't and we'll see what we can do.

Re: Need some help for removing hosts in Nagios Core

Posted: Mon May 14, 2018 2:13 am
by sandeep027
Thank you @donald, i will go through those links and will get back to you if any clarifications needed.