summaryrefslogtreecommitdiffstats
path: root/lib/utils_base.h
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2008-03-19 14:42:12 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2008-03-19 14:42:12 (GMT)
commitb17b2421987bb8a7606948333e75f990b35852b8 (patch)
tree5d220f355728f1448f9dbd6f796631bbfef0733c /lib/utils_base.h
parentcab9440a671390e279228cd31ad56b055d611a21 (diff)
downloadmonitoring-plugins-b17b2421987bb8a7606948333e75f990b35852b8.tar.gz
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
Diffstat (limited to 'lib/utils_base.h')
-rw-r--r--lib/utils_base.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/utils_base.h b/lib/utils_base.h
index bda7659..c616c5b 100644
--- a/lib/utils_base.h
+++ b/lib/utils_base.h
@@ -31,7 +31,7 @@ typedef struct thresholds_struct {
31range *parse_range_string (char *); 31range *parse_range_string (char *);
32int _set_thresholds(thresholds **, char *, char *); 32int _set_thresholds(thresholds **, char *, char *);
33void set_thresholds(thresholds **, char *, char *); 33void set_thresholds(thresholds **, char *, char *);
34void print_thresholds(const char *, thresholds *); 34void print_thresholds(thresholds *);
35int check_range(double, range *); 35int check_range(double, range *);
36int get_status(double, thresholds *); 36int get_status(double, thresholds *);
37 37
@@ -39,9 +39,22 @@ char *np_escaped_string (const char *);
39 39
40void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3))); 40void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3)));
41 41
42/* Return codes for _set_thresholds */ 42
43#define NP_RANGE_UNPARSEABLE 1 43/* Parses a threshold string, as entered from command line */
44#define NP_WARN_WITHIN_CRIT 2 44/* Returns a malloc'd threshold* which can be freed */
45thresholds *parse_thresholds_string(char *);
46thresholds * _parse_thresholds_string(char *);
47void free_thresholds(thresholds *);
48range * _parse_range_string_v2(char *);
49int utils_errno;
50
51
52/* Error codes */
53#define NP_RANGE_UNPARSEABLE 1
54#define NP_WARN_WITHIN_CRIT 2
55#define NP_RANGE_MISSING_COLON 3
56#define NP_THRESHOLD_UNPARSEABLE 4
57#define NP_MEMORY_ERROR 5
45 58
46/* a simple check to see if we're running as root. 59/* a simple check to see if we're running as root.
47 * returns zero on failure, nonzero on success */ 60 * returns zero on failure, nonzero on success */