[Discuss] disk usage graph?

pw p.willis at telus.net
Fri Mar 16 12:55:05 PST 2007


R. McFarlane wrote:
> Hello all,
> 
>     My "GooFu" must be weak as I have not been able to find a solution. :(
> 
>     What I am looking for is a script (tarball or ubuntu compatible 
> package) that will track disk usage and provide RRD based graphs. Part 
> of the output should allow me to be able to calculate the average disk 
> space used over a period of time.
>     For those wondering what I mean by RRD graph, check out mailgraph. 
> It graphs the stats of the mail log.
> 

Why not just write a script that logs in mailgraph input format and then
use that program to display?

ie:

shell script:

#####disklogger.sh###########
#DATA LOGGER FOR DISK USAGE
#!/bin/bash

while [ 1 ];do
         export DT=`date`;
         df -B1 | awk -F " " 
'{printf("%s|",ENVIRON["DT"]);for(A=1;A<NF;A++){printf("%s|",$A)};printf("\n") 
}'>>/var/log/my_disk_log.txt;
         sleep 60;
done






usage:

[blah at yada /]# sh disklogger.sh &




Peter



More information about the Discuss mailing list