check_snmp and sysuptimeinstance problem


#1

Hi All,
I’ve spent most of the morning searching the web for an answer to this small problem without much success. I’m sure the answer’s going to be that it’s impossible, but I thought I’d ask anyway.
The problem is that I’m doing an uptime check on a host via check_snmp and using the sysuptimeinstance request to return a human readable value back that people can see at a glance the uptime of the host, as requested by my colleagues. This is returning fine as follows:

check_snmp -H 192.168.2.2 -v 1 -C public -o sysuptimeinstance

returns

SNMP OK - Timeticks: (941602422) 108 days, 23:33:44.22 |

However, when I try and incorporate a critical check into the command, to check to see if the system has rebooted, and thus inform the admins of the fact, the return comes back in timeticks only, giving me the problem of either having a check in the system for a reboot, or the uptime in readable format. The result of the ammended command:

check_snmp -H 192.168.2.2 -v 1 -C public -o sysuptimeinstance -c 1000:0

returns

SNMP OK - 941632746 | DISMAN-EVENT-MIB::sysUpTimeInstance=941632746

I don’t suppose that there’s a way that I can incorporate both requirements in one command is there? :slight_smile:

Thanks in advance!

Cheerie,
Monty