From 7cb3ae09334796f3b54e4e6438e38c2cc679b360 Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Wed, 27 May 2009 20:52:55 -0400 Subject: 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. --- lib/utils_base.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') 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 *); int check_range(double, range *); int get_status(double, thresholds *); +/* All possible characters in a threshold range */ +#define NP_THRESHOLDS_CHARS "0123456789.:@~" + char *np_escaped_string (const char *); void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3))); -- cgit v1.2.3