[mrtg] Re: ANNOUNCE: mrtg-2.8.3 (custom feature patch: Interface Up/Down indicator)

Leif Sawyer lsawyer at gci.com
Thu Jul 22 17:37:08 MEST 1999


I'd like to submit some patches that I came up with for the group.

These patches (for 2.8.3)  add a new option:  bgerroc

This option when set, will change the background color of the GIF
to red, so that it is easily identified as DOWN.

This is definately a hack, and could probably be coded better, but it
does work at my site.  It has been called 'the best thing to happen to mrtg'
around here. :-)

Some caveats with it currently:

   * It logs all data.  If a poll fails, it's logged as -1 for the current
time
     and 1 for the historical time.  This is a function of rateups
conversion.
     However, this hack uses the current_time data == -1  in order to
determine
     if the interface is down or not.  The place to fix this is about line
182 in
     the patched version of mrtg, by adding a statement to the effect that
if
     the option: bgerrorc isn't set, we just 'next'.

   * All your graphs (for the down interface) turn red. Until rateup
rebuilds the
     gif files for each historical point, your weekly, monthly, and yearly
graphs
     stay red.  This may also be considered a feature, as you can tell if
you've
     had some historical downtime within the 're-graph' period.

   * Transparant gifs no longer work.  I didn't code up anything to keep you
from
     selecting transparant gifs and a new background gif color at the same
time.
     This can easily be fixed, or just manually avoided.

   * A lot of work to implement globally:  Not really.  At line 1091 of the
patched
     mrtg, simply comment out the if conditional thusly:

       #   if ($$rcfg{'options'}{'bgerrorc'}{$router}) {
         push (@exec, "-f");
       #   }
     now you don't have to worry about the option: bgerrorc in every config
file for
     every target.

There's probably more, but I didn't see any errors when i compiled.  :-)

This is hereby public domain.  Do what you like with it.  If you really
like it, you can code in a feature for me:  add the update time to the
generated GIF, so that it can easily be determined from the graph what
point in time the ^  is at.

--
Leif Sawyer   --  Pi at 4398680
leif at gci.net  ||  lsawyer at gci.com  ||  internic: LS2540 
(907) 868 - 0116   ||  ICQ - 3749190  || http://home.gci.net/~leif
Internet Systems Engineer -- General Communications Inc.
PGP Fingerprint: 77 C8 34 B8 FD BC C6 32  5F FE 93 4B AE 6C F7 4E


-------------- next part --------------
A non-text attachment was scrubbed...
Name: rateup-2.8.3.las.diff
Type: application/octet-stream
Size: 1761 bytes
Desc: not available
Url : https://lists.oetiker.ch/pipermail/mrtg/attachments/19990722/33917c83/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mrtg-2.8.3.las.diff
Type: application/octet-stream
Size: 1822 bytes
Desc: not available
Url : https://lists.oetiker.ch/pipermail/mrtg/attachments/19990722/33917c83/attachment-0001.obj 


More information about the mrtg mailing list