>Здравствуйте!
>Поставил из портов mrtg-2.9.22 - FreeBSD 4.6
>Получилось есть /usr/local/bin/mrtg и /usr/local/etc/mrtg/mrtg.cfg.sample
>Сделал /usr/local/etc/mrtg/mrtg.cfg следующий:
>WorkDir: /usr/local/apache/htdocs/stats
>Target[df]: '/usr/diskuse'
>PageTop[df]: <H1>df Statistics:</h1>
>Options[df]: growright, absolute, gauge
>MaxBytes[df]: 14944862
>Title[df]: df usage
>
>Скрипт /usr/diskuse
>#!/bin/sh
>df|tail -2|awk '{print $4}'
>echo 0
>echo 0
>echo
>
>При запуске mrtg выдаёт:
>ERROR: Target[df][_IN_] ''/usr/diskuse'' evaluated to '/usr/diskuse' instead of a number
>ERROR: Target[df][_OUT_] ''/usr/diskuse'' evaluated to '/usr/diskuse' instead of a number
>WARNING: Skipping Update of df, inlast is not defined
>WARNING: Skipping Update of df, outlast is not defined
>
>В чём дело?
с www.mrtg.org:
...
Example:
Target[ezwf]: `/usr/local/bin/df2mrtg /dev/dsk/c0t2d0s0`
Note the use of the backticks (`), not apostrophes (') around the command.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you want to use a backtick in the command name this can be done but you must escape it with a backslash ...
....
скорее всего дело в этом - он же тебе говорит, что получает "/usr/diskuse" вместо ожидемого числа.
еще с www.mrtg.org:
...
External Monitoring Scripts
if you want to monitor something which does not provide data via snmp you can use some external program to do the data gathering.
The external command must return 4 lines of output:
Line 1
current state of the first variable, normally 'incoming bytes count'
Line 2
current state of the second variable, normally 'outgoing bytes count'
Line 3
string (in any human readable format), telling the uptime of the target.
Line 4
string, telling the name of the target.
...
а у тебя скрипт возвращает 5-ть значений. может mrtg на последнюю пустую строку и наплюет, но лучше все-таки ее убрать.