[mrtg] Tracking size of one file

Leen Smit leen at webmind.nl
Wed Feb 19 11:39:50 MET 2003


He there again!

The MIB and SNMP is working fine at this stage, thanks for the help i got from this list.
However, im now trying to monitor the file size of the messages log on my redhat machine. (my PIX is sending its Informational (!) syslog to the linux syslogd, which is a LOT of data). Since id like to keep an eye on my disk space, i tried to make a small bash script that gives me the size of the file, and the free space on that partition.
I would expect one line going up, and one line going down.. but this aint the case, i get really weird graphs.

im pretty sure i have the right values, but it seems like they are not passed on to mrtg correctly.

Anyone here any ides one this??


the script :
#!/bin/sh
SIZE=`du /var/log/messages* -c|grep total |cut -f1`
AVAIL=`df |grep 'hdb1' |cut -d' ' -f 19`
echo $SIZE
echo $AVAIL
echo `uptime | cut -d"," -f1,2`
echo $HOSTNAME

which gives an output of :
1864344
13242480
11:42am up 8 days, 1:29
localhost.localdomain


Config file 

WorkDir: /var/www/html/load
Language: Dutch
#RunAsDaemOn:Yes
Interval:5

Options[_]: growright,gauge,noarrow,nobanner
MaxBytes[du]: 500000000 
Suppress[du]: wmy
Target[du]: `/etc/mrtg/du.sh`
Title[du]: Disk Usage
PageTop[du]: <h3>Disk Usage</h3>
YLegend[du]: Disk Usage

(the Maxbytes is skewed, since ive been trying to get some sense in my graphs)

      Leen Smit
      Leen.smit at pronetsolutions.nl

      Pro Net Solutions B.V.
      Rigtersbleek Aalten 4
      7521 RB Enschede
      Tel.: 053 432 86 49
      Fax: 053 432 86 94
     


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list