Hi all
Please I need your help
I am running a command using check_snmp but I am getting: SNMP OK - "4"
How can I create a PNP4NAGIOS template that removes " so I can get only the number so I can plot it.
Thanks
Oscar
PNP4NAGIOS: Remove symbols (") from snmp query
Re: PNP4NAGIOS: Remove symbols (") from snmp query
Could you post how the check is configured?
Login to the server and change to the folder where the check_snmp is at and run the following.
Login to the server and change to the folder where the check_snmp is at and run the following.
Code: Select all
./check_snmp --version
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: PNP4NAGIOS: Remove symbols (") from snmp query
Thanks
Here you are:
./check_snmp --version
check_snmp v2.0.3 (nagios-plugins 2.0.3)
Here you are:
./check_snmp --version
check_snmp v2.0.3 (nagios-plugins 2.0.3)
Re: PNP4NAGIOS: Remove symbols (") from snmp query
Can you show us the full check command run from the cli with the verbose (-vvv) flag?
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.
Re: PNP4NAGIOS: Remove symbols (") from snmp query
Here you are:
/usr/bin/snmpget -Le -t 1 -r 5 -m '' -v 3 [authpriv] 10.33.13.11:161 1.3.6.1.4.1.8072.1.3.2.3.1.1.15.118.105.115.95.111.110.108.105.110.101.95.103.112.114.115
iso.3.6.1.4.1.8072.1.3.2.3.1.1.15.118.105.115.95.111.110.108.105.110.101.95.103.112.114.115 = STRING: "65"
Processing oid 1 (line 1)
oidname: iso.3.6.1.4.1.8072.1.3.2.3.1.1.15.118.105.115.95.111.110.108.105.110.101.95.103.112.114.115
response: STRING: "65"
SNMP OK - "65" |
/usr/bin/snmpget -Le -t 1 -r 5 -m '' -v 3 [authpriv] 10.33.13.11:161 1.3.6.1.4.1.8072.1.3.2.3.1.1.15.118.105.115.95.111.110.108.105.110.101.95.103.112.114.115
iso.3.6.1.4.1.8072.1.3.2.3.1.1.15.118.105.115.95.111.110.108.105.110.101.95.103.112.114.115 = STRING: "65"
Processing oid 1 (line 1)
oidname: iso.3.6.1.4.1.8072.1.3.2.3.1.1.15.118.105.115.95.111.110.108.105.110.101.95.103.112.114.115
response: STRING: "65"
SNMP OK - "65" |
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: PNP4NAGIOS: Remove symbols (") from snmp query
oarias wrote:Here you are:
/usr/bin/snmpget -Le -t 1 -r 5 -m '' -v 3 [authpriv] 10.33.13.11:161 1.3.6.1.4.1.8072.1.3.2.3.1.1.15.118.105.115.95.111.110.108.105.110.101.95.103.112.114.115
iso.3.6.1.4.1.8072.1.3.2.3.1.1.15.118.105.115.95.111.110.108.105.110.101.95.103.112.114.115 = STRING: "65"
Processing oid 1 (line 1)
oidname: iso.3.6.1.4.1.8072.1.3.2.3.1.1.15.118.105.115.95.111.110.108.105.110.101.95.103.112.114.115
response: STRING: "65"
SNMP OK - "65" |
Can you please give us the full check_snmp command that generated this output.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: PNP4NAGIOS: Remove symbols (") from snmp query
./check_snmp -H 10.33.13.11 -o 1.3.6.1.4.1.8072.1.3.2.3.1.1.15.118.105.115.95.111.110.108.105.110.101.95.103.112.114.115 -U visadm -A Admin123 -L authNoPriv -P 3 -a MD5 -vvv
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: PNP4NAGIOS: Remove symbols (") from snmp query
When I further look at your problem, the source of the problem is apparent in the verbose output:
Because it's a STRING that is returned, it does not generate any performance data because it is a sting instead of an INTEGER.
I did a test on my machine:
I found my STRING output did NOT contain quotes, so I believe it is your remote device adding the quotes.
As for removing the quotes, I think you need a wrapper script that runs the check_snmp command and then strips the quotes and returns the original exit code and stripped string.
Code: Select all
response: STRING: "65"
I did a test on my machine:
Code: Select all
/usr/local/nagios/libexec/check_snmp -H 192.168.207.1 -p 161 -o sysName.0 -C public -P 2c -m SNMPv2-MIB -vvv
/usr/bin/snmpget -Le -t 1 -r 5 -m SNMPv2-MIB -v 2c [authpriv] 192.168.207.1:161 sysName.0
SNMPv2-MIB::sysName.0 = STRING: tlea7
Processing oid 1 (line 1)
oidname: SNMPv2-MIB::sysName.0
response: STRING: tlea7
SNMP OK - tlea7 |
As for removing the quotes, I think you need a wrapper script that runs the check_snmp command and then strips the quotes and returns the original exit code and stripped string.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.