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
Nagios xi does not support SNMP community string with '!'
-
- Posts: 20
- Joined: Wed May 22, 2013 5:55 pm
-
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Nagios xi does not support SNMP community string with '!
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.
-
- Posts: 20
- Joined: Wed May 22, 2013 5:55 pm
Re: Nagios xi does not support SNMP community string with '!
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
thanks
-
- Red Shirt
- Posts: 8334
- Joined: Thu Nov 15, 2012 1:20 pm
Re: Nagios xi does not support SNMP community string with '!
I would suggest using the resource.cfg located at:
Define a new $USERn$ macro and assign the community string to it - we will use $USER9$ for this example:
Save out. Now edit the check, replacing the community string with:
Save out and restart nagios.
Code: Select all
/usr/local/nagios/etc/resource.cfg
Code: Select all
$USER9=mycommunitystring
Code: Select all
$USER9$
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.
"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.
-
- Posts: 20
- Joined: Wed May 22, 2013 5:55 pm
Re: Nagios xi does not support SNMP community string with '!
Thanks a lot for the info provided. This solved the issue and the checks are working.
-
- Red Shirt
- Posts: 8334
- Joined: Thu Nov 15, 2012 1:20 pm
Re: Nagios xi does not support SNMP community string with '!
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.
"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.