a42c4121cd2f93599e9acacd9e61fa0c6cbd6334
[collectd.git] / src / utils_threshold.h
1 /**
2  * collectd - src/utils_threshold.h
3  * Copyright (C) 2007,2008  Florian octo Forster
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; only version 2 of the License is applicable.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
17  *
18  * Author:
19  *   Florian octo Forster <octo at verplant.org>
20  **/
21
22 #ifndef UTILS_THRESHOLD_H
23 #define UTILS_THRESHOLD_H 1
24
25 #include "collectd.h"
26 #include "liboconfig/oconfig.h"
27 #include "plugin.h"
28
29 /*
30  * ut_config
31  *
32  * Parses the configuration and sets up the module. This is called from
33  * `src/configfile.c'.
34  */
35 int ut_config (const oconfig_item_t *ci);
36
37 /*
38  * ut_check_threshold
39  *
40  * Checks if a threshold is defined for this value and if such a threshold is
41  * configured, check if the value within the acceptable range. If it is not, a
42  * notification is dispatched to inform the user that a problem exists. This is
43  * called from `plugin_read_all'.
44  */
45 int ut_check_threshold (const data_set_t *ds, const value_list_t *vl);
46
47 /*
48  * Given an identification returns
49  * 0: No threshold is defined.
50  * 1: A threshold has been found. The flag `persist' is off.
51  * 2: A threshold has been found. The flag `persist' is on.
52  *    (That is, it is expected that many notifications are sent until the
53  *    problem disappears.)
54  */
55 int ut_check_interesting (const char *name);
56
57 #endif /* UTILS_THRESHOLD_H */