[Nagiosplug-checkins] CVS: nagiosplug/plugins check_ups.c,1.12,1.13

Karl DeBisschop kdebisschop at users.sourceforge.net
Mon Nov 17 03:47:13 CET 2003


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv14516

Modified Files:
	check_ups.c 
Log Message:
bugfix - each supported option was overwriting the previous perfdata

Index: check_ups.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ups.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** check_ups.c	17 Nov 2003 07:19:17 -0000	1.12
--- check_ups.c	17 Nov 2003 11:45:57 -0000	1.13
***************
*** 88,91 ****
--- 88,92 ----
  
  	ups_status = strdup ("N/A");
+ 	data = strdup ("");
  
  	if (process_arguments (argc, argv) != OK)
***************
*** 166,170 ****
  				result = max_state (result, STATE_WARNING);
  			}
! 			asprintf (&data, "%s ",
  			          perfdata ("voltage", (long)(1000*ups_utility_voltage), "mV",
  			                    check_warn, (long)(1000*warning_value),
--- 167,171 ----
  				result = max_state (result, STATE_WARNING);
  			}
! 			asprintf (&data, "%s",
  			          perfdata ("voltage", (long)(1000*ups_utility_voltage), "mV",
  			                    check_warn, (long)(1000*warning_value),
***************
*** 172,176 ****
  			                    TRUE, 0, FALSE, 0));
  		} else {
! 			asprintf (&data, "%s ",
  			          perfdata ("voltage", (long)(1000*ups_utility_voltage), "mV",
  			                    FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
--- 173,177 ----
  			                    TRUE, 0, FALSE, 0));
  		} else {
! 			asprintf (&data, "%s",
  			          perfdata ("voltage", (long)(1000*ups_utility_voltage), "mV",
  			                    FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
***************
*** 194,198 ****
  				result = max_state (result, STATE_WARNING);
  			}
! 			asprintf (&data, "%s ",
  			          perfdata ("battery", (long)ups_battery_percent, "%",
  			                    check_warn, (long)(1000*warning_value),
--- 195,199 ----
  				result = max_state (result, STATE_WARNING);
  			}
! 			asprintf (&data, "%s %s", data,
  			          perfdata ("battery", (long)ups_battery_percent, "%",
  			                    check_warn, (long)(1000*warning_value),
***************
*** 200,204 ****
  			                    TRUE, 0, TRUE, 100));
  		} else {
! 			asprintf (&data, "%s ",
  			          perfdata ("battery", (long)ups_battery_percent, "%",
  			                    FALSE, 0, FALSE, 0, TRUE, 0, TRUE, 100));
--- 201,205 ----
  			                    TRUE, 0, TRUE, 100));
  		} else {
! 			asprintf (&data, "%s %s", data,
  			          perfdata ("battery", (long)ups_battery_percent, "%",
  			                    FALSE, 0, FALSE, 0, TRUE, 0, TRUE, 100));
***************
*** 222,226 ****
  				result = max_state (result, STATE_WARNING);
  			}
! 			asprintf (&data, "%s ",
  			          perfdata ("load", (long)ups_load_percent, "%",
  			                    check_warn, (long)(1000*warning_value),
--- 223,227 ----
  				result = max_state (result, STATE_WARNING);
  			}
! 			asprintf (&data, "%s %s", data,
  			          perfdata ("load", (long)ups_load_percent, "%",
  			                    check_warn, (long)(1000*warning_value),
***************
*** 228,232 ****
  			                    TRUE, 0, TRUE, 100));
  		} else {
! 			asprintf (&data, "%s ",
  			          perfdata ("load", (long)ups_load_percent, "%",
  			                    FALSE, 0, FALSE, 0, TRUE, 0, TRUE, 100));
--- 229,233 ----
  			                    TRUE, 0, TRUE, 100));
  		} else {
! 			asprintf (&data, "%s %s", data,
  			          perfdata ("load", (long)ups_load_percent, "%",
  			                    FALSE, 0, FALSE, 0, TRUE, 0, TRUE, 100));
***************
*** 250,254 ****
  				result = max_state (result, STATE_WARNING);
  			}
! 			asprintf (&data, "%s ",
  			          perfdata ("temp", (long)ups_temperature, "degF",
  			                    check_warn, (long)(1000*warning_value),
--- 251,255 ----
  				result = max_state (result, STATE_WARNING);
  			}
! 			asprintf (&data, "%s %s", data,
  			          perfdata ("temp", (long)ups_temperature, "degF",
  			                    check_warn, (long)(1000*warning_value),
***************
*** 256,260 ****
  			                    TRUE, 0, FALSE, 0));
  		} else {
! 			asprintf (&data, "%s ",
  			          perfdata ("temp", (long)ups_temperature, "degF",
  			                    FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
--- 257,261 ----
  			                    TRUE, 0, FALSE, 0));
  		} else {
! 			asprintf (&data, "%s %s", data,
  			          perfdata ("temp", (long)ups_temperature, "degF",
  			                    FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));





More information about the Commits mailing list