Page 1 of 1

Problem with community containing special characters

Posted: Thu Apr 10, 2014 5:46 pm
by ppalaguachi1976
hello
Nagios Xi I'm testing in our company snmp community standard contains special characters, nagios xi having trouble adapting to plug check_ifoperstatus

Try editing the file command.cfg by placing the variable $ ARG1 $ in single quotes, but every time you run the program is removed. Is there any way to make nagios Xi accept special characters in the snmp community?


reviewing the console and verify that this type of check I can see doing that changes the snmp community, my community is $1$3.v/q/$; but notes $1$3.v/q/$$; why it gives me the error that is not recognized snmp

nagios 4917 4916 1 07:52 ? 00:00:00 /usr/bin/perl -w /usr/local/nagios/libexec/check_ifoperstatus -H 10.101.11.228 -C $1$3.v/q/$$ -k 9

Re: Problem with community containing special characters

Posted: Fri Apr 11, 2014 10:02 am
by abrist
1) You could attempt to escape the dollar signs ($):
http://support.nagios.com/wiki/index.ph ... ck_Command

2) Or you could use resource.cfg:
Your community string includes 'illegal' meta characters. You will need to use the file /usr/local/nagios/etc/resource.cfg. Edit it to include (we will use $USER9$ for this example):

Code: Select all

$USER9$=$1$3.v/q/$$
Then change your command to:

Code: Select all

$USER1$/check_ifoperstatus -H $HOSTADDRESS$ -C $USER9$ -k 9

Re: Problem with community containing special characters

Posted: Mon Oct 17, 2016 3:14 pm
by ekarajica
My SNMP comunity name has $ in it. I tired defining $USER9$=communityname in /usr/local/nagios/etc/resource.cfg but that didn't work. Could you please help?

Thank you

Re: Problem with community containing special characters

Posted: Mon Oct 17, 2016 3:30 pm
by tgriep
Did you try to escape the $ in the password like the example shows?

Also, you can try and surround the password with a single quote and see if that works as well.

Code: Select all

$USER9$='pass$word'

Re: Problem with community containing special characters

Posted: Mon Oct 17, 2016 3:31 pm
by rkennedy
In addition to what @tgriep mentioned, if it does not work -

Could you please show us your entire check_command, and related command definition? What error are you seeing?

This document is pretty useful if you haven't seen it yet - https://assets.nagios.com/downloads/nag ... Macros.pdf