check_snmp problems
Posted: Mon Oct 05, 2020 6:18 pm
I'm creating a host-check command using check_snmp. I get the host name oid and attempt a string match. When I run it within nagiosxi it doesn't work but when I run it outside of nagiosxi in a terminal it does. What's the difference?
in nagiosxi
[nagios@z1-da1-c1-nms-1 ~]$ /usr/local/nagios/libexec/check_snmp -H x.x.x.x -o .1.3.6.1.2.1.1.5.0 -C public -s '"etm-1.tango-networks.com"'
SNMP CRITICAL - *"etm-1.tango-networks.com"* |
I copy then paste into a terminal
[nagios@z1-da1-c1-nms-1 libexec]$ /usr/local/nagios/libexec/check_snmp -H x.x.x.x -o .1.3.6.1.2.1.1.5.0 -C public -s '"etm-1.tango-networks.com"'
SNMP OK - "etm-1.tango-networks.com" |
[nagios@z1-da1-c1-nms-1 libexec]$
So I run with -v
nagiosXI
[nagios@z1-da1-c1-nms-1 ~]$ /usr/local/nagios/libexec/check_snmp -H x.x.x.x -o .1.3.6.1.2.1.1.5.0 -C public -s '"etm-1.tango-networks.com"' -v
/bin/snmpget -Le -t 3 -r 5 -m '' -v 1 [context] [authpriv] x.x.x.x .1.3.6.1.2.1.1.5.0
iso.3.6.1.2.1.1.5.0 = STRING: "etm-1.tango-networks.com"
SNMP CRITICAL - *"etm-1.tango-networks.com"* |
command line
[nagios@z1-da1-c1-nms-1 libexec]$ /usr/local/nagios/libexec/check_snmp -H x.x.x.x -o .1.3.6.1.2.1.1.5.0 -C public -s '"etm-1.tango-networks.com"' -v
/bin/snmpget -Le -t 3 -r 5 -m '' -v 1 [context] [authpriv] x.x.x.x .1.3.6.1.2.1.1.5.0
iso.3.6.1.2.1.1.5.0 = STRING: "etm-1.tango-networks.com"
SNMP OK - "etm-1.tango-networks.com" |
[nagios@z1-da1-c1-nms-1 libexec]$
same exact command with different results. What am I missing?
in nagiosxi
[nagios@z1-da1-c1-nms-1 ~]$ /usr/local/nagios/libexec/check_snmp -H x.x.x.x -o .1.3.6.1.2.1.1.5.0 -C public -s '"etm-1.tango-networks.com"'
SNMP CRITICAL - *"etm-1.tango-networks.com"* |
I copy then paste into a terminal
[nagios@z1-da1-c1-nms-1 libexec]$ /usr/local/nagios/libexec/check_snmp -H x.x.x.x -o .1.3.6.1.2.1.1.5.0 -C public -s '"etm-1.tango-networks.com"'
SNMP OK - "etm-1.tango-networks.com" |
[nagios@z1-da1-c1-nms-1 libexec]$
So I run with -v
nagiosXI
[nagios@z1-da1-c1-nms-1 ~]$ /usr/local/nagios/libexec/check_snmp -H x.x.x.x -o .1.3.6.1.2.1.1.5.0 -C public -s '"etm-1.tango-networks.com"' -v
/bin/snmpget -Le -t 3 -r 5 -m '' -v 1 [context] [authpriv] x.x.x.x .1.3.6.1.2.1.1.5.0
iso.3.6.1.2.1.1.5.0 = STRING: "etm-1.tango-networks.com"
SNMP CRITICAL - *"etm-1.tango-networks.com"* |
command line
[nagios@z1-da1-c1-nms-1 libexec]$ /usr/local/nagios/libexec/check_snmp -H x.x.x.x -o .1.3.6.1.2.1.1.5.0 -C public -s '"etm-1.tango-networks.com"' -v
/bin/snmpget -Le -t 3 -r 5 -m '' -v 1 [context] [authpriv] x.x.x.x .1.3.6.1.2.1.1.5.0
iso.3.6.1.2.1.1.5.0 = STRING: "etm-1.tango-networks.com"
SNMP OK - "etm-1.tango-networks.com" |
[nagios@z1-da1-c1-nms-1 libexec]$
same exact command with different results. What am I missing?