Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
I'm about to setup check_uptime for my servers in order to graph the uptime. I thought it would also make a nice way to alert me when a server rebooted. After reading the help page I was convinced that any values *under* critical or warning would produce an alert. But I see it's the oposite:
./check_uptime
Uptime OK: 7 day(s) 15 hour(s) 5 minute(s) | uptime=10985.000000;;;
#Thinking that anything *under* 10 minutes produces a critical I see that anything *over* ten minutes gives me a critical
./check_uptime -c 10
Uptime CRITICAL: 7 day(s) 15 hour(s) 5 minute(s) | uptime=10985.000000;;10.000000;
./check_uptime -c 10 -w 20
Uptime CRITICAL: 7 day(s) 15 hour(s) 8 minute(s) | uptime=10988.000000;20.000000;10.000000;
I don't see the use in having an alert when a server passes a certain uptime - maybe if you have regular reboot schedules, but I see more value in getting alerts when a server reboots. Or at least please consider implementing both?
I spoke with sreinhardt and this is actually intentional. We do know it can be like, what the heck, this is backwards, but it is done to keep all of the plugins on the same level. What I mean by that is, we're keeping the Nagios Plugins to the Plugins Guidelines, and not trying to interpret what the user wants, rather, setting them all to read their thresholds one way so there are no odd edge cases floating around. You will want to either use negate http://assets.nagios.com/downloads/nagi ... ios-XI.pdf (can be used with core as well), or you will want to use colons or gt > lt < as defined here:
[root@nagios plugins]# ./check_uptime -h
check_uptime v2.0.2 (nagios-plugins 2.0.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]
I added uppercase to indicate what needs to be changed.
While I'm certainly not going to yell at people looking at the help output, I will make the change for a bit more logical message there.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Makes sense to keep the plugin standard, thanks for taking the time to explain. Thanks, never knew of the negate plugin and to my shame I never thought of ranges.