summaryrefslogtreecommitdiffstats
path: root/lib/utils_base.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils_base.h')
-rw-r--r--lib/utils_base.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/utils_base.h b/lib/utils_base.h
new file mode 100644
index 00000000..ca27f169
--- /dev/null
+++ b/lib/utils_base.h
@@ -0,0 +1,37 @@
1/* Header file for nagios plugins utils_base.c */
2
3/* This file holds header information for thresholds - use this in preference to
4 individual plugin logic */
5
6/* This has not been merged with utils.h because of problems with
7 timeout_interval when other utils_*.h files use utils.h */
8
9/* Long term, add new functions to utils_base.h for common routines
10 and utils_*.h for specific to plugin routines. If routines are
11 placed in utils_*.h, then these can be tested with libtap */
12
13#define OUTSIDE 0
14#define INSIDE 1
15
16typedef struct range_struct {
17 double start;
18 int start_infinity; /* FALSE (default) or TRUE */
19 double end;
20 int end_infinity;
21 int alert_on; /* OUTSIDE (default) or INSIDE */
22 } range;
23
24typedef struct thresholds_struct {
25 range *warning;
26 range *critical;
27 } thresholds;
28
29range *parse_range_string (char *);
30int _set_thresholds(thresholds **, char *, char *);
31void set_thresholds(thresholds **, char *, char *);
32int check_range(double, range *);
33int get_status(double, thresholds *);
34
35char *np_escaped_string (const char *);
36
37void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3)));