Преглед изворни кода

Merge pull request #500 from sawolf/480-icmp-compatibility

Fix ordering of check_icmp's performance data
Sebastian Wolf пре 6 година
родитељ
комит
ff4b8d057b
3 измењених фајлова са 17 додато и 7 уклоњено
  1. 6 1
      NEWS
  2. 7 5
      plugins-root/check_icmp.c
  3. 4 1
      plugins/sslutils.c

+ 6 - 1
NEWS

@@ -1,7 +1,12 @@
 This file documents the major additions and syntax changes between releases.
 
+2.3.1 xxxx-xx-xx
+	FIXES
+	check_icmp: Fixed backwards compatibility issue with performance data (#480)
 
-2.3.0 xxxx-xx-xx
+2.3.0 2019-12-04
+	Note: nagios-plugins 2.3.0 introduced a backwards-compatibility issue for performance data graphs produced by check_icmp.
+	Anyone upgrading from an older version of nagios-plugins should upgrade directly to >=2.3.1.
 	ENHANCEMENTS
 	Added a plugin "remove_perfdata" to remove perfdata from another plugin's output
 	Added a plugin "check_ssl_validity" which verifies a certificate through CRL or OCSP

+ 7 - 5
plugins-root/check_icmp.c

@@ -1593,17 +1593,19 @@ static void finish(int sig) {
       puts("");
     }
     if (rta_mode && host->pl < 100) {
-      printf("%srta=%0.3fms;%0.3f;%0.3f;0; %srtmax=%0.3fms;;;; "
-             "%srtmin=%0.3fms;;;; ",
+      printf("%srta=%0.3fms;%0.3f;%0.3f;0; ",
              (targets > 1) ? host->name : "", (float)host->rta / 1000,
-             (float)warn.rta / 1000, (float)crit.rta / 1000,
-             (targets > 1) ? host->name : "", (float)host->rtmax / 1000,
-             (targets > 1) ? host->name : "", (float)host->rtmin / 1000);
+             (float)warn.rta / 1000, (float)crit.rta / 1000);
     }
     if (pl_mode) {
       printf("%spl=%u%%;%u;%u;0;100 ", (targets > 1) ? host->name : "",
              host->pl, warn.pl, crit.pl);
     }
+    if (rta_mode && host->pl < 100) {
+      printf("%srtmax=%0.3fms;;;; %srtmin=%0.3fms;;;; ",
+             (targets > 1) ? host->name : "", (float)host->rtmax / 1000,
+             (targets > 1) ? host->name : "", (float)host->rtmin / 1000);
+    }
     if (jitter_mode && host->pl < 100) {
       printf("%sjitter_avg=%0.3fms;%0.3f;%0.3f;0; %sjitter_max=%0.3fms;;;; "
              "%sjitter_min=%0.3fms;;;; ",

+ 4 - 1
plugins/sslutils.c

@@ -68,7 +68,10 @@ int np_net_ssl_init_with_hostname_version_and_cert(int sd, char *host_name, int
 		return STATE_UNKNOWN;
 #else
 		method = SSLv3_client_method();
-		options = SSL_OP_NO_SSLv2 | SSL_OP_NO_TLSv1;
+		options = SSL_OP_NO_TLSv1;
+#if defined(SSL_OP_NO_SSLv2)
+		options |= SSL_OP_NO_SSLv2;
+#endif
 		break;
 #endif
 	case MP_TLSv1: /* TLSv1 protocol */