dot

packages and services management
Log | Files | Refs | README

commit e4e7f6ceb469512760c379b27613b3e644b9b3ea
parent 3ef5056676cc7fb3398c53ce2f76f2c3e85100fe
Author: Josuah Demangeon <mail@josuah.net>
Date:   Wed, 14 Feb 2018 20:20:59 +0100

[fix] make collectd-ploot path-independent

Diffstat:
Mbin/collectd-ploot | 15+++++++++++++--
Metc/collectd.conf | 10+++++-----
2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/bin/collectd-ploot b/bin/collectd-ploot @@ -1,8 +1,19 @@ #!/bin/sh -e +# usage: collectd-ploot <collectd-dir> <target-dir> + mkdir -p stat -for host in "${VAR}/lib/collectd"/* +find "$(cd "${1}"; pwd)" -mindepth 2 -maxdepth 2 | sort | + sed -r 's:.*/([^/]+/[^/]+)-([0-9]+-[0-9]+-[0-9]+)$:\1/\2:' | +while IFS='/' read -r node category stat +do + printf '%s - %s - %s\n' "${node}" "${category}" "${stat}" +done + +exit + +for host in "${1}"/* do { printf '\n' @@ -29,6 +40,6 @@ do printf '\n' - } > "${1}/${host#${VAR}/lib/collectd/}" + } > "${2}/$(basename "${host}")" done diff --git a/etc/collectd.conf b/etc/collectd.conf @@ -3,7 +3,7 @@ AutoLoadPlugin true -Interval 10 +Interval 900 MaxReadInterval 86400 Timeout 2 ReadThreads 5 @@ -61,7 +61,7 @@ WriteQueueLimitLow 800000 ReportRelative true </Plugin> -#<Plugin memory> -# ValuesAbsolute false -# ValuesPercentage true -#</Plugin> +<Plugin memory> + ValuesAbsolute false + ValuesPercentage true +</Plugin>