Home » Categories » Check Library

Uptime Checks

Uptime Checks

Uptime checks can alert you to when a system has rebooted (or has not). The performance data returned can also help identify trends with systems that may be having issues.

The sections below provide examples of how to perform these checks using different methods.

 

Nagios Plugins

The check_uptime plugin is part of Nagios Plugins. The thresholds for the plugin are triggered if the system uptime is more than the supplied value.

System Uptime Longer Than 1 Day

Unit: Days
Critical: Up more than 1 day

Command:

./check_uptime -u days -c 1

Output:

Uptime CRITICAL: 25 day(s) 20 hour(s) 11 minute(s) | uptime=25.000000;;1.000000;

 

System Uptime Shorter Than 1 Day

The check_uptime plugin does not provide this check type, however you can use the negate plugin to invert the returned result from the plugin (hence making CRITICAL an OK state).

Unit: Days
Critical: Up less than 1 day

Command:

./negate -s ./check_uptime -u days -c 1

Output:

Uptime OK: 25 day(s) 20 hour(s) 14 minute(s) | uptime=25.000000;;1.000000;

NCPA

NPCA includes a system module that allows you to check the uptime, the response returned is in seconds.

System Uptime Longer Than 1 Day

Unit: Seconds
Critical: Up more than 86400 seconds (1 day)

Command:

./check_ncpa.py -H 10.25.14.91 -t Str0ngT0k3n -M 'system/uptime' --critical 86400

Output:

CRITICAL: Uptime was 1212855.00 s | 'uptime'=1212855.00s;;86400;

 

System Uptime Shorter Than 1 Day

Unit: Seconds
Critical: Up less than 86400 seconds (1 day)

Command:

./check_ncpa.py -H 10.25.14.91 -t Str0ngT0k3n -M 'system/uptime' --critical 86400:

Output:

OK: Uptime was 1212902.00 s | 'uptime'=1212902.00s;;86400:; 

NSClient++ via check_nt

NSClient++ includes a UPTIME module. The thresholds for the module are triggered if the system uptime is less than the supplied value.

System Uptime Longer Than 1 Day

The UPTIME module does not provide this check type, however you can use the negate plugin to invert the returned result from the plugin (hence making CRITICAL an OK state).

Unit: Days
Critical: Up more than 1 day

Command:

./negate ./check_nt -H 10.25.14.10 -p 12489 -s 'Str0ngP@ssw0rd' -v UPTIME -l days -c 1

Output:

System Uptime - 6 day(s) 17 hour(s) 7 minute(s) |uptime=6

 

System Uptime Shorter Than 1 Day

Unit: Days
Critical: Up less than 1 day

Command:

./check_nt -H 10.25.14.10 -p 12489 -s 'Str0ngP@ssw0rd' -v UPTIME -l days -c 1

Output:

System Uptime - 6 day(s) 17 hour(s) 6 minute(s) |uptime=6

NSClient++ via check_nrpe

NSClient++ includes a check_uptime module.

System Uptime Longer Than 1 Day

Unit: Days
Critical: Up more than 1 day

Command:

./check_nrpe -H 10.25.11.3 -c check_uptime -a 'warn= uptime > 1d' 'crit= uptime > 1d'

Output:

CRITICAL: uptime: 2w 3d 18:16h, boot: 2017-11-09 06:35:02 (UTC)|'uptime'=1534571s;86400;86400

 

System Uptime Shorter Than 1 Day

Unit: Days
Critical: Up less than 1 day

Command:

./check_nrpe -H 10.25.11.3 -c check_uptime -a 'warn= uptime < 1d' 'crit= uptime < 1d'

Output:

OK: uptime: 2w 3d 18:16h, boot: 2017-11-09 06:35:02 (UTC)|'uptime'=1534615s;86400;86400

WMI

Check WMI Plus includes a checkuptime module.

System Uptime Longer Than 1 Day

Unit: Days
Critical: Up more than 1 day

Command:

./check_wmi_plus.pl -H 10.25.14.3 -u wmiagent -p Str0ngP@ssw0rd -m checkuptime -c 1day

Output:

CRITICAL - [Triggered by _UptimeSec>1day] - System Uptime is 5 days 23:07:54 (8587min).|'Uptime Minutes'=8587min;1440;

 

System Uptime Shorter Than 1 Day

Unit: Days
Critical: Up less than 1 day

Command:

./check_wmi_plus.pl -H 10.25.14.3 -u wmiagent -p Str0ngP@ssw0rd -m checkuptime -c 1day:

Output:

OK - System Uptime is 5 days 23:07:50 (8587min).|'Uptime Minutes'=8587min;1440;

SNMP

The check_snmp plugin allows you to check the sysUpTime OID, the response returned is in timeticks.

System Uptime Longer Than 1 Day

Unit: Timeticks
Critical: Up more than 8600000 timeticks (1 day)

Command:

./check_snmp -H 10.25.4.1 -o sysUpTime.0 -C public -P 2c -l Uptime -c 0:8600000

Output:

SNMP CRITICAL - Uptime *3151082700* | Uptime=3151082700;;8600000;

 

System Uptime Shorter Than 1 Day

Unit: Seconds
Critical: Up less than 86400 seconds (1 day)

Command:

./check_snmp -H 10.25.4.1 -o sysUpTime.0 -C public -P 2c -l Uptime -c 8600000:0

Output:

SNMP OK - Uptime 3151084000 | Uptime=3151084000;;8600000;

 

 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/



Special Offer For Knowledgebase Visitors! Get a huge discount on Nagios Log Server by clicking below.

Get 60% Off Nagios Log Server!

Did you know? Nagios provides complete monitoring of: Windows, Linux, UNIX, Servers, Websites, SNMP, DHCP, DNS, Email, Storage, Files, Apache, IIS, EC2, and more!

5 (1)
Article Rating (1 Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
Process Checks
Viewed 69576 times since Thu, Nov 23, 2017
Log Checks
Viewed 25993 times since Tue, Nov 28, 2017
Performance Counter Checks
Viewed 21922 times since Wed, Nov 15, 2017
Network Interface Checks
Viewed 20739 times since Mon, Nov 20, 2017
CPU Usage Checks
Viewed 38937 times since Sun, Nov 12, 2017
Operating System Checks
Viewed 16466 times since Tue, Nov 14, 2017
Agent Checks
Viewed 13693 times since Tue, Nov 14, 2017
Disk Performance Checks
Viewed 20189 times since Sun, Nov 26, 2017
Scheduled Task Checks
Viewed 20313 times since Tue, Nov 28, 2017
Health Checks
Viewed 17142 times since Wed, Nov 29, 2017