This file is indexed.

/usr/include/collectd/utils_threshold.h is in collectd-dev 4.10.1-2.1ubuntu7.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/**
 * collectd - src/utils_threshold.h
 * 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
 * Free Software Foundation; only version 2 of the License is applicable.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 *
 * Author:
 *   Florian octo Forster <octo at verplant.org>
 **/

#ifndef UTILS_THRESHOLD_H
#define UTILS_THRESHOLD_H 1

#include "collectd.h"
#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
 *
 * Parses the configuration and sets up the module. This is called from
 * `src/configfile.c'.
 */
int ut_config (const oconfig_item_t *ci);

/*
 * ut_check_threshold
 *
 * Checks if a threshold is defined for this value and if such a threshold is
 * configured, check if the value within the acceptable range. If it is not, a
 * notification is dispatched to inform the user that a problem exists. This is
 * called from `plugin_read_all'.
 */
int ut_check_threshold (const data_set_t *ds, const value_list_t *vl);

/*
 * Given an identification returns
 * 0: No threshold is defined.
 * 1: A threshold has been found. The flag `persist' is off.
 * 2: A threshold has been found. The flag `persist' is on.
 *    (That is, it is expected that many notifications are sent until the
 *    problem disappears.)
 */
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 */