projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9becec8
)
Properly detect which interfaces to monitor
author
Andrew Bays
<abays@redhat.com>
Thu, 8 Feb 2018 21:14:43 +0000
(16:14 -0500)
committer
Andrew Bays
<andrew.bays@gmail.com>
Thu, 5 Sep 2019 13:21:22 +0000
(09:21 -0400)
src/connectivity.c
patch
|
blob
|
history
diff --git
a/src/connectivity.c
b/src/connectivity.c
index
e58ffde
..
e39bce1
100644
(file)
--- a/
src/connectivity.c
+++ b/
src/connectivity.c
@@
-112,7
+112,7
@@
typedef struct interface_list_s interface_list_t;
static ignorelist_t *ignorelist = NULL;
static interface_list_t *interface_list_head = NULL;
static ignorelist_t *ignorelist = NULL;
static interface_list_t *interface_list_head = NULL;
-static int monitor_all_interfaces =
0
;
+static int monitor_all_interfaces =
1
;
static int connectivity_thread_loop = 0;
static int connectivity_thread_error = 0;
static int connectivity_thread_loop = 0;
static int connectivity_thread_error = 0;
@@
-705,10
+705,9
@@
static int stop_thread(int shutdown) /* {{{ */
static int connectivity_init(void) /* {{{ */
{
static int connectivity_init(void) /* {{{ */
{
- if (
interface_list_head == NULL
) {
+ if (
monitor_all_interfaces
) {
NOTICE("connectivity plugin: No interfaces have been selected, so all will "
"be monitored");
NOTICE("connectivity plugin: No interfaces have been selected, so all will "
"be monitored");
- monitor_all_interfaces = 1;
}
return (start_thread());
}
return (start_thread());
@@
-716,11
+715,13
@@
static int connectivity_init(void) /* {{{ */
static int connectivity_config(const char *key, const char *value) /* {{{ */
{
static int connectivity_config(const char *key, const char *value) /* {{{ */
{
- if (ignorelist == NULL)
+ if (ignorelist == NULL)
{
ignorelist = ignorelist_create(/* invert = */ 1);
ignorelist = ignorelist_create(/* invert = */ 1);
+ }
if (strcasecmp(key, "Interface") == 0) {
ignorelist_add(ignorelist, value);
if (strcasecmp(key, "Interface") == 0) {
ignorelist_add(ignorelist, value);
+ monitor_all_interfaces = 0;
} else {
return (-1);
}
} else {
return (-1);
}