There is written in the documentation that MRTG can write graphics based on output from external scripts instead of SNMP. 4 lines are needed as output:
Code:
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.
So I made the following script (/root/mrtg-test) and chmoded it +x:
Code:
echo 3027162
echo 0
uptime
echo 193.bla.bla.bla
It returns 4 lines of output, but nothing is drawn on the graphs after running mrtg on that config:
Code:
WorkDir: /var/www/htdocs/mrtg-test
options[_]: growright
Title[test]: Am testovo nekvo takova
Target[test]: `/root/mrtg-test`
MaxBytes[test]: 1250000000
PageTop[test]: <H2>Bla?</H2>
Max In: 0.0 B/s (0.0%) Average In: 0.0 B/s (0.0%) Current In: 0.0 B/s (0.0%)
Max Out: 0.0 B/s (0.0%) Average Out: 0.0 B/s (0.0%) Current Out: 0.0 B/s (0.0%)
IMHO, there should be 3027162 current value, but it is 0. Does anyone have an idea?