diff options
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2010-10-13 00:10:25 -0400 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2010-10-15 01:52:29 -0400 |
commit | 6989366b8d3ccd03b428610ca059f22be724f8be (patch) | |
tree | ebff640cdd0b66588f17713f3648fccb329143f9 | |
parent | 654086f1117ee22d9f7e8270330daff6c463c9ad (diff) | |
download | monitoring-plugins-6989366b8d3ccd03b428610ca059f22be724f8be.tar.gz |
check_nt: make UPTIME accept warning/critical levels
Patch originally by Ryan Kelly
-rw-r--r-- | THANKS.in | 1 | ||||
-rw-r--r-- | plugins/check_nt.c | 7 |
2 files changed, 7 insertions, 1 deletions
@@ -265,3 +265,4 @@ Dann Frazier | |||
265 | Stephane Chazelas | 265 | Stephane Chazelas |
266 | Craig Leres | 266 | Craig Leres |
267 | Brian Landers | 267 | Brian Landers |
268 | Ryan Kelly | ||
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){ | |||
203 | uphours = (uptime % 86400) / 3600; | 203 | uphours = (uptime % 86400) / 3600; |
204 | upminutes = ((uptime % 86400) % 3600) / 60; | 204 | upminutes = ((uptime % 86400) % 3600) / 60; |
205 | asprintf(&output_message,_("System Uptime - %u day(s) %u hour(s) %u minute(s)"),updays,uphours, upminutes); | 205 | asprintf(&output_message,_("System Uptime - %u day(s) %u hour(s) %u minute(s)"),updays,uphours, upminutes); |
206 | return_code=STATE_OK; | 206 | if (check_critical_value==TRUE && uptime <= critical_value) |
207 | return_code=STATE_CRITICAL; | ||
208 | else if (check_warning_value==TRUE && uptime <= warning_value) | ||
209 | return_code=STATE_WARNING; | ||
210 | else | ||
211 | return_code=STATE_OK; | ||
207 | break; | 212 | break; |
208 | 213 | ||
209 | case CHECK_USEDDISKSPACE: | 214 | case CHECK_USEDDISKSPACE: |