[Nagiosplug-checkins] CVS: nagiosplug/plugins check_ldap.c,1.15,1.16 check_load.c,1.14,1.15 check_mrtgtraf.c,1.11,1.12 check_pgsql.c,1.16,1.17 check_smtp.c,1.24,1.25 check_tcp.c,1.39,1.40 check_ups.c,1.13,1.14

Karl DeBisschop kdebisschop at users.sourceforge.net
Sat Mar 13 21:32:53 CET 2004


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4885/plugins

Modified Files:
	check_ldap.c check_load.c check_mrtgtraf.c check_pgsql.c 
	check_smtp.c check_tcp.c check_ups.c 
Log Message:
use fperfdata

Index: check_ldap.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ldap.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** check_ldap.c	16 Sep 2003 05:45:55 -0000	1.15
--- check_ldap.c	14 Mar 2004 04:09:19 -0000	1.16
***************
*** 52,57 ****
  int ld_protocol = DEFAULT_PROTOCOL;
  #endif
! int warn_time = UNDEFINED;
! int crit_time = UNDEFINED;
  struct timeval tv;
  
--- 52,57 ----
  int ld_protocol = DEFAULT_PROTOCOL;
  #endif
! double warn_time = UNDEFINED;
! double crit_time = UNDEFINED;
  struct timeval tv;
  
***************
*** 136,142 ****
  	        state_text (status),
  	        elapsed_time,
! 	        perfdata ("time", microsec, "us",
! 	                  warn_time, warn_time,
! 	                  crit_time, crit_time,
  	                  TRUE, 0, FALSE, 0));
  
--- 136,142 ----
  	        state_text (status),
  	        elapsed_time,
! 	        fperfdata ("time", elapsed_time, "s",
! 	                  (int)warn_time, warn_time,
! 	                  (int)crit_time, crit_time,
  	                  TRUE, 0, FALSE, 0));
  
***************
*** 219,226 ****
  			break;
  		case 'w':
! 			warn_time = atoi (optarg);
  			break;
  		case 'c':
! 			crit_time = atoi (optarg);
  			break;
  #ifdef HAVE_LDAP_SET_OPTION
--- 219,226 ----
  			break;
  		case 'w':
! 			warn_time = strtod (optarg, NULL);
  			break;
  		case 'c':
! 			crit_time = strtod (optarg, NULL);
  			break;
  #ifdef HAVE_LDAP_SET_OPTION

Index: check_load.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_load.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** check_load.c	31 Oct 2003 04:20:34 -0000	1.14
--- check_load.c	14 Mar 2004 04:09:19 -0000	1.15
***************
*** 153,159 ****
  	     state_text (result),
  	     status_line,
! 	     perfdata ("load1", la1, "", wload1, wload1, cload1, cload1, TRUE, 0, FALSE, 0),
! 	     perfdata ("load5", la5, "", wload5, wload5, cload5, cload5, TRUE, 0, FALSE, 0),
! 	     perfdata ("load15", la15, "", wload15, wload15, cload15, cload15, TRUE, 0, FALSE, 0));
  	return STATE_OK;
  }
--- 153,159 ----
  	     state_text (result),
  	     status_line,
! 	     fperfdata ("load1", la1, "", (int)wload1, wload1, (int)cload1, cload1, TRUE, 0, FALSE, 0),
! 	     fperfdata ("load5", la5, "", (int)wload5, wload5, (int)cload5, cload5, TRUE, 0, FALSE, 0),
! 	     fperfdata ("load15", la15, "", (int)wload15, wload15, (int)cload15, cload15, TRUE, 0, FALSE, 0));
  	return STATE_OK;
  }

Index: check_mrtgtraf.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_mrtgtraf.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** check_mrtgtraf.c	12 Nov 2003 05:41:28 -0000	1.11
--- check_mrtgtraf.c	14 Mar 2004 04:09:19 -0000	1.12
***************
*** 180,191 ****
  	          incoming_speed_rating, (use_average == TRUE) ? _("Avg") : _("Max"),
  	          adjusted_outgoing_rate, outgoing_speed_rating,
! 	          perfdata("in", (long) adjusted_incoming_rate, incoming_speed_rating,
! 	                   (int) incoming_warning_threshold, (long) incoming_warning_threshold,
! 	                   (int) incoming_critical_threshold, (long) incoming_critical_threshold,
! 	                   TRUE, 0, TRUE, (long) incoming_speed_rating),
! 	          perfdata("in", (long) adjusted_outgoing_rate, outgoing_speed_rating,
! 	                   (int) outgoing_warning_threshold, (long) outgoing_warning_threshold,
! 	                   (int) outgoing_critical_threshold, (long) outgoing_critical_threshold,
! 	                   TRUE, 0, TRUE, (long) outgoing_speed_rating));
  
  	printf (_("Traffic %s - %s\n"), state_text(result), error_message);
--- 180,191 ----
  	          incoming_speed_rating, (use_average == TRUE) ? _("Avg") : _("Max"),
  	          adjusted_outgoing_rate, outgoing_speed_rating,
! 	          fperfdata("in", adjusted_incoming_rate, incoming_speed_rating,
! 	                   (int)incoming_warning_threshold, incoming_warning_threshold,
! 	                   (int)incoming_critical_threshold, incoming_critical_threshold,
! 	                   TRUE, 0, FALSE, 0),
! 	          fperfdata("in", adjusted_outgoing_rate, outgoing_speed_rating,
! 	                   (int)outgoing_warning_threshold, outgoing_warning_threshold,
! 	                   (int)outgoing_critical_threshold, outgoing_critical_threshold,
! 	                   TRUE, 0, FALSE, 0));
  
  	printf (_("Traffic %s - %s\n"), state_text(result), error_message);

Index: check_pgsql.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_pgsql.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** check_pgsql.c	17 Nov 2003 06:37:15 -0000	1.16
--- check_pgsql.c	14 Mar 2004 04:09:19 -0000	1.17
***************
*** 46,51 ****
  char *pguser = NULL;
  char *pgpasswd = NULL;
! int twarn = DEFAULT_WARN;
! int tcrit = DEFAULT_CRIT;
  
  PGconn *conn;
--- 46,51 ----
  char *pguser = NULL;
  char *pgpasswd = NULL;
! double twarn = (double)DEFAULT_WARN;
! double tcrit = (double)DEFAULT_CRIT;
  
  PGconn *conn;
***************
*** 169,174 ****
  	printf (_("PGSQL: %s - database %s (%d sec.)|%s\n"), 
  	        state_text(status), dbName, elapsed_time,
! 	        perfdata("time", (long)elapsed_time, "s",
! 	                 twarn, (long)twarn, tcrit, (long)tcrit, TRUE, 0, FALSE,0));
  	return status;
  }
--- 169,174 ----
  	printf (_("PGSQL: %s - database %s (%d sec.)|%s\n"), 
  	        state_text(status), dbName, elapsed_time,
! 	        fperfdata("time", elapsed_time, "s",
! 	                 (int)twarn, twarn, (int)tcrit, tcrit, TRUE, 0, FALSE,0));
  	return status;
  }
***************
*** 222,235 ****
  			break;
  		case 'c':     /* critical time threshold */
! 			if (!is_integer (optarg))
  				usage2 (_("Invalid critical threshold"), optarg);
  			else
! 				tcrit = atoi (optarg);
  			break;
  		case 'w':     /* warning time threshold */
! 			if (!is_integer (optarg))
  				usage2 (_("Invalid critical threshold"), optarg);
  			else
! 				twarn = atoi (optarg);
  			break;
  		case 'H':     /* host */
--- 222,235 ----
  			break;
  		case 'c':     /* critical time threshold */
! 			if (!is_nonnegative (optarg))
  				usage2 (_("Invalid critical threshold"), optarg);
  			else
! 				tcrit = strtod (optarg, NULL);
  			break;
  		case 'w':     /* warning time threshold */
! 			if (!is_nonnegative (optarg))
  				usage2 (_("Invalid critical threshold"), optarg);
  			else
! 				twarn = strtod (optarg, NULL);
  			break;
  		case 'H':     /* host */

Index: check_smtp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_smtp.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** check_smtp.c	1 Mar 2004 06:15:59 -0000	1.24
--- check_smtp.c	14 Mar 2004 04:09:19 -0000	1.25
***************
*** 229,234 ****
            verbose?", ":"", verbose?buffer:"",
  	        perfdata ("time", microsec, "us",
! 	                  check_warning_time, (long)(1000000*warning_time),
! 	                  check_critical_time, (long)(1000000*critical_time),
  	                  TRUE, 0, FALSE, 0));
  
--- 229,234 ----
            verbose?", ":"", verbose?buffer:"",
  	        perfdata ("time", microsec, "us",
! 	                  (int)check_warning_time, warning_time,
! 	                  (int)check_critical_time, critical_time,
  	                  TRUE, 0, FALSE, 0));
  

Index: check_tcp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_tcp.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** check_tcp.c	1 Mar 2004 12:27:19 -0000	1.39
--- check_tcp.c	14 Mar 2004 04:09:19 -0000	1.40
***************
*** 333,341 ****
  		printf (" [%s]", status);
  
! 	printf (" |%s\n", perfdata ("time", microsec, "us",
! 		TRUE, warning_time*1000,
! 		TRUE, critical_time*1000,
  		TRUE, 0,
! 		TRUE, socket_timeout*1000));
  
  	return result;
--- 333,341 ----
  		printf (" [%s]", status);
  
! 	printf (" |%s\n", fperfdata ("time", elapsed_time, "s",
! 		TRUE, warning_time,
! 		TRUE, critical_time,
  		TRUE, 0,
! 		TRUE, socket_timeout));
  
  	return result;
***************
*** 482,486 ****
  				maxbytes = atoi (optarg);
  		case 'q':
! 			server_quit = optarg;
  			break;
  		case 'r':
--- 482,486 ----
  				maxbytes = atoi (optarg);
  		case 'q':
! 			asprintf(&server_quit, "%s\r\n", optarg);
  			break;
  		case 'r':

Index: check_ups.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ups.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** check_ups.c	17 Nov 2003 11:45:57 -0000	1.13
--- check_ups.c	14 Mar 2004 04:09:19 -0000	1.14
***************
*** 168,178 ****
  			}
  			asprintf (&data, "%s",
! 			          perfdata ("voltage", (long)(1000*ups_utility_voltage), "mV",
! 			                    check_warn, (long)(1000*warning_value),
! 			                    check_crit, (long)(1000*critical_value),
  			                    TRUE, 0, FALSE, 0));
  		} else {
  			asprintf (&data, "%s",
! 			          perfdata ("voltage", (long)(1000*ups_utility_voltage), "mV",
  			                    FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
  		}
--- 168,178 ----
  			}
  			asprintf (&data, "%s",
! 			          fperfdata ("voltage", ups_utility_voltage, "V",
! 			                    check_warn, warning_value,
! 			                    check_crit, critical_value,
  			                    TRUE, 0, FALSE, 0));
  		} else {
  			asprintf (&data, "%s",
! 			          fperfdata ("voltage", ups_utility_voltage, "V",
  			                    FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
  		}





More information about the Commits mailing list