Code

check_pgsql: Determine connection time in µs-resolution.
[nagiosplug.git] / plugins / check_nt.c
index d038efe72dd51beeed116be8db8e2027db62aefc..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:
@@ -655,8 +660,8 @@ void print_help(void)
 
        print_usage();
 
-       printf (_(UT_HELP_VRSN));
-       printf (_(UT_EXTRA_OPTS));
+       printf (UT_HELP_VRSN);
+       printf (UT_EXTRA_OPTS);
 
        printf ("%s\n", _("Options:"));
        printf (" %s\n", "-H, --hostname=HOST");
@@ -748,18 +753,15 @@ void print_help(void)
        printf ("   %s\n", _("output when this happens contains \"Cannot map xxxxx to protocol number\"."));
        printf ("   %s\n", _("One fix for this is to change the port to something else on check_nt "));
        printf ("   %s\n", _("and on the client service it\'s connecting to."));
-#ifdef NP_EXTRA_OPTS
-       printf (" -%s", _(UT_EXTRA_OPTS_NOTES));
-#endif
 
-       printf (_(UT_SUPPORT));
+       printf (UT_SUPPORT);
 }
 
 
 
 void print_usage(void)
 {
-       printf (_("Usage:"));
+       printf ("%s\n", _("Usage:"));
        printf ("%s -H host -v variable [-p port] [-w warning] [-c critical]\n",progname);
        printf ("[-l params] [-d SHOWALL] [-u] [-t timeout]\n");
 }