MRTG Config Files

Request new features that might make using Gentoox better.
Post Reply
cheesyboofs
Power user
Posts: 239
Joined: Wed Jan 26, 2005 1:32 pm
Location: Luton UK
Contact:

MRTG Config Files

Post by cheesyboofs »

Done most myself, just having a bit of trouble with the free drive space ones wondered if I could pinch yours? :oops:

http://www.cheesyboofs.co.uk/mrtg-nas/
Go fully native, it's the destiny of all Mk1 XboxesImage
The needs of the many out way the needs of the few or the one ...
ShALLaX
Site Admin
Posts: 1973
Joined: Sun Aug 10, 2003 9:25 pm
Location: England
Contact:

Post by ShALLaX »

mrtg.conf:

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
/bin/mrtg-disk:

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
Last edited by ShALLaX on Tue Sep 26, 2006 12:28 pm, edited 1 time in total.
The original Xbox adaptation of Gentoo
cheesyboofs
Power user
Posts: 239
Joined: Wed Jan 26, 2005 1:32 pm
Location: Luton UK
Contact:

Post by cheesyboofs »

:wink:
Go fully native, it's the destiny of all Mk1 XboxesImage
The needs of the many out way the needs of the few or the one ...
cheesyboofs
Power user
Posts: 239
Joined: Wed Jan 26, 2005 1:32 pm
Location: Luton UK
Contact:

Post by cheesyboofs »

Wonder if you can help? I'm getting this error when I run the script.
services / # ./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
services / # cat etc/mrtg/hda2-free.cfg

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

services / # cat /bin/mrtg-disk

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 / #
Regards
Go fully native, it's the destiny of all Mk1 XboxesImage
The needs of the many out way the needs of the few or the one ...
ShALLaX
Site Admin
Posts: 1973
Joined: Sun Aug 10, 2003 9:25 pm
Location: England
Contact:

Post by ShALLaX »

Nice catch...

Code: Select all

echo "esac" >> /bin/mrtg-disk
Sorry! Original post updated.
The original Xbox adaptation of Gentoo
Post Reply