[Nagiosplug-checkins] CVS: nagiosplug/plugins check_dig.c,1.18,1.19
Karl DeBisschop
kdebisschop at users.sourceforge.net
Fri Aug 22 00:00:07 CEST 2003
- Previous message: [Nagiosplug-checkins] CVS: nagiosplug/plugins check_by_ssh.c,1.17,1.18 check_dig.c,1.17,1.18 check_disk.c,1.36,1.37 check_dns.c,1.21,1.22 check_dummy.c,1.5,1.6 check_fping.c,1.9,1.10 check_game.c,1.7,1.8 check_hpjd.c,1.15,1.16 check_http.c,1.48,1.49 check_ide-smart.c,1.3,1.4 check_ldap.c,1.13,1.14 check_load.c,1.11,1.12 check_mrtg.c,1.9,1.10 check_mysql.c,1.11,1.12 check_nagios.c,1.10,1.11 check_nt.c,1.17,1.18 check_nwstat.c,1.12,1.13 check_overcr.c,1.7,1.8 check_pgsql.c,1.14,1.15 check_ping.c,1.23,1.24 check_procs.c,1.19,1.20 check_radius.c,1.8,1.9 check_real.c,1.11,1.12 check_smtp.c,1.19,1.20 check_snmp.c,1.34,1.35 check_ssh.c,1.12,1.13 check_swap.c,1.17,1.18 check_tcp.c,1.35,1.36 check_time.c,1.10,1.11 check_udp.c,1.11,1.12 check_ups.c,1.10,1.11 check_users.c,1.8,1.9 negate.c,1.12,1.13 urlize.c,1.8,1.9
- Next message: [Nagiosplug-checkins] CVS: nagiosplug/plugins check_dig.c,1.19,1.20
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv5415/plugins
Modified Files:
check_dig.c
Log Message:
- add perf data for time
Index: check_dig.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_dig.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** check_dig.c 22 Aug 2003 06:22:37 -0000 1.18
--- check_dig.c 22 Aug 2003 06:55:07 -0000 1.19
***************
*** 49,52 ****
--- 49,54 ----
char *command_line;
char *output;
+ long microsec;
+ double elapsed_time;
int result = STATE_UNKNOWN;
***************
*** 69,76 ****
alarm (timeout_interval);
! time (&start_time);
if (verbose)
printf ("%s\n", command_line);
/* run the command */
child_process = spopen (command_line);
--- 71,79 ----
alarm (timeout_interval);
! gettimeofday (&tv, NULL);
if (verbose)
printf ("%s\n", command_line);
+
/* run the command */
child_process = spopen (command_line);
***************
*** 131,148 ****
}
! (void) time (&end_time);
if (output == NULL || strlen (output) == 0)
asprintf (&output, _(" Probably a non-existent host/domain"));
! if (result == STATE_OK)
! printf (_("DNS OK - %d seconds response time (%s)\n"),
! (int) (end_time - start_time), output);
! else if (result == STATE_WARNING)
! printf (_("DNS WARNING - %s\n"), output);
else if (result == STATE_CRITICAL)
! printf (_("DNS CRITICAL - %s\n"), output);
else
! printf (_("DNS problem - %s\n"), output);
return result;
--- 134,165 ----
}
! microsec = deltime (tv);
! elapsed_time = (double)microsec / 1.0e6;
if (output == NULL || strlen (output) == 0)
asprintf (&output, _(" Probably a non-existent host/domain"));
! if (elapsed_time > critical_interval)
! die (STATE_CRITICAL,
! _("DNS OK - %d seconds response time (%s)|time=%ldus\n"),
! elapsed_time, output, microsec);
!
else if (result == STATE_CRITICAL)
! printf (_("DNS CRITICAL - %s|time=%ldus\n"), output);
!
! else if (elapsed_time > warning_interval)
! die (STATE_WARNING,
! _("DNS OK - %d seconds response time (%s)|time=%ldus\n"),
! elapsed_time, output, microsec);
!
! else if (result == STATE_WARNING)
! printf (_("DNS WARNING - %s|time=%ldus\n"), output);
!
! else if (result == STATE_OK)
! printf (_("DNS OK - %d seconds response time (%s)|time=%ldus\n"),
! elapsed_time, output, microsec);
!
else
! printf (_("DNS problem - %s|time=%ldus\n"), output);
return result;
- Previous message: [Nagiosplug-checkins] CVS: nagiosplug/plugins check_by_ssh.c,1.17,1.18 check_dig.c,1.17,1.18 check_disk.c,1.36,1.37 check_dns.c,1.21,1.22 check_dummy.c,1.5,1.6 check_fping.c,1.9,1.10 check_game.c,1.7,1.8 check_hpjd.c,1.15,1.16 check_http.c,1.48,1.49 check_ide-smart.c,1.3,1.4 check_ldap.c,1.13,1.14 check_load.c,1.11,1.12 check_mrtg.c,1.9,1.10 check_mysql.c,1.11,1.12 check_nagios.c,1.10,1.11 check_nt.c,1.17,1.18 check_nwstat.c,1.12,1.13 check_overcr.c,1.7,1.8 check_pgsql.c,1.14,1.15 check_ping.c,1.23,1.24 check_procs.c,1.19,1.20 check_radius.c,1.8,1.9 check_real.c,1.11,1.12 check_smtp.c,1.19,1.20 check_snmp.c,1.34,1.35 check_ssh.c,1.12,1.13 check_swap.c,1.17,1.18 check_tcp.c,1.35,1.36 check_time.c,1.10,1.11 check_udp.c,1.11,1.12 check_ups.c,1.10,1.11 check_users.c,1.8,1.9 negate.c,1.12,1.13 urlize.c,1.8,1.9
- Next message: [Nagiosplug-checkins] CVS: nagiosplug/plugins check_dig.c,1.19,1.20
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Commits
mailing list