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.h29
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
31typedef struct state_data_struct {
32 time_t time;
33 void *data;
34 int length; /* Of binary data */
35} state_data;
36
37typedef 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
45typedef struct np_struct { 29typedef 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 *);
55void print_thresholds(const char *, thresholds *); 38void print_thresholds(const char *, thresholds *);
56bool check_range(double, range *); 39bool check_range(double, range *);
57bool mp_check_range(mp_perfdata_value, mp_range); 40bool mp_check_range(mp_perfdata_value, mp_range);
58int get_status(double, thresholds *); 41mp_state_enum get_status(double, thresholds *);
59 42
60/* Handle timeouts */ 43/* Handle timeouts */
61extern int timeout_state; 44extern mp_state_enum timeout_state;
62extern unsigned int timeout_interval; 45extern 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 */
101int mp_translate_state(char *); 84int mp_translate_state(char *);
102 85
103void np_enable_state(char *, int);
104state_data *np_state_read(void);
105void np_state_write_string(time_t, char *);
106
107void np_init(char *, int argc, char **argv); 86void np_init(char *, int argc, char **argv);
108void np_set_args(int argc, char **argv); 87void np_set_args(int argc, char **argv);
109void np_cleanup(void); 88void np_cleanup(void);
110const char *state_text(int); 89const char *state_text(mp_state_enum);
111 90
112#endif /* _UTILS_BASE_ */ 91#endif /* _UTILS_BASE_ */