Code

check_nt: make UPTIME accept warning/critical levels
[nagiosplug.git] / plugins / check_nt.c
index 32d4ff6c99f87a2b8d70150e8062c5c34b87b789..60806bb399fb1f6df5be62faf7d0b4c3e2574a85 100644 (file)
@@ -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: