Page 1 of 1
Delete all hosts and services
Posted: Wed Mar 10, 2010 5:39 am
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

Re: Delete all hosts and services
Posted: Thu Mar 11, 2010 4:20 pm
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.
Re: Delete all hosts and services
Posted: Fri Mar 12, 2010 2:57 am
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?
Re: Delete all hosts and services
Posted: Fri Mar 12, 2010 5:44 am
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 !
Re: Delete all hosts and services
Posted: Fri Mar 12, 2010 5:52 am
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?

Re: Delete all hosts and services
Posted: Fri Mar 12, 2010 6:36 am
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.
Re: Delete all hosts and services
Posted: Mon Mar 15, 2010 2:49 am
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
Re: Delete all hosts and services
Posted: Mon Mar 15, 2010 4:02 am
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).