aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_dns.c
diff options
context:
space:
mode:
authorGravatar Jean-Claude Computing <jeanclaude.computing@gmail.com> 2014-02-26 17:33:40 +0100
committerGravatar Sven Nierlein <sven@nierlein.de> 2014-06-28 22:01:16 +0200
commit79ba1f90dbb9f29871f09bfd6a95cba2ed86ee5d (patch)
tree8c09d9821db5e3a57e8416dfc32ad152413f63d0 /plugins/check_dns.c
parent7508da9360a77c6799e74a8109b768a1b8fbba11 (diff)
downloadmonitoring-plugins-79ba1f90dbb9f29871f09bfd6a95cba2ed86ee5d.tar.gz
check_dns: add warning and critical thresholds to perfdata
Diffstat (limited to 'plugins/check_dns.c')
-rw-r--r--plugins/check_dns.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c
index eebe72cc..a2a92f41 100644
--- a/plugins/check_dns.c
+++ b/plugins/check_dns.c
@@ -242,7 +242,14 @@ main (int argc, char **argv)
}
printf (ngettext("%.3f second response time", "%.3f seconds response time", elapsed_time), elapsed_time);
printf (_(". %s returns %s"), query_address, address);
- printf ("|%s\n", fperfdata ("time", elapsed_time, "s", FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
+ if ((time_thresholds->warning == NULL) || (time_thresholds->critical == NULL)) {
+ printf ("|%s\n", fperfdata ("time", elapsed_time, "s", FALSE, 0, FALSE, 0, TRUE, 0, FALSE, 0));
+ } else {
+ printf ("|%s\n", fperfdata ("time", elapsed_time, "s",
+ TRUE, time_thresholds->warning->end,
+ TRUE, time_thresholds->critical->end,
+ TRUE, 0, FALSE, 0));
+ }
}
else if (result == STATE_WARNING)
printf (_("DNS WARNING - %s\n"),