diff options
Diffstat (limited to 'plugins/check_dig.c')
-rw-r--r-- | plugins/check_dig.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/plugins/check_dig.c b/plugins/check_dig.c index c67da30a..e348a352 100644 --- a/plugins/check_dig.c +++ b/plugins/check_dig.c | |||
@@ -141,10 +141,10 @@ main (int argc, char **argv) | |||
141 | if (output == NULL || strlen (output) == 0) | 141 | if (output == NULL || strlen (output) == 0) |
142 | asprintf (&output, _(" Probably a non-existent host/domain")); | 142 | asprintf (&output, _(" Probably a non-existent host/domain")); |
143 | 143 | ||
144 | if (critical_interval != UNDEFINED && elapsed_time > critical_interval) | 144 | if (critical_interval > UNDEFINED && elapsed_time > critical_interval) |
145 | result = STATE_CRITICAL; | 145 | result = STATE_CRITICAL; |
146 | 146 | ||
147 | else if (warning_interval != UNDEFINED && elapsed_time > warning_interval) | 147 | else if (warning_interval > UNDEFINED && elapsed_time > warning_interval) |
148 | result = STATE_WARNING; | 148 | result = STATE_WARNING; |
149 | 149 | ||
150 | asprintf (&output, _("%.3f seconds response time (%s)"), elapsed_time, output); | 150 | asprintf (&output, _("%.3f seconds response time (%s)"), elapsed_time, output); |
@@ -152,9 +152,9 @@ main (int argc, char **argv) | |||
152 | printf ("DNS %s - %s|%s\n", | 152 | printf ("DNS %s - %s|%s\n", |
153 | state_text (result), output, | 153 | state_text (result), output, |
154 | perfdata("time", microsec, "us", | 154 | perfdata("time", microsec, "us", |
155 | (warning_interval!=UNDEFINED?TRUE:FALSE), | 155 | (warning_interval>UNDEFINED?TRUE:FALSE), |
156 | (int)(1e6*warning_interval), | 156 | (int)(1e6*warning_interval), |
157 | (critical_interval!=UNDEFINED?TRUE:FALSE), | 157 | (critical_interval>UNDEFINED?TRUE:FALSE), |
158 | (int)(1e6*critical_interval), | 158 | (int)(1e6*critical_interval), |
159 | TRUE, 0, FALSE, 0)); | 159 | TRUE, 0, FALSE, 0)); |
160 | return result; | 160 | return result; |
@@ -224,8 +224,6 @@ process_arguments (int argc, char **argv) | |||
224 | case 'w': /* warning */ | 224 | case 'w': /* warning */ |
225 | if (is_nonnegative (optarg)) { | 225 | if (is_nonnegative (optarg)) { |
226 | warning_interval = strtod (optarg, NULL); | 226 | warning_interval = strtod (optarg, NULL); |
227 | if (warning_interval == HUGE_VAL) | ||
228 | usage2 (_("Input causes overflow in warning interval"), optarg); | ||
229 | } | 227 | } |
230 | else { | 228 | else { |
231 | usage2 (_("Warning interval must be a nonnegative integer"), optarg); | 229 | usage2 (_("Warning interval must be a nonnegative integer"), optarg); |
@@ -234,8 +232,6 @@ process_arguments (int argc, char **argv) | |||
234 | case 'c': /* critical */ | 232 | case 'c': /* critical */ |
235 | if (is_nonnegative (optarg)) { | 233 | if (is_nonnegative (optarg)) { |
236 | critical_interval = strtod (optarg, NULL); | 234 | critical_interval = strtod (optarg, NULL); |
237 | if (critical_interval == HUGE_VAL) | ||
238 | usage2 (_("Input causes overflow in critical interval"), optarg); | ||
239 | } | 235 | } |
240 | else { | 236 | else { |
241 | usage2 (_("Critical interval must be a nonnegative integer"), optarg); | 237 | usage2 (_("Critical interval must be a nonnegative integer"), optarg); |