Jelajahi Sumber

check_ntp and friends: change calls to perfdata() to preserve complete threshold in output

madlohe 6 tahun lalu
induk
melakukan
4d73f244f4
3 mengubah file dengan 21 tambahan dan 21 penghapusan
  1. 6 6
      plugins/check_ntp.c
  2. 12 12
      plugins/check_ntp_peer.c
  3. 3 3
      plugins/check_ntp_time.c

+ 6 - 6
plugins/check_ntp.c

@@ -763,17 +763,17 @@ int process_arguments(int argc, char **argv){
 
 char *perfd_offset (double offset)
 {
-	return fperfdata ("offset", offset, "s",
-		TRUE, offset_thresholds->warning->end,
-		TRUE, offset_thresholds->critical->end,
+	return sperfdata ("offset", offset, "s",
+		offset_thresholds->warning_string,
+		offset_thresholds->critical_string,
 		FALSE, 0, FALSE, 0);
 }
 
 char *perfd_jitter (double jitter)
 {
-	return fperfdata ("jitter", jitter, "s",
-		do_jitter, jitter_thresholds->warning->end,
-		do_jitter, jitter_thresholds->critical->end,
+	return sperfdata ("jitter", jitter, "s",
+		jitter_thresholds->warning_string,
+		jitter_thresholds->critical_string,
 		TRUE, 0, FALSE, 0);
 }
 

+ 12 - 12
plugins/check_ntp_peer.c

@@ -529,33 +529,33 @@ int process_arguments(int argc, char **argv){
 
 char *perfd_offset (double offset)
 {
-	return fperfdata ("offset", offset, "s",
-		TRUE, offset_thresholds->warning->end,
-		TRUE, offset_thresholds->critical->end,
+	return sperfdata ("offset", offset, "s",
+		offset_thresholds->warning_string,
+		offset_thresholds->critical_string,
 		FALSE, 0, FALSE, 0);
 }
 
 char *perfd_jitter (double jitter)
 {
-	return fperfdata ("jitter", jitter, "",
-		do_jitter, jitter_thresholds->warning->end,
-		do_jitter, jitter_thresholds->critical->end,
+	return sperfdata ("jitter", jitter, "",
+		jitter_thresholds->warning_string,
+		jitter_thresholds->critical_string,
 		TRUE, 0, FALSE, 0);
 }
 
 char *perfd_stratum (int stratum)
 {
-	return perfdata ("stratum", stratum, "",
-		do_stratum, (int)stratum_thresholds->warning->end,
-		do_stratum, (int)stratum_thresholds->critical->end,
+	return sperfdata_int ("stratum", stratum, "",
+		stratum_thresholds->warning_string,
+		stratum_thresholds->critical_string,
 		TRUE, 0, TRUE, 16);
 }
 
 char *perfd_truechimers (int num_truechimers)
 {
-	return perfdata ("truechimers", num_truechimers, "",
-		do_truechimers, (int)truechimer_thresholds->warning->end,
-		do_truechimers, (int)truechimer_thresholds->critical->end,
+	return sperfdata_int ("truechimers", num_truechimers, "",
+		truechimer_thresholds->warning_string,
+		truechimer_thresholds->critical_string,
 		TRUE, 0, FALSE, 0);
 }
 

+ 3 - 3
plugins/check_ntp_time.c

@@ -564,9 +564,9 @@ int process_arguments(int argc, char **argv){
 
 char *perfd_offset (double offset)
 {
-	return fperfdata ("offset", offset, "s",
-		TRUE, offset_thresholds->warning->end,
-		TRUE, offset_thresholds->critical->end,
+	return sperfdata ("offset", offset, "s",
+		offset_thresholds->warning_string,
+		offset_thresholds->critical_string,
 		FALSE, 0, FALSE, 0);
 }