
http://www.cheesyboofs.co.uk/mrtg-nas/
Code: Select all
Title[hda2]: /dev/hda2 Disk Usage
Target[hda2]: `sh /bin/mrtg-disk hda2`
PageTop[hda2]: <h1>/dev/hda2 Disk Usage</h1>
MaxBytes[hda2]: 10079453184
Unscaled[hda2]: dwmy
YLegend[hda2]: Bytes
LegendI[hda2]: Used
LegendO[hda2]: Free
Options[hda2]: gauge growright noinfo nobanner
ShortLegend[hda2]: Bytes
Legend1[hda2]: Used
Legend2[hda2]: Free
Code: Select all
#!/bin/bash
case "$1" in
hda2)
echo `df | grep /dev/hda2 | awk '{ print $3 }'` "* 1024" | bc
echo `df | grep /dev/hda2 | awk '{ print $4 }'` "* 1024" | bc
;;
esac
services / # cat etc/mrtg/hda2-free.cfgservices / # ./usr/bin/mrtg etc/mrtg/hda2-free.cfg
/bin/mrtg-disk: line 9: syntax error: unexpected end of file
WARNING: Could not get any data from external command 'sh /bin/mrtg-disk hda2'
Maybe the external command did not even start. (Illegal seek)
WARNING: Problem with External get 'sh /bin/mrtg-disk hda2':
Expected a Number for 'in' but nothing'
WARNING: Problem with External get 'sh /bin/mrtg-disk hda2':
Expected a Number for 'out' but nothing'
ERROR: Target[hda2][_IN_] ' $target->[0]{$mode} ' did not eval into defined data
ERROR: Target[hda2][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data
Code: Select all
WorkDir: /var/www/localhost/htdocs/mrtg
Title[hda2]: /dev/hda2 Disk Usage
Target[hda2]: `sh /bin/mrtg-disk hda2`
PageTop[hda2]: <h1>/dev/hda2 Disk Usage</h1>
MaxBytes[hda2]: 10079453184
Unscaled[hda2]: dwmy
YLegend[hda2]: Bytes
LegendI[hda2]: Used
LegendO[hda2]: Free
Options[hda2]: gauge growright noinfo nobanner
ShortLegend[hda2]: Bytes
Legend1[hda2]: Used
Legend2[hda2]: Free
Code: Select all
#!/bin/bash
case "$1" in
hda2)
echo `df | grep /dev/hda2 | awk '{ print $3 }'` "* 1024" | bc
echo `df | grep /dev/hda2 | awk '{ print $4 }'` "* 1024" | bc
;;
services / #
Code: Select all
echo "esac" >> /bin/mrtg-disk