2 * collectd - src/utils_threshold.h
3 * Copyright (C) 2014 Pierre-Yves Ritschard
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
24 * Pierre-Yves Ritschard <pyr at spootnik.org>
27 #ifndef UTILS_THRESHOLD_H
28 #define UTILS_THRESHOLD_H 1
30 #define UT_FLAG_INVERT 0x01
31 #define UT_FLAG_PERSIST 0x02
32 #define UT_FLAG_PERCENTAGE 0x04
33 #define UT_FLAG_INTERESTING 0x08
34 #define UT_FLAG_PERSIST_OK 0x10
35 typedef struct threshold_s
37 char host[DATA_MAX_NAME_LEN];
38 char plugin[DATA_MAX_NAME_LEN];
39 char plugin_instance[DATA_MAX_NAME_LEN];
40 char type[DATA_MAX_NAME_LEN];
41 char type_instance[DATA_MAX_NAME_LEN];
42 char data_source[DATA_MAX_NAME_LEN];
50 struct threshold_s *next;
53 extern c_avl_tree_t *threshold_tree;
54 extern pthread_mutex_t threshold_lock;
56 threshold_t *threshold_get (const char *hostname,
57 const char *plugin, const char *plugin_instance,
58 const char *type, const char *type_instance);
60 threshold_t *threshold_search (const value_list_t *vl);
62 int ut_search_threshold (const value_list_t *vl,
63 threshold_t *ret_threshold);
65 #endif /* UTILS_THRESHOLD_H */
67 /* vim: set sw=2 sts=2 ts=8 : */