From 6989366b8d3ccd03b428610ca059f22be724f8be Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Wed, 13 Oct 2010 00:10:25 -0400 Subject: check_nt: make UPTIME accept warning/critical levels Patch originally by Ryan Kelly --- plugins/check_nt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/check_nt.c b/plugins/check_nt.c index 32d4ff6c..60806bb3 100644 --- a/plugins/check_nt.c +++ b/plugins/check_nt.c @@ -203,7 +203,12 @@ int main(int argc, char **argv){ uphours = (uptime % 86400) / 3600; upminutes = ((uptime % 86400) % 3600) / 60; asprintf(&output_message,_("System Uptime - %u day(s) %u hour(s) %u minute(s)"),updays,uphours, upminutes); - return_code=STATE_OK; + if (check_critical_value==TRUE && uptime <= critical_value) + return_code=STATE_CRITICAL; + else if (check_warning_value==TRUE && uptime <= warning_value) + return_code=STATE_WARNING; + else + return_code=STATE_OK; break; case CHECK_USEDDISKSPACE: -- cgit v1.2.3