Page 1 of 1

Nagios XI does not support SNMP community string with '!'

Posted: Tue Aug 13, 2013 10:15 am
by ucop
Hello,

I just found out that I cannot use the '!' sign in SNMP v2 community strings when configuring check_snmp service in Nagios. If i try to save the service, Nagios will remove the '!' and distort the command line.

Is there a known work around for this issue. It is a huge show stopper for us, as we have several regions across the country that cannot change their SNMP string naming conventions due to security reasons.

Any input is greatly appreciated.
Thanks in advance

Re: Nagios XI does not support SNMP community string with '!

Posted: Tue Aug 13, 2013 10:21 am
by sreinhardt
You can attempt to define this in a static configuration and import it into the service checks you are working with. Alternatively you can try using free variables instead of defining this in the service\command definition. The reason that ! cannot be used in normal circumstances is that it is used to separate arguments in command definitions. Using it as a free variable is likely easiest and should get around the problem.

Re: Nagios XI does not support SNMP community string with '!

Posted: Tue Aug 13, 2013 10:41 am
by ucop
sounds like a good idea. I can export a variable with the community string. Can you advise on how to call a variable in the service definition?

thanks

Re: Nagios XI does not support SNMP community string with '!

Posted: Tue Aug 13, 2013 10:45 am
by abrist
I would suggest using the resource.cfg located at:

Code: Select all

/usr/local/nagios/etc/resource.cfg
Define a new $USERn$ macro and assign the community string to it - we will use $USER9$ for this example:

Code: Select all

$USER9=mycommunitystring
Save out. Now edit the check, replacing the community string with:

Code: Select all

$USER9$
Save out and restart nagios.

Re: Nagios XI does not support SNMP community string with '!

Posted: Tue Aug 13, 2013 10:59 am
by ucop
Thanks a lot for the info provided. This solved the issue and the checks are working.

Re: Nagios XI does not support SNMP community string with '!

Posted: Tue Aug 13, 2013 11:03 am
by abrist
No problem, have a good week. Cheers.