Page 1 of 1

can the databse be set back to default?

Posted: Wed Mar 16, 2011 11:37 am
by sal@coned
NagisXI 2011R1.1
CentOS 5.4
VMware image running on ESX

This may be stupid question, but since I installed the new version of NagiosXI I keep on running into one issue after the other.

First I could not see any performance graphs ( that was resolved )
I am now getting a Failed status on the "Monitoring Engine" and the "Event Data"

I had created one host group "windows_server"
I created two services using the check_nrpe command to check disk space and physical memory
both of these services were tested on the command line and worked properly
I then associated the services with the hostgroup "windows_server"

When I created my first host and associated it with the "windows_server" I could not apply the configuration
The logs said there was an error with the win_system.cfg file ( That the name of the services I created )

I deleted the host and services I created and keep getting the same error
I whent into the server and the /usr/local/nagios/etc/services/win_system.cfg file was still there even after I deleted

So I am assuming the data still exists in the database and the file keeps getting recreated.
Is there a way to set the database back to default with out recreating the server from scratch ?

I apologize for the lengthy letter, but I have not run into this many issues with the old version and its getting frustrating.

Thanks for the help
Sal

Re: can the databse be set back to default?

Posted: Wed Mar 16, 2011 11:50 am
by sal@coned
This is the error I get when I apply the configuration

Processing object config file '/usr/local/nagios/etc/services/www.google.com.cfg'...
Processing object config file '/usr/local/nagios/etc/services/win_system.cfg'...
Error: Invalid max_check_attempts value for host 'tampafs'
Error: Could not register host (config file '/usr/local/nagios/etc/hosts/tampafs.cfg', starting on line 14)
Error processing object config files!


The thing to note is that both the win_system service and the tampafs host have both been deleted.

Re: can the databse be set back to default?

Posted: Thu Mar 17, 2011 9:41 am
by mguthrie
Check these solutions for hosts that can't be deleted correctly.

http://support.nagios.com/wiki/index.ph ... lete_Hosts

Re: can the databse be set back to default?

Posted: Thu Mar 17, 2011 10:46 am
by tonyyarusso
Being able to reset to the defaults is also a useful idea - I'm working on figuring out what's necessary for that right now.

Re: can the databse be set back to default?

Posted: Thu Mar 17, 2011 11:15 am
by tonyyarusso
All right, here it is. Upload the two attached files to your XI server (via scp), and then log in on a console, and run this from whatever directory you put them in:

Code: Select all

chmod +x restore_defaults.sh
./restore_defaults.sh

Re: can the databse be set back to default?

Posted: Fri Mar 18, 2011 9:21 am
by sal@coned
Thank you, this helps out allot.

Re: can the databse be set back to default?

Posted: Fri Mar 18, 2011 9:34 am
by rdedon
Please keep us in the loop either way. Thanks!