aboutsummaryrefslogtreecommitdiff
path: root/lib/utils_base.h
diff options
context:
space:
mode:
authorGravatar Ton Voon <tonvoon@users.sourceforge.net> 2006-07-13 23:58:00 +0000
committerGravatar Ton Voon <tonvoon@users.sourceforge.net> 2006-07-13 23:58:00 +0000
commit5912398b9723545ecd061650667cbb238be85743 (patch)
treee5d8353cc8d8c278bfc22bd926f613da63f5e83f /lib/utils_base.h
parent548083b2ea865474915fc8a9ddd361e997585a02 (diff)
downloadmonitoring-plugins-5912398b9723545ecd061650667cbb238be85743.tar.gz
Major fixes to check_disk. Now should return same data as df
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1452 f882894a-f735-0410-b71e-b25c423dba1c
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 @@
+/* Header file for nagios plugins utils_base.c */
+
+/* This file holds header information for thresholds - use this in preference to
+ individual plugin logic */
+
+/* This has not been merged with utils.h because of problems with
+ timeout_interval when other utils_*.h files use utils.h */
+
+/* Long term, add new functions to utils_base.h for common routines
+ and utils_*.h for specific to plugin routines. If routines are
+ placed in utils_*.h, then these can be tested with libtap */
+
+#define OUTSIDE 0
+#define INSIDE 1
+
+typedef struct range_struct {
+ double start;
+ int start_infinity; /* FALSE (default) or TRUE */
+ double end;
+ int end_infinity;
+ int alert_on; /* OUTSIDE (default) or INSIDE */
+ } range;
+
+typedef struct thresholds_struct {
+ range *warning;
+ range *critical;
+ } thresholds;
+
+range *parse_range_string (char *);
+int _set_thresholds(thresholds **, char *, char *);
+void set_thresholds(thresholds **, char *, char *);
+int check_range(double, range *);
+int get_status(double, thresholds *);
+
+char *np_escaped_string (const char *);
+
+void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3)));