Code

ca27f1697f1082e4819f0279f00ecb429fa9ece3
[nagiosplug.git] / lib / utils_base.h
1 /* Header file for nagios plugins utils_base.c */
3 /* This file holds header information for thresholds - use this in preference to 
4    individual plugin logic */
6 /* This has not been merged with utils.h because of problems with
7    timeout_interval when other utils_*.h files use utils.h */
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 */
13 #define OUTSIDE 0
14 #define INSIDE  1
16 typedef 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;
24 typedef struct thresholds_struct {
25         range   *warning;
26         range   *critical;
27         } thresholds;
29 range *parse_range_string (char *);
30 int _set_thresholds(thresholds **, char *, char *);
31 void set_thresholds(thresholds **, char *, char *);
32 int check_range(double, range *);
33 int get_status(double, thresholds *);
35 char *np_escaped_string (const char *);
37 void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3)));