X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_threshold.h;h=8aaf34c61af0175c18d3fa9f4ae3897d8b998e15;hb=7de4b3692af84751fab5ac46a5da7414346ea50b;hp=dfc42d19d409e20a66a8ff25521d1b3c5ace43f7;hpb=b62e76ba5220c5279c29d970a65fa5a74dc1f145;p=collectd.git diff --git a/src/utils_threshold.h b/src/utils_threshold.h index dfc42d19..8aaf34c6 100644 --- a/src/utils_threshold.h +++ b/src/utils_threshold.h @@ -1,6 +1,6 @@ /** * collectd - src/utils_threshold.h - * Copyright (C) 2007 Florian octo Forster + * Copyright (C) 2007-2009 Florian octo Forster * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -26,6 +26,24 @@ #include "liboconfig/oconfig.h" #include "plugin.h" +typedef struct threshold_s +{ + char host[DATA_MAX_NAME_LEN]; + char plugin[DATA_MAX_NAME_LEN]; + char plugin_instance[DATA_MAX_NAME_LEN]; + char type[DATA_MAX_NAME_LEN]; + char type_instance[DATA_MAX_NAME_LEN]; + char data_source[DATA_MAX_NAME_LEN]; + gauge_t warning_min; + gauge_t warning_max; + gauge_t failure_min; + gauge_t failure_max; + gauge_t hysteresis; + int flags; + int hits; + struct threshold_s *next; +} threshold_t; + /* * ut_config * @@ -54,4 +72,16 @@ int ut_check_threshold (const data_set_t *ds, const value_list_t *vl); */ int ut_check_interesting (const char *name); +/* + * Given an identifier in form of a `value_list_t', searches for the best + * matching threshold configuration. `ret_threshold' may be NULL. + * + * Returns: + * 0: Success. Threshold configuration has been copied to + * `ret_threshold' (if it is non-NULL). + * ENOENT: No configuration for this identifier found. + * else: Error. + */ +int ut_search_threshold (const value_list_t *vl, threshold_t *ret_threshold); + #endif /* UTILS_THRESHOLD_H */