From: Pavel Rochnyack Date: Sun, 8 Jul 2018 06:19:01 +0000 (+0700) Subject: routeros: Fixed check of 'Collect*' options X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=98c0b6509f4d33d6696d8b581cdf43e8d1ac3015;hp=34c2754cc44f955a3ca783bdf2e30254739a2f36 routeros: Fixed check of 'Collect*' options --- diff --git a/src/routeros.c b/src/routeros.c index 5ba92c3e..7598698d 100644 --- a/src/routeros.c +++ b/src/routeros.c @@ -393,7 +393,27 @@ static int cr_config_router(oconfig_item_t *ci) /* {{{ */ status = -1; } - if (!router_data->collect_interface && !router_data->collect_regtable) { + int report = 0; + if (router_data->collect_interface) + report++; + if (router_data->collect_regtable) + report++; +#if ROS_VERSION >= ROS_VERSION_ENCODE(1, 1, 0) + if (router_data->collect_cpu_load) + report++; + if (router_data->collect_memory) + report++; + if (router_data->collect_df) + report++; + if (router_data->collect_disk) + report++; +#if ROS_VERSION >= ROS_VERSION_ENCODE(1, 1, 3) + if (router_data->collect_health) + report++; +#endif +#endif + + if (!report) { ERROR("routeros plugin: No `Collect*' option within a `Router' block. " "What statistics should I collect?"); status = -1;