Need some help for removing hosts in Nagios Core

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.
sandeep027
Posts: 33
Joined: Tue May 08, 2018 2:12 am

Need some help for removing hosts in Nagios Core

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

Re: Need some help for removing hosts in Nagios Core

Post 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.
Former Nagios employee
sandeep027
Posts: 33
Joined: Tue May 08, 2018 2:12 am

Re: Need some help for removing hosts in Nagios Core

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

Re: Need some help for removing hosts in Nagios Core

Post 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/.
Former Nagios employee
sandeep027
Posts: 33
Joined: Tue May 08, 2018 2:12 am

Re: Need some help for removing hosts in Nagios Core

Post 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 ?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Need some help for removing hosts in Nagios Core

Post 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.
Former Nagios employee
https://www.mcapra.com/
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Need some help for removing hosts in Nagios Core

Post by tmcdonald »

Thanks for the assist, @mcapra!
Former Nagios employee
sandeep027
Posts: 33
Joined: Tue May 08, 2018 2:12 am

Re: Need some help for removing hosts in Nagios Core

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

Re: Need some help for removing hosts in Nagios Core

Post 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.
Former Nagios employee
sandeep027
Posts: 33
Joined: Tue May 08, 2018 2:12 am

Re: Need some help for removing hosts in Nagios Core

Post by sandeep027 »

Thank you @donald, i will go through those links and will get back to you if any clarifications needed.
Locked