Remove a server with a space " " in it.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
rez1sog
Posts: 38
Joined: Fri Mar 16, 2012 6:02 am

Remove a server with a space " " in it.

Post 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?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

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

Post 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
rez1sog
Posts: 38
Joined: Fri Mar 16, 2012 6:02 am

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

Post 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.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

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

Post 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?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked