summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@aei.ca>2009-05-27 20:52:55 -0400
committerThomas Guyot-Sionnest <dermoth@aei.ca>2009-05-28 08:10:49 -0400
commit7cb3ae09334796f3b54e4e6438e38c2cc679b360 (patch)
tree398eb8bf5f022b4d5d158fcf9d39be664dd4fa59 /lib
parent34fe4d62fe79236d0cd560f06f6e93bf46a41dd0 (diff)
downloadmonitoring-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.h3
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 *);
35int check_range(double, range *); 35int check_range(double, range *);
36int get_status(double, thresholds *); 36int get_status(double, thresholds *);
37 37
38/* All possible characters in a threshold range */
39#define NP_THRESHOLDS_CHARS "0123456789.:@~"
40
38char *np_escaped_string (const char *); 41char *np_escaped_string (const char *);
39 42
40void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3))); 43void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3)));