[rrd-users] montor size of dir

Martin Friberg martin at swetech.se
Mon Sep 19 17:24:20 CEST 2016


ok i use GAUGE for temp mayby wrong?

anyhow i created the .rrd with this script
---------------------------------------------------------------------------------------------------------------
#!/bin/bash
# Script to create rrd-file


directory="/home/rrddata/"
filename="data.rrd"

# Check i file already exists
if [ ! -f "$directory$filename" ]
then
         # File doesn't exist, create new rrd-file
         echo "Creating RRDtool DB"
         rrdtool create $directory$filename \
                  --step 300 \
                 DS:kallstroms:ABSOLUTE:300:U:U \
             RRA:AVERAGE:0.5:1:10
echo "Done!"
else
         echo $directory$filename" already exists, delete it first."
fi

----------------------------------------------------------------------------------------------------------------
and i update it with this script
----------------------------------------------------------------------------------------------------------------
#!/bin/bash

RRDD="/home/rrddata/data.rrd"

CC=`du -sm /home/backups/Fredrik-Server/current/ |sed -e s/". "//g|awk 
'{$1=$1 ;printf  $1}'`

rrdtool update $RRDD N:$CC

echo "$CC"
----------------------------------------------------------------------------------------------------------------

now i get a correct value 3377

but the image looks like this
http://sv.tinypic.com/r/s6olmo/9

iam obviously doing something wrong any pointers would be helpfull

Best regards Martin

Den 2016-09-19 kl. 10:22, skrev Simon Hobson:
> Martin Friberg <martin at swetech.se> wrote:
>
>> if i run `du -sm /path/to/dir// |sed -e s/". "//g|awk '{$1=$1 ;printf  $1}'
>>
>> i get the size of that directory in mb all good
>> but how do i go about and create a rrd file i know how to create one for tempereature but i dont think that would work here :)
>>
>> should i use COUNTER or ?
>
> Same as for temperature - use absolute.
>
>
> _______________________________________________
> rrd-users mailing list
> rrd-users at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
>

---
Detta e-postmeddelande har sökts igenom efter virus med antivirusprogram från Avast.
https://www.avast.com/antivirus



More information about the rrd-users mailing list