diff options
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-05-27 20:52:55 -0400 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-05-28 08:10:49 -0400 |
commit | 7cb3ae09334796f3b54e4e6438e38c2cc679b360 (patch) | |
tree | 398eb8bf5f022b4d5d158fcf9d39be664dd4fa59 /lib | |
parent | 34fe4d62fe79236d0cd560f06f6e93bf46a41dd0 (diff) | |
download | monitoring-plugins-7cb3ae09334796f3b54e4e6438e38c2cc679b360.tar.gz |
check_snmp: Make use of standard threshold functions
This patch makes use of standard threshold functions. This allows using
doubles as thresholds.
Since SNMP supports only integers, double precision numbers are only
printed when parsed from a STRING type.
In addition, support for printing properly Timeticks type has been added,
and the code has been thoroughly cleaned.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils_base.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/utils_base.h b/lib/utils_base.h index f40fdb0f..49e40a63 100644 --- a/lib/utils_base.h +++ b/lib/utils_base.h | |||
@@ -35,6 +35,9 @@ void print_thresholds(const char *, thresholds *); | |||
35 | int check_range(double, range *); | 35 | int check_range(double, range *); |
36 | int get_status(double, thresholds *); | 36 | int get_status(double, thresholds *); |
37 | 37 | ||
38 | /* All possible characters in a threshold range */ | ||
39 | #define NP_THRESHOLDS_CHARS "0123456789.:@~" | ||
40 | |||
38 | char *np_escaped_string (const char *); | 41 | char *np_escaped_string (const char *); |
39 | 42 | ||
40 | void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3))); | 43 | void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3))); |