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

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
ucop
Posts: 20
Joined: Wed May 22, 2013 5:55 pm

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

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

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

Post 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.
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.
ucop
Posts: 20
Joined: Wed May 22, 2013 5:55 pm

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

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
ucop
Posts: 20
Joined: Wed May 22, 2013 5:55 pm

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

Post by ucop »

Thanks a lot for the info provided. This solved the issue and the checks are working.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post by abrist »

No problem, have a good week. Cheers.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.