Check_SNMP vs snmpwalk
Posted: Tue Mar 07, 2017 3:46 pm
I get different output from check_snmp than I do snmpwalk...
----------------------------------------------------------
/> /usr/lib64/nagios/plugins/check_snmp -H 192.168.1.1 -C ComString -o sysUpTime.0
SNMP OK - 76017933 | DISMAN-EVENT-MIB::sysUpTimeInstance=76017933
----------------------------------------------------------
/> snmpwalk -v 1 -c ComString 192.168.1.1 sysUpTime.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (76017937) 8 days, 19:09:39.37
----------------------------------------------------------
Is there a way to convert what check_snmp displays (timetick value only) to a human readable format (example: 8 days, 18:32:42.80)?
This is how Nagios used to display the information "x days, hh:mm:ss". I use this as more a visual than I do for an alert.
Nagios® Core™ Version 4.2.4
CentOS Linux release 7.3.1611 (Core) 64bit
System Check:
define host{
use generic-switch
host_name switch01
alias switch01
address 192.168.1.1
}
define service{
use generic-service
host_name switch01
service_description System - Uptime
check_command check_snmp!-C ComString -o sysUpTime.0
}
commands.cfg:
# 'check_snmp' command definition
define command{
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
}
Thank you.
--
----------------------------------------------------------
/> /usr/lib64/nagios/plugins/check_snmp -H 192.168.1.1 -C ComString -o sysUpTime.0
SNMP OK - 76017933 | DISMAN-EVENT-MIB::sysUpTimeInstance=76017933
----------------------------------------------------------
/> snmpwalk -v 1 -c ComString 192.168.1.1 sysUpTime.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (76017937) 8 days, 19:09:39.37
----------------------------------------------------------
Is there a way to convert what check_snmp displays (timetick value only) to a human readable format (example: 8 days, 18:32:42.80)?
This is how Nagios used to display the information "x days, hh:mm:ss". I use this as more a visual than I do for an alert.
Nagios® Core™ Version 4.2.4
CentOS Linux release 7.3.1611 (Core) 64bit
System Check:
define host{
use generic-switch
host_name switch01
alias switch01
address 192.168.1.1
}
define service{
use generic-service
host_name switch01
service_description System - Uptime
check_command check_snmp!-C ComString -o sysUpTime.0
}
commands.cfg:
# 'check_snmp' command definition
define command{
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
}
Thank you.
--