[mrtg] Re: Why not work?

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Tue Sep 14 13:35:55 MEST 1999


> 
> I'm attaching a copy of my config, as well as a print of the top 10
> lines or so of my log file.
> Here is my setup:
> 
> OpenBSD 2.5,MRTG 2.8.8
> 
> ======mrtg.cfg=====
> WorkDir: /home/mrtg
> Target[aaa]: '/usr/local/mrtg/dial_up'

*WRONG* Use backticks ` not normal ticks '

> MaxBytes[aaa]: 30

*CHECK* if 30 is the maximum, not 3*30 (as it would be for instance
        in case of one PRI per access server)

> Title[aaa]: Stat
> PageTop[aaa]: <H1>Analis Dial-up user work</H1>
> ..

*MISSING*  Option[aaa]: gauge

> ===end===
> 
> =====dial_up=====
> finger @aa1 | grep Async > dial_up.s
> finger @aa2 | grep Async >> dial_up.s
> finger @aa3 | grep Async >> dial_up.s
> more dial_up.s | awk -f /usr/local/mrtg/cacl.awk

*WRONG*  more is not the right tool.
         rewrite the script. It could be, for instance:

         (finger @aa1;finger @aa2;finger @aa3) | grep Async \
                                       | awk -f /usr/local/mrtg/cacl.awk

> ===end===
> ===cacl.awk===
> BEGIN {prefix="Async"}
> {sum+=1}
> END { print  sum
>       print  0
>       print  0
>       print  "aaa"}
> ===end===

The script is somewhat redundant I would say. What about:
(finger @aa1;finger @aa2;finger @aa3)|grep Async|wc -l;echo 0;echo 0;echo aaa

Also: add some error checking, for instance check the return codes.

> 
> {dial_up} - return
> 
> 15
> 0
> 0
> aaa
> 
> 
> but ...
> ===aaa.log===
> 937305121 0 0

My guess: the script isn't executed at all from mrtg (no backtics) and if it
would be, you would still be missing gauge.


Regards,
Alex

--
* 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