From b17b2421987bb8a7606948333e75f990b35852b8 Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Wed, 19 Mar 2008 14:42:12 +0000 Subject: 1st pass at check_procs with multiple threshold checks git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/branches/new_threshold_syntax@1958 f882894a-f735-0410-b71e-b25c423dba1c --- lib/utils_base.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'lib/utils_base.h') diff --git a/lib/utils_base.h b/lib/utils_base.h index bda76595..c616c5bd 100644 --- a/lib/utils_base.h +++ b/lib/utils_base.h @@ -31,7 +31,7 @@ typedef struct thresholds_struct { range *parse_range_string (char *); int _set_thresholds(thresholds **, char *, char *); void set_thresholds(thresholds **, char *, char *); -void print_thresholds(const char *, thresholds *); +void print_thresholds(thresholds *); int check_range(double, range *); int get_status(double, thresholds *); @@ -39,9 +39,22 @@ char *np_escaped_string (const char *); void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3))); -/* Return codes for _set_thresholds */ -#define NP_RANGE_UNPARSEABLE 1 -#define NP_WARN_WITHIN_CRIT 2 + +/* Parses a threshold string, as entered from command line */ +/* Returns a malloc'd threshold* which can be freed */ +thresholds *parse_thresholds_string(char *); +thresholds * _parse_thresholds_string(char *); +void free_thresholds(thresholds *); +range * _parse_range_string_v2(char *); +int utils_errno; + + +/* Error codes */ +#define NP_RANGE_UNPARSEABLE 1 +#define NP_WARN_WITHIN_CRIT 2 +#define NP_RANGE_MISSING_COLON 3 +#define NP_THRESHOLD_UNPARSEABLE 4 +#define NP_MEMORY_ERROR 5 /* a simple check to see if we're running as root. * returns zero on failure, nonzero on success */ -- cgit v1.2.3-74-g34f1