[mrtg] blanc graphs with external values

Alvaro Cornejo cornejo.alvaro at gmail.com
Fri Dec 7 22:38:49 CET 2007


Hi

I'm starting using mrtg and have a php script that feeds some values
to mrtg in order to graph them. however I do get an empty graph. ie
only the grid and labels are shown. For other targets I have I use
mrtg-ping-probe and I they work ok.

my script feeds 3 values to mrtg as:

[root at test-tts]/usr/local/mrtg-2/scripts# ./getsmsc_stat.php srv1 txrx
96
96
1074
[root at test-tts]/usr/local/mrtg-2/scripts#

Within my mrtg.cfg, I call mrtg with:

Target[srv1.txrx]: `/usr/local/mrtg-2/scripts/getsmsc_stat.php srv1 txrx`
Target[telcel1.txrx]: `/usr/local/mrtg-2/scripts/getsmsc_stat.php telcel1 txrx`

Here are some info from mrtg debug:

...
2007-12-07 15:35:05 -- --tarp: Starting srv1.txrx ->
`/var/www/html/sms/plugin/gateway/kannel/getsmsc_stat.php srv1 txrx`
2007-12-07 15:35:05 -- --tarp: New program target [2]
'/var/www/html/sms/plugin/gateway/kannel/getsmsc_stat.php srv1 txrx'
2007-12-07 15:35:05 -- --tarp: &targparser external done: '
$target->[2]{$mode} '
2007-12-07 15:35:05 -- --tarp: &targparser complex done: ' $target->[2]{$mode} '
2007-12-07 15:35:05 -- --tarp: &targparser simple done: ' $target->[2]{$mode} '
2007-12-07 15:35:05 -- --tarp: &targparser returning: unique = 2
...
2007-12-07 15:30:22 -- --snpo: run external
/var/www/html/sms/plugin/gateway/kannel/getsmsc_stat.php srv1 txrx
2007-12-07 15:30:25 -- --snpo: External result:167 out:169 uptime:1885 name:srv1
2007-12-07 15:30:25 -- --snpo: run external perl
/usr/local/mrtg-2/scripts/mrtg-ping-probe 200.76.98.228
2007-12-07 15:30:34 -- --snpo: External result:31 out:25
uptime:unknown name:unknown
...
2007-12-07 15:30:44 -- --base: Act on Router/Target srv1.txrx
2007-12-07 15:30:44 -- --base: Get Current values: in:167, out:169,
up:1885, name:srv1, time:1197063025
2007-12-07 15:30:44 -- --base: Create Graphics
2007-12-07 15:30:44 -- --log: /usr/local/mrtg-2/bin/rateup
/var/www/html/mrtg/ srv1.txrx 1197063025 -Z u 167 169 10000 c #00cc00
#0000ff #006600 #ff00ff l [Srv 1 TX y RX] k 1000 i
/var/www/html/mrtg/srv1.txrx-day.png -10000 -10000 400 100 1 1 1 300 0
4 1 %Y-%m-%d %H:%M 0
2007-12-07 15:30:44 -- --base: Check for Thresholds
2007-12-07 15:30:44 -- --base: Check for Write HTML Pages
...
2007-12-07 15:30:44 -- --base: Exit main Loop
2007-12-07 15:30:44 -- --base: Remove Lock Files
2007-12-07 15:30:44 -- --base: Store Interface Config Cache



and the log file only updates the first line:

1197061523 30 30     <-- 1st line of log file
1197061523 0 0 0 0
1197061463 0 0 0 0
1197061200 0 0 0 0
...

1197061821 60 60     <-- 1st line of log file after some time
1197061821 0 0 0 0
1197061523 0 0 0 0
1197061500 0 0 0 0
...
1197062435 117 119     <-- again 1st line of log file after some time
1197062435 0 0 0 0
1197062157 0 0 0 0
1197062100 0 0 0 0

This is from the logfile of a mrtg-ping-probe that works ok
1197062444 36 26
1197062444 36 26 36 26
1197062169 33 25 33 25
1197062100 32 25 33 25
1197061800 30 25 31 25
1197061500 38 25 95 26
1197061200 85 26 95 26
1197060900 30 25 35 26
1197060600 35 25 36 26
1197060300 26 21 36 26
1197060000 0 0 0 0
1197059700 0 0 0 0

-- 
|-----------------------------------------------------------------------------------------------------------------|
Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde cualquier celular y
Nextel en México y en mas de 180 paises. Use aplicaciones 2 vias via
SMS y GPRS online
              Visitenos en www.smsglobal.com.mx y www.pravcom.com



More information about the mrtg mailing list