From e0688a69114c95efaa0fbee8f8e91f6dcc21a1ee Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Mon, 30 Jan 2006 22:24:31 +0000 Subject: Clearly defined thresholds & ranges in docs. Added get_status routine. Added set_thresholds routine. Tests enhanced to check new routines git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1304 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/utils.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'plugins/utils.h') diff --git a/plugins/utils.h b/plugins/utils.h index f47d0533..ffcb39da 100644 --- a/plugins/utils.h +++ b/plugins/utils.h @@ -61,15 +61,24 @@ struct timeval { #define OUTSIDE 0 #define INSIDE 1 -typedef struct threshold_struct { +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 */ - } threshold; - -threshold *parse_threshold (char *); + } 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 *); #ifndef HAVE_GETTIMEOFDAY int gettimeofday(struct timeval *, struct timezone *); -- cgit v1.2.3