summaryrefslogtreecommitdiffstats
path: root/plugins/check_dns.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_dns.c')
-rw-r--r--plugins/check_dns.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index afc23a4f..58c0a1bf 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -78,6 +78,7 @@ main (int argc, char **argv)
78 char *temp_buffer = NULL; 78 char *temp_buffer = NULL;
79 int result = STATE_UNKNOWN; 79 int result = STATE_UNKNOWN;
80 double elapsed_time; 80 double elapsed_time;
81 long microsec;
81 struct timeval tv; 82 struct timeval tv;
82 int multi_address; 83 int multi_address;
83 84
@@ -197,8 +198,9 @@ main (int argc, char **argv)
197 result = STATE_CRITICAL; 198 result = STATE_CRITICAL;
198 asprintf(&output, _("expected %s but got %s"), expected_address, address); 199 asprintf(&output, _("expected %s but got %s"), expected_address, address);
199 } 200 }
200 201
201 elapsed_time = delta_time (tv); 202 microsec = deltime (tv);
203 elapsed_time = (double)microsec / 1.0e6;
202 204
203 if (result == STATE_OK) { 205 if (result == STATE_OK) {
204 if (strchr (address, ',') == NULL) 206 if (strchr (address, ',') == NULL)
@@ -206,8 +208,8 @@ main (int argc, char **argv)
206 else 208 else
207 multi_address = TRUE; 209 multi_address = TRUE;
208 210
209 printf (_("DNS ok - %.3f seconds response time, address%s %s|time=%.3f\n"), 211 printf (_("DNS ok - %.3f seconds response time, address%s %s|time=%ldus\n"),
210 elapsed_time, (multi_address==TRUE ? "es are" : " is"), address, elapsed_time); 212 elapsed_time, (multi_address==TRUE ? "es are" : " is"), address, microsec);
211 } 213 }
212 else if (result == STATE_WARNING) 214 else if (result == STATE_WARNING)
213 printf (_("DNS WARNING - %s\n"), 215 printf (_("DNS WARNING - %s\n"),