Delete all hosts and services

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Schoki
Posts: 6
Joined: Wed Mar 10, 2010 5:22 am

Delete all hosts and services

Post by Schoki »

Hi,

I installed the VMware image Nagios XI 2009R1.1E.
I added a few hosts and services and i tried to import the files from the normal Nagios, but that didn't work properly.
So my question:
How can i delete all hosts and services which are in Nagios XI and in the Nagios Core Config Manager?
I deleted...
/usr/local/nagios/etc/hosts/
/usr/local/nagios/etc/services/

and...

...I tried:
rm -f /usr/local/nagios/etc/import/*.cfg
usermod -a -G nagios nagios
/etc/init.d/httpd restart

... but all entrys are still there.

Thanks :)
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Delete all hosts and services

Post by mmestnik »

The Nagios Core config files are managed by Nagios QL(Should that be XI?) in any event local changes will be overwritten during the next update.

The data is stored in either postgresql(I think it's here) or mysql. We don't advice or support manual edits of the back-end database, but that's the answer you are looking for.
Schoki
Posts: 6
Joined: Wed Mar 10, 2010 5:22 am

Re: Delete all hosts and services

Post by Schoki »

Thanks for your answer.

Can you please show me exactly what I have to remove?

I can only find the postgresql or mysql in a backup folder?
barteuro
Posts: 6
Joined: Tue Feb 23, 2010 1:56 am

Re: Delete all hosts and services

Post by barteuro »

I had the same problem..

When I restarted the nagios webservice and the nagiosservice al these hosts/services were gone..

So try to run the following syntax's in the Nagios:

/etc/init.d/httpd restart

&

/etc/init.d/nagios restart

I hope this helps !
Schoki
Posts: 6
Joined: Wed Mar 10, 2010 5:22 am

Re: Delete all hosts and services

Post by Schoki »

/etc/init.d/nagios restart

-> Running configuration check... CONFIG ERROR! Restart aborted. Check your Nagios configuration.

I think, I have delete a config file... where can I get the standard config files? :mrgreen:
barteuro
Posts: 6
Joined: Tue Feb 23, 2010 1:56 am

Re: Delete all hosts and services

Post by barteuro »

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

run this on the nagios and it will tell you what the problem is.
Schoki
Posts: 6
Joined: Wed Mar 10, 2010 5:22 am

Re: Delete all hosts and services

Post by Schoki »

Checking services...
Error: There are no services defined!
Checked 0 services.
Checking hosts...
Error: There are no hosts defined!
Checked 0 hosts.

-> Because I deleted them, but I can still see the hosts and services on the web-interface on Nagios XI / Nagios Core Config Manager
barteuro
Posts: 6
Joined: Tue Feb 23, 2010 1:56 am

Re: Delete all hosts and services

Post by barteuro »

That can't be possible actually..

You need to define a host and a service..
If you wanted to monitor a host and a service, but for some reason don't what to do that anymore.. you should delete them in the webinterface (not in the config file, what I think you did).
Locked