Page 1 of 1

Bad Characters in a cfg description. Nagios wont save.

Posted: Thu May 31, 2012 6:57 pm
by krw
So more testing and getting to know Nagios I decided to add a switch to monitor. Its an old Cisco 2950.
SNMP is enabled.

Went through the discovery process, found which switch ports were up and all have descriptions. Hmm,
good stuff. Hit apply to save config and nagios errors out:

Error: The description string for service '<< CMTS-1 >> Status' on host 'my.host.name' contains one or more illegal characters.
Error: The description string for service '<< City1 - City2 >> Bandwidth' on host 'my.host.name' contains one or more illegal characters.

Hmm, ok < characters might be a problem. Its only a few ports so I'll go in and put a new description on
the ports.

Run through the discovery again, looks good, no << characters anywhere, hit apply and nagios errors again on the same
thing.

So now it appears nagios has stored somewhere the bad config from the first time I tried this and now will not
write any updated configs because of that. The FAQ does not appear to have anything about this problem.
What file(s) do I need to delete on the server to fix this?

Thanks.

Re: Bad Characters in a cfg description. Nagios wont save.

Posted: Fri Jun 01, 2012 9:19 am
by lmiltchev
Nagios cannot start or restart with bad configuration. I would suggest running the Write Config Tool, in order to verify your configuration, find out if there are any errors, fix them, and then apply configuration. To learn more about using the Write Config Tool, you can read this document:

http://assets.nagios.com/downloads/nagi ... tabase.pdf

Hope this helps.

Re: Bad Characters in a cfg description. Nagios wont save.

Posted: Fri Jun 01, 2012 12:03 pm
by krw
I can see the errors and know what they are and what .cfg file they are coming from.

I delete the offending .cfg file, but it gets re-created from bad information sitting somewhere
from when I ran the monitoring wizard over a switch. I told the monitoring wizard to use the
port descriptions which had << >> in the descriptions. When I went to save/apply the config
nagios did not like the << >> characters.

nagios created the .cfg file, but when I delete the config file, it gets recreated when I try
to save/apply again. So the data from that monitoring wizard is still kicking around somewhere
and I don't know where. Consequently I can not make any changes at the moment.

Is there something stuck in a database I need to get rid of?

EDIT: So yea, I figured it out.

Thanks.

Re: Bad Characters in a cfg description. Nagios wont save.

Posted: Fri Jun 01, 2012 2:10 pm
by scottwilkerson
Glad you figured it out.

For completeness, the item would need to be removed from the CCM or it will be rewritten next time the configuration is applied.