Page 1 of 1

Remove a server with a space " " in it.

Posted: Wed Mar 13, 2013 2:45 pm
by rez1sog
For some reason someone at the company create a server called "something" and one called "something ". The Nagios server now creates two config files:
"something.cfg" and "something .cfg" and then goes on to complain about there being duplicate entries. I have tried to find the "something " server via the NagiosXI web gui, but it does not seem to show up. How can I delete this bogus "something .cfg" server?

Re: Remove a server with a space " " in it.

Posted: Wed Mar 13, 2013 2:51 pm
by slansing
Are you able to see the configuration from the command line? Check the following directory:

Code: Select all

/usr/local/nagios/etc/hosts
If you do find it there, you should be able to remove it, and then run the configuration verification command and restart nagios:

Code: Select all

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

service nagios restart

Re: Remove a server with a space " " in it.

Posted: Wed Mar 13, 2013 3:14 pm
by rez1sog
I have removed the actual config files off the server, but everytime I update things via the GUI on NagiosXI, it magically reapears. So that method is sort of a dead end.

It does use a database to store it info and it must be in there somewhere.

Re: Remove a server with a space " " in it.

Posted: Wed Mar 13, 2013 3:25 pm
by sreinhardt
Yes XI does use a database backend to store and write config files from when applying changes. Have you tried the CCM or legacy CCM to find and remove the host?

Re: Remove a server with a space " " in it.

Posted: Wed Mar 13, 2013 3:29 pm
by scottwilkerson
Is this a host or service config?

If Host does it show up in CCM-> Hosts if you search for hostname?

If Service does it show up in CCM-> Hosts Services if you use the "Filter by Config Name: "?

If you go to
CCM -> Tools -> Write config files
Write
Verify

do you still get the error?

What version of XI are you running?