Add further collectd configuration

This commit is contained in:
Keith Whyte 2022-06-14 05:12:49 +02:00
parent 5540a54ac9
commit c13bf85aa4
5 changed files with 47 additions and 3 deletions

View file

@ -0,0 +1,22 @@
#!/bin/bash
is_empty () {
_o=`rrdtool xport DEF:A=/var/lib/collectd/rrd/$(hostname -f)/$1:value:AVERAGE XPORT:A -s -1day -m10 | xmllint --xpath 'string(xport/data/row)' -`
if [ "$_o" == "0.0000000000e+00" ] ;then
echo "$1 is empty"
return 1
fi
return 0
}
cd /var/lib/collectd/rrd/$(hostname -f)
rm -rf gauge-* derive-*
for f in statsd/* ; do #gauge-bts.0* statsd/*msc.0* statsd/*vlr.0*; do
is_empty $f
if [ $? == 1 ] ; then continue ; fi
mkdir $(basename $f .rrd)
cd $(basename $f .rrd)
ln -s ../$f .
cd ..
done