diff options
Diffstat (limited to 'collectors/proc.plugin/proc_spl_kstat_zfs.c')
-rw-r--r-- | collectors/proc.plugin/proc_spl_kstat_zfs.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/collectors/proc.plugin/proc_spl_kstat_zfs.c b/collectors/proc.plugin/proc_spl_kstat_zfs.c index 8938d643..0db9970c 100644 --- a/collectors/proc.plugin/proc_spl_kstat_zfs.c +++ b/collectors/proc.plugin/proc_spl_kstat_zfs.c @@ -140,7 +140,7 @@ int do_proc_spl_kstat_zfs_arcstats(int update_every, usec_t dt) { if(likely(!do_zfs_stats)) { DIR *dir = opendir(dirname); if(unlikely(!dir)) { - error("Cannot read directory '%s'", dirname); + collector_error("Cannot read directory '%s'", dirname); return 1; } @@ -177,7 +177,7 @@ int do_proc_spl_kstat_zfs_arcstats(int update_every, usec_t dt) { for(l = 0; l < lines ;l++) { size_t words = procfile_linewords(ff, l); if(unlikely(words < 3)) { - if(unlikely(words)) error("Cannot read " ZFS_PROC_ARCSTATS " line %zu. Expected 3 params, read %zu.", l, words); + if(unlikely(words)) collector_error("Cannot read " ZFS_PROC_ARCSTATS " line %zu. Expected 3 params, read %zu.", l, words); continue; } @@ -285,6 +285,8 @@ int update_zfs_pool_state_chart(const DICTIONARY_ITEM *item, void *pool_p, void pool->rd_offline = rrddim_add(pool->st, "offline", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); pool->rd_removed = rrddim_add(pool->st, "removed", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); pool->rd_unavail = rrddim_add(pool->st, "unavail", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); + + rrdlabels_add(pool->st->rrdlabels, "pool", name, RRDLABEL_SRC_AUTO); } rrddim_set_by_pointer(pool->st, pool->rd_online, pool->online); @@ -320,7 +322,7 @@ int do_proc_spl_kstat_zfs_pool_state(int update_every, usec_t dt) snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, "/proc/spl/kstat/zfs"); dirname = config_get("plugin:proc:" ZFS_PROC_POOLS, "directory to monitor", filename); - zfs_pools = dictionary_create(DICT_OPTION_SINGLE_THREADED); + zfs_pools = dictionary_create_advanced(DICT_OPTION_SINGLE_THREADED, &dictionary_stats_category_collectors, 0); do_zfs_pool_state = 1; } @@ -328,7 +330,7 @@ int do_proc_spl_kstat_zfs_pool_state(int update_every, usec_t dt) if (likely(do_zfs_pool_state)) { DIR *dir = opendir(dirname); if (unlikely(!dir)) { - error("Cannot read directory '%s'", dirname); + collector_error("Cannot read directory '%s'", dirname); return 1; } @@ -392,7 +394,7 @@ int do_proc_spl_kstat_zfs_pool_state(int update_every, usec_t dt) char *c = strchr(state, '\n'); if (c) *c = '\0'; - error("ZFS POOLS: Undefined state %s for zpool %s, disabling the chart", state, de->d_name); + collector_error("ZFS POOLS: Undefined state %s for zpool %s, disabling the chart", state, de->d_name); } } } @@ -402,7 +404,7 @@ int do_proc_spl_kstat_zfs_pool_state(int update_every, usec_t dt) } if (do_zfs_pool_state && pool_found && !state_file_found) { - info("ZFS POOLS: State files not found. Disabling the module."); + collector_info("ZFS POOLS: State files not found. Disabling the module."); do_zfs_pool_state = 0; } |