Code

re-add a call to setlocale(LC_ALL, "") in check_ping.c
[nagiosplug.git] / plugins / check_ping.c
index 74b6fce2097cb82bfd3afd22745a43b81bacaf5e..fc720144dd0b419a7b97368282b407306452e637 100644 (file)
@@ -71,6 +71,7 @@ main (int argc, char **argv)
        int this_result = STATE_UNKNOWN;
        int i;
 
+       setlocale (LC_ALL, "");
        setlocale (LC_NUMERIC, "C");
        bindtextdomain (PACKAGE, LOCALEDIR);
        textdomain (PACKAGE);
@@ -415,11 +416,15 @@ run_ping (const char *cmd, const char *addr)
 
                /* get the percent loss statistics */
                if(sscanf(buf,"%*d packets transmitted, %*d packets received, +%*d errors, %d%% packet loss",&pl)==1 ||
-                        sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% packet loss",&pl)==1   ||
+                        sscanf(buf,"%*d packets transmitted, %*d packets received, +%*d duplicates, %d%% packet loss", &pl) == 1 ||
+                        sscanf(buf,"%*d packets transmitted, %*d received, +%*d duplicates, %d%% packet loss", &pl) == 1 ||
+                        sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% packet loss",&pl)==1 ||
                         sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% loss, time",&pl)==1 ||
                         sscanf(buf,"%*d packets transmitted, %*d received, %d%% loss, time", &pl)==1 ||
                         sscanf(buf,"%*d packets transmitted, %*d received, %d%% packet loss, time", &pl)==1 ||
-                  sscanf(buf,"%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss", &pl) == 1)
+                        sscanf(buf,"%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss", &pl) == 1 ||
+                        sscanf(buf,"%*d packets transmitted %*d received, +%*d errors, %d%% packet loss", &pl) == 1
+                        )
                        continue;
 
                /* get the round trip average */