Guides‎ > ‎Common Checks‎ > ‎

Uptime

System Uptime Longer Than One Day

Check if the system uptime is longer than 1 day. Critical alert if system has been has been running for longer than one day.

NSClient++ 0.3.9 & 0.4.1 - Windows
No additional configuration is required.
Command:
check_nrpe -H 192.168.142.1 -t 30 -c CheckUpTime -a MaxCrit=1d

Output:
OK all counters within bounds.|'uptime'=3281000;0;86400000


NSClient++ 0.4.3 onwards - Linux And Windows
No additional configuration is required.
Command:
check_nrpe -H centos05 -t 30 -c Check_Uptime -a show-all 'warning=uptime>1d' 'critical=uptime>1d'

Output:
OK: uptime: 01:36h, boot: 2015-Jan-06 05:38:26 (UTC)|'uptime'=5805s;86400;86400


SNMP
8600000 = 1 day in timeticks
Command:
check_snmp -H 10.25.4.1 -o sysUpTime.0 -C public -P 2c -l Uptime -c 0:8600000

Output:
SNMP CRITICAL - Uptime *361925100* | Uptime=361925100;;8600000;

System Uptime Shorter Than One Day

Check if the system uptime is shorter than 1 day. Critical alert if system has been running for less than one day.

NSClient++ 0.3.9 & 0.4.1 - Windows
No additional configuration is required.
Command:
check_nrpe -H 192.168.142.1 -t 30 -c CheckUpTime -a MinCrit=1d

Output:
CRITICAL: uptime: 0:21 < critical|'uptime'=1263000;0;86400000


NSClient++ 0.4.3 onwards - Linux And Windows

No additional configuration is required.
Command:
check_nrpe -H 192.168.142.1 -t 30 -c Check_Uptime -a show-all 'warning=uptime<1d' 'critical=uptime<1d'

Output:
critical(uptime: 01:39h, boot: 2015-Jan-06 05:38:27 (UTC))|'uptime'=5980s;86400;86400


SNMP

8600000 = 1 day in timeticks
Command:
check_snmp -H 10.25.4.1 -o sysUpTime.0 -C public -P 2c -l Uptime -c 8600000:0

Output:
SNMP CRITICAL - Uptime *12834* | Uptime=12834;;8600000;