From 7658e9919a3ac9efafe4c7c2c76112ec67eeee3b Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 28 Sep 2009 15:56:26 +0200 Subject: [PATCH] netapp plugin: Print a notice if all WAFL values have been disabled. This message is printed if the user did supply a block but then disabled all supported values. WAFL collection will be disabled in this case to increase performance. --- src/netapp.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/netapp.c b/src/netapp.c index a4b30cc0..c2ebc9f9 100644 --- a/src/netapp.c +++ b/src/netapp.c @@ -263,6 +263,17 @@ static void free_disk (disk_t *disk) /* {{{ */ free_disk (next); } /* }}} void free_disk */ +static void free_cfg_wafl (cfg_wafl_t *cw) /* {{{ */ +{ + if (cw == NULL) + return; + + if (cw->query != NULL) + na_elem_free (cw->query); + + sfree (cw); +} /* }}} void free_cfg_wafl */ + static void free_cfg_disk (cfg_disk_t *cfg_disk) /* {{{ */ { if (cfg_disk == NULL) @@ -305,6 +316,7 @@ static void free_host_config (host_config_t *hc) /* {{{ */ free_cfg_service (hc->services); free_cfg_disk (hc->cfg_disk); + free_cfg_wafl (hc->cfg_wafl); free_volume (hc->volumes); sfree (hc); @@ -1695,6 +1707,14 @@ static int cna_config_wafl(host_config_t *host, oconfig_item_t *ci) /* {{{ */ "`WAFL' blocks.", item->key); } + if ((cfg_wafl->flags & CFG_WAFL_ALL) == 0) + { + NOTICE ("netapp plugin: All WAFL related values have been disabled. " + "Collection of WAFL data will be disabled entirely."); + free_cfg_wafl (host->cfg_wafl); + host->cfg_wafl = NULL; + } + return (0); } /* }}} int cna_config_wafl */ -- 2.30.2