[mrtg] script question..(quite long)..

Marc-Adrian Napoli marcadrian at cia.com.au
Wed Dec 8 00:54:50 MET 1999


Hi all,

I have the following in machines.cfg in my /mrtg-2.5.2 directory:

Target[hda2]: `/bin/df -k | /usr/bin/awk '/\/dev\/hda2/ {print $3 "\n"
$3"\n0\n" $1}'`
Title[hda2]: Disk usage for hda2 - mounted on /
Options[hda2]: gauge
MaxBytes[hda2]: 2919968
PageTop[hda2]: <H1>Disk usage for hda2 - mounted on / </h1>

Target[sda1]: `/bin/df -k | /usr/bin/awk '/\/dev\/sda1/ {print $3 "\n"
$3"\n0\n" $1}'`
Title[sda1]: Disk usage for sda1 - mounted on /var/qmail
Options[sda1]: gauge
MaxBytes[sda1]: 1018298
PageTop[sda1]: <H1>Disk usage for sda1 - mounted on /var/qmail </h1>

Target[sda2]: `/bin/df -k | /usr/bin/awk '/\/dev\/sda2/ {print $3 "\n"
$3"\n0\n" $1}'`
Title[sda2]: Disk usage for sda2 - mounted on /mail
Options[sda2]: gauge
MaxBytes[sda2]: 3292627
PageTop[sda2]: <H1>Disk usage for sda2 - mounted on /mail </h1>

Target[hdc1]: `/bin/df -k | /usr/bin/awk '/\/dev\/hdc1/ {print $3 "\n"
$3"\n0\n" $1}'`
Title[hdc1]: Disk usage for hdc1 - mounted on /x2
Options[hdc1]: gauge
MaxBytes[hdc1]: 9636572
PageTop[hdc1]: <H1>Disk usage for hdc1 - mounted on /x2 </h1>

All the drives that are specified do exist. However, when i run mrtg i get
the following:

# /mrtg-2.5.2/mrtg /mrtg-2.5.2/machines.cfg
Scalar found where operator expected at (eval 283) line 1, at end of line
        (Missing operator before ?)
String found where operator expected at (eval 283) line 1, near "$3"\n0\n""
        (Missing operator before "\n0\n"?)
Scalar found where operator expected at (eval 283) line 1, at end of line
        (Missing operator before ?)
Scalar found where operator expected at (eval 284) line 1, at end of line
        (Missing operator before ?)
String found where operator expected at (eval 284) line 1, near "$3"\n0\n""
        (Missing operator before "\n0\n"?)
Scalar found where operator expected at (eval 284) line 1, at end of line
        (Missing operator before ?)
* Problem with '`/bin/df -k | /usr/bin/awk '/\/dev\/hda2/ {print $3 "\n"
$3"\n0\n" $1}'`':
  syntax error at (eval 284) line 1, near ""\n" $3"

Any idea why? This works on a friend's machine (hi rod!) perfectly fine.

Regards,

Marc-Adrian Napoli
Connect Infobahn Australia
+61 2 92811750

--
* To unsubscribe from the mrtg mailing list, send a message with the
  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg


More information about the mrtg mailing list