diff options
Diffstat (limited to 'lib/utils_base.h')
-rw-r--r-- | lib/utils_base.h | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/lib/utils_base.h b/lib/utils_base.h index 123066f8..27884bf0 100644 --- a/lib/utils_base.h +++ b/lib/utils_base.h | |||
@@ -7,7 +7,7 @@ | |||
7 | 7 | ||
8 | #include "./perfdata.h" | 8 | #include "./perfdata.h" |
9 | #include "./thresholds.h" | 9 | #include "./thresholds.h" |
10 | 10 | #include "states.h" | |
11 | 11 | ||
12 | #ifndef USE_OPENSSL | 12 | #ifndef USE_OPENSSL |
13 | # include "sha256.h" | 13 | # include "sha256.h" |
@@ -26,25 +26,8 @@ | |||
26 | #define OUTSIDE 0 | 26 | #define OUTSIDE 0 |
27 | #define INSIDE 1 | 27 | #define INSIDE 1 |
28 | 28 | ||
29 | #define NP_STATE_FORMAT_VERSION 1 | ||
30 | |||
31 | typedef struct state_data_struct { | ||
32 | time_t time; | ||
33 | void *data; | ||
34 | int length; /* Of binary data */ | ||
35 | } state_data; | ||
36 | |||
37 | typedef struct state_key_struct { | ||
38 | char *name; | ||
39 | char *plugin_name; | ||
40 | int data_version; | ||
41 | char *_filename; | ||
42 | state_data *state_data; | ||
43 | } state_key; | ||
44 | |||
45 | typedef struct np_struct { | 29 | typedef struct np_struct { |
46 | char *plugin_name; | 30 | char *plugin_name; |
47 | state_key *state; | ||
48 | int argc; | 31 | int argc; |
49 | char **argv; | 32 | char **argv; |
50 | } monitoring_plugin; | 33 | } monitoring_plugin; |
@@ -55,10 +38,10 @@ void set_thresholds(thresholds **, char *, char *); | |||
55 | void print_thresholds(const char *, thresholds *); | 38 | void print_thresholds(const char *, thresholds *); |
56 | bool check_range(double, range *); | 39 | bool check_range(double, range *); |
57 | bool mp_check_range(mp_perfdata_value, mp_range); | 40 | bool mp_check_range(mp_perfdata_value, mp_range); |
58 | int get_status(double, thresholds *); | 41 | mp_state_enum get_status(double, thresholds *); |
59 | 42 | ||
60 | /* Handle timeouts */ | 43 | /* Handle timeouts */ |
61 | extern int timeout_state; | 44 | extern mp_state_enum timeout_state; |
62 | extern unsigned int timeout_interval; | 45 | extern unsigned int timeout_interval; |
63 | 46 | ||
64 | /* All possible characters in a threshold range */ | 47 | /* All possible characters in a threshold range */ |
@@ -100,13 +83,9 @@ char *np_extract_value(const char *, const char *, char); | |||
100 | */ | 83 | */ |
101 | int mp_translate_state(char *); | 84 | int mp_translate_state(char *); |
102 | 85 | ||
103 | void np_enable_state(char *, int); | ||
104 | state_data *np_state_read(void); | ||
105 | void np_state_write_string(time_t, char *); | ||
106 | |||
107 | void np_init(char *, int argc, char **argv); | 86 | void np_init(char *, int argc, char **argv); |
108 | void np_set_args(int argc, char **argv); | 87 | void np_set_args(int argc, char **argv); |
109 | void np_cleanup(void); | 88 | void np_cleanup(void); |
110 | const char *state_text(int); | 89 | const char *state_text(mp_state_enum); |
111 | 90 | ||
112 | #endif /* _UTILS_BASE_ */ | 91 | #endif /* _UTILS_BASE_ */ |