diff options
Diffstat (limited to 'lib/utils_base.c')
-rw-r--r-- | lib/utils_base.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/utils_base.c b/lib/utils_base.c index 29b393d0..e95eeaf0 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c | |||
@@ -25,6 +25,7 @@ | |||
25 | *****************************************************************************/ | 25 | *****************************************************************************/ |
26 | 26 | ||
27 | #include "../plugins/common.h" | 27 | #include "../plugins/common.h" |
28 | #include "states.h" | ||
28 | #include <stdarg.h> | 29 | #include <stdarg.h> |
29 | #include "utils_base.h" | 30 | #include "utils_base.h" |
30 | #include <ctype.h> | 31 | #include <ctype.h> |
@@ -253,7 +254,7 @@ bool check_range(double value, range *my_range) { | |||
253 | yes = false; | 254 | yes = false; |
254 | } | 255 | } |
255 | 256 | ||
256 | if (!my_range->end_infinity && !my_range->start_infinity) { | 257 | if (!my_range->end_infinity&& !my_range->start_infinity) { |
257 | if ((my_range->start <= value) && (value <= my_range->end)) { | 258 | if ((my_range->start <= value) && (value <= my_range->end)) { |
258 | return no; | 259 | return no; |
259 | } | 260 | } |
@@ -267,7 +268,7 @@ bool check_range(double value, range *my_range) { | |||
267 | return yes; | 268 | return yes; |
268 | } | 269 | } |
269 | 270 | ||
270 | if (my_range->start_infinity && !my_range->end_infinity) { | 271 | if (my_range->start_infinity && !my_range->end_infinity ) { |
271 | if (value <= my_range->end) { | 272 | if (value <= my_range->end) { |
272 | return no; | 273 | return no; |
273 | } | 274 | } |
@@ -277,7 +278,7 @@ bool check_range(double value, range *my_range) { | |||
277 | } | 278 | } |
278 | 279 | ||
279 | /* Returns status */ | 280 | /* Returns status */ |
280 | int get_status(double value, thresholds *my_thresholds) { | 281 | mp_state_enum get_status(double value, thresholds *my_thresholds) { |
281 | if (my_thresholds->critical != NULL) { | 282 | if (my_thresholds->critical != NULL) { |
282 | if (check_range(value, my_thresholds->critical)) { | 283 | if (check_range(value, my_thresholds->critical)) { |
283 | return STATE_CRITICAL; | 284 | return STATE_CRITICAL; |
@@ -393,7 +394,7 @@ char *np_extract_value(const char *varlist, const char *name, char sep) { | |||
393 | return value; | 394 | return value; |
394 | } | 395 | } |
395 | 396 | ||
396 | const char *state_text(int result) { | 397 | const char *state_text(mp_state_enum result) { |
397 | switch (result) { | 398 | switch (result) { |
398 | case STATE_OK: | 399 | case STATE_OK: |
399 | return "OK"; | 400 | return "OK"; |