summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dcf31f3)
raw | patch | inline | side by side (parent: dcf31f3)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Sun, 10 Aug 2003 12:48:47 +0000 (12:48 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Sun, 10 Aug 2003 12:48:47 +0000 (12:48 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@679 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_dns.c | patch | blob | history | |
plugins/check_smtp.c | patch | blob | history |
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index afc23a4f1b8fe3a74ee99cbc18506a06cc32a267..58c0a1bf91e88c382e765e7607d52b6fe797f112 100644 (file)
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
char *temp_buffer = NULL;
int result = STATE_UNKNOWN;
double elapsed_time;
+ long microsec;
struct timeval tv;
int multi_address;
result = STATE_CRITICAL;
asprintf(&output, _("expected %s but got %s"), expected_address, address);
}
-
- elapsed_time = delta_time (tv);
+
+ microsec = deltime (tv);
+ elapsed_time = (double)microsec / 1.0e6;
if (result == STATE_OK) {
if (strchr (address, ',') == NULL)
else
multi_address = TRUE;
- printf (_("DNS ok - %.3f seconds response time, address%s %s|time=%.3f\n"),
- elapsed_time, (multi_address==TRUE ? "es are" : " is"), address, elapsed_time);
+ printf (_("DNS ok - %.3f seconds response time, address%s %s|time=%ldus\n"),
+ elapsed_time, (multi_address==TRUE ? "es are" : " is"), address, microsec);
}
else if (result == STATE_WARNING)
printf (_("DNS WARNING - %s\n"),
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index 41ed5f38d0c1207a9c5a3795f55f92d847875e24..b35ebbc093ad9a2c82744feac18b0b428ad6e0d8 100644 (file)
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
{
int sd;
double elapsed_time;
+ long microsec;
int result = STATE_UNKNOWN;
char buffer[MAX_INPUT_BUFFER];
char *from_str = NULL;
/* reset the alarm */
alarm (0);
- elapsed_time = delta_time (tv);
+ microsec = deltime (tv);
+ elapsed_time = (double)microsec / 1.0e6;
if (check_critical_time && elapsed_time > (double) critical_time)
result = STATE_CRITICAL;
result = STATE_WARNING;
if (verbose)
- printf (_("SMTP %s - %.3f sec. response time, %s|time=%.3f\n"),
- state_text (result), elapsed_time, buffer, elapsed_time);
+ printf (_("SMTP %s - %.3f sec. response time, %s|time=%ldus\n"),
+ state_text (result), elapsed_time, buffer, microsec);
else
- printf (_("SMTP %s - %.3f second response time|time=%.3f\n"),
- state_text (result), elapsed_time, elapsed_time);
+ printf (_("SMTP %s - %.3f second response time|time=%ldus\n"),
+ state_text (result), elapsed_time, microsec);
return result;
}