Code

internationalization fixes
[nagiosplug.git] / plugins / check_http.c
index 6f8ad9a42b52dd8f569e95720ae8f6c1c28c111b..6e76706277d702712a92bfa3e34656b9fcb29bf5 100644 (file)
@@ -251,9 +251,7 @@ process_arguments (int argc, char **argv)
 
                switch (c) {
                case '?': /* usage */
-                       printf (_("%s: Unknown argument: %s\n\n"), progname, optarg);
-                       print_usage ();
-                       exit (STATE_UNKNOWN);
+                       usage2 (_("Unknown argument"), optarg);
                        break;
                case 'h': /* help */
                        print_help ();
@@ -299,7 +297,7 @@ process_arguments (int argc, char **argv)
                        break;
                case 'S': /* use SSL */
 #ifndef HAVE_SSL
-                       usage (_("check_http: invalid option - SSL is not available\n"));
+                       usage4 (_("Invalid option - SSL is not available"));
 #endif
                        use_ssl = TRUE;
                        if (specify_port == FALSE)
@@ -314,7 +312,7 @@ process_arguments (int argc, char **argv)
                                check_cert = TRUE;
                        }
 #else
-                       usage (_("Invalid option - SSL is not available\n"));
+                       usage4 (_("Invalid option - SSL is not available"));
 #endif
                        break;
                case 'f': /* onredirect */
@@ -676,17 +674,17 @@ check_document_dates (const char *headers)
        } else if (!document_date || !*document_date) {
                die (STATE_CRITICAL, _("Document modification date unknown\n"));
        } else {
-               time_t sd = parse_time_string (server_date);
-               time_t dd = parse_time_string (document_date);
+               time_t srv_data = parse_time_string (server_date);
+               time_t doc_data = parse_time_string (document_date);
 
-               if (sd <= 0) {
+               if (srv_data <= 0) {
                        die (STATE_CRITICAL, _("CRITICAL - Server date \"%100s\" unparsable"), server_date);
-               } else if (dd <= 0) {
+               } else if (doc_data <= 0) {
                        die (STATE_CRITICAL, _("CRITICAL - Document date \"%100s\" unparsable"), document_date);
-               } else if (dd > sd + 30) {
-                       die (STATE_CRITICAL, _("CRITICAL - Document is %d seconds in the future\n"), dd - sd);
-               } else if (dd < sd - maximum_age) {
-               int n = (sd - dd);
+               } else if (doc_data > srv_data + 30) {
+                       die (STATE_CRITICAL, _("CRITICAL - Document is %d seconds in the future\n"), (int)doc_data - (int)srv_data);
+               } else if (doc_data < srv_data - maximum_age) {
+               int n = (srv_data - doc_data);
                if (n > (60 * 60 * 24 * 2))
                        die (STATE_CRITICAL,
                          _("CRITICAL - Last modified %.1f days ago\n"),
@@ -1490,11 +1488,11 @@ the certificate is expired.\n"));
 void
 print_usage (void)
 {
-       printf (_("\
+       printf ("\
 Usage: %s -H <vhost> | -I <IP-address>) [-u <uri>] [-p <port>]\n\
                   [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n\
                   [-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>]\n\
                   [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n\
                   [-P string] [-m min_pg_size] [-4|-6] [-N] [-M <age>]\n\
-                  [-A string] [-k string]\n"), progname);
+                  [-A string] [-k string]\n", progname);
 }