check_uptime
check_uptime
I want to get a clear picture on how to use check_uptime. I want the threshold to be critical if the system is up for more than 15 minutes. How can I set it up ?
Re: check_uptime
From the help menu:
If I wanted to return critical for a machine with uptime greater than 15 minutes:
And if I reboot the machine:
Code: Select all
[root@localhost libexec]# ./check_uptime -h
check_uptime v2.1.2 (nagios-plugins 2.1.2)
Copyright (c) 2014 Nagios Plugin Development Team
<Andy Brist>
This plugin checks the system uptime and alerts if less than the threshold.
Threshold unit of measurement specified with "-u".
"-u" switch supports: seconds|minutes|hours|days.
Usage:
check_uptime [-u uom] [-w threshold] [-c threshold] [-t] [-h] [-vvv] [-V]
Options:
-h, --help
Print detailed help screen
-V, --version
Print version information
--extra-opts=[section][@file]
Read options from an ini file. See
https://www.nagios-plugins.org/doc/extra-opts.html
for usage and examples.
-t, Plugin timeout, default 10 seconds
-c, Critcal threshold
-w, Warning threshold
-u, Time unit of measurement (seconds|minutes|hours|days) (default: minutes)
-vvv, Enable verbose outputCode: Select all
[root@localhost libexec]# /usr/local/nagios/libexec/check_uptime -u minutes -w 10 -c 15
Uptime CRITICAL: 20 day(s) 1 hour(s) 25 minute(s) | uptime=28885.000000;10.000000;15.000000;Code: Select all
[root@localhost ~]# /usr/local/nagios/libexec/check_uptime -u minutes -w 10 -c 15
Uptime OK: 0 day(s) 0 hour(s) 1 minute(s) | uptime=1.000000;10.000000;15.000000;Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/