[mrtg] Re: 14all/RRDtool graph scaling

Håkan Lindholm hakan at staff.spray.se
Wed Apr 6 22:31:23 MEST 2005


Cory wrote:
> 14all was designed to copy the mrtg graph style by accually 
> reading the mrtg config file.  As far as I know you cannot
> customize the 14all graph apart from the configurations
> allowed by the mrtg config file. 

Of course, you can always change the code.-  It is PERL, and not very hard to understand.

I have done the following patch to make it look even more like MRTG (rateup) graphs:

@@ -404,7 +404,19 @@
         } elsif (yesorno($cfg->{targets}{'14all*logarithmic'}{$log})) {
                 push @args, '-o';
         }
-        push @args,'--alt-y-mrtg','--lazy','-c','MGRID#ee0000','-c','GRID#000000';
+        push @args,'--alt-y-mrtg', '--lazy';
+        # x-grid/labels a la MRTG.
+        push @args,'-c','MGRID#ee0000','-c','GRID#a0a0a0';
+       if ($png eq 'daily') {
+           push @args,'-x','HOUR:1:DAY:1:HOUR:2:0:%H';
+       } elsif ($png eq 'weekly') {
+           push @args,'-x','DAY:1:WEEK:1:DAY:1:86400:%a';
+       } elsif ($png eq 'monthly') {
+           push @args,'-x','WEEK:1:MONTH:1:WEEK:1:604800:Week %V';
+       } elsif ($png eq 'yearly') {
+           push @args,'-x','MONTH:1:YEAR:1:MONTH:1:2419200:%b';
+       }
+
         # contributed by Henry Chen: option to stack the two values
         # set the mode of the second line from config
         my $line2 = 'LINE1:';



For other command line arguments, just push them into the args array.



Nathan wrote:
> I'm using MRTG with a RRDtool db and a 14all frontend 
> 
>   
> 
> I've got the folowing problem 
> 
>   
> 
> I'd like to edit the apearance of my graph 
> 
> (from the command line i can edit my graph practicaly unlimited) 

14all.cgi is basically using the same interface, but via the PERL module.


> but using the 14all front end i assume I've gotta define this
> information in the 14all.cgi file but I don't have a single
> clue on how to approach this

See my above example.  It is really a piece of cake after studying the script for half an hour or so.

/H


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list