[mrtg] Re: Week numbering

Håkan Lindholm hakan at spray.se
Fri Jan 11 21:46:51 MET 2002



tobi wrote:
> you can specify the weeknumbering notation to be used ... check
> 
>      %U    Week number of year as a decimal number [00,53],  with
>            Sunday as the first day of week 1.
> 
>      %V    The ISO 8601 week number as a decimal number  [01,53].
>            In  the  ISO  8601 week-based system, weeks begin on a
>            Monday and week  1  of  the  year  is  the  week  that
>            includes  both  January  4th and the first Thursday of
>            the year.  If the first Monday of January is the  2nd,
>            3rd,  or  4th, the preceding days are part of the last
>            week of the preceding year.  See NOTES below.
> 
> this depends on your OS strftime implementation though ...
> 
> check the reference.html

http://iserv.nl/traffic/mrtg-conf.html#Weekformat states that the weekformat
option is used by rateup.

With my slightly modificated 14all.cgi, I can change it in following code
section.

push @args,'-c','MGRID#ee0000','-c','GRID#999999';
if ($q->param('png') eq 'daily') {
    push @args,'-x','HOUR:1:DAY:1:HOUR:2:0:%H';
} elsif ($q->param('png') eq 'weekly') {
    push @args,'-x','DAY:1:WEEK:1:DAY:1:86400:%a';
} elsif ($q->param('png') eq 'monthly') {
    push @args,'-x','WEEK:1:MONTH:1:WEEK:1:604800:Week %V';
#                                                 ^^^^^^^
} elsif ($q->param('png') eq 'yearly') {
    push @args,'-x','MONTH:1:YEAR:1:MONTH:1:2419200:%b';
}

By default, "-x" are set to the magic "none" I think. Then it is up to
rrdtool to specify the type of labeling. The above labeling are just the
same as with rateup. Wonder why rrdtool has a different default...

/H

-- 
                Senior Network Engineer  @  SPRAY NETWORK SERVICES AB
         System, Network and Security Architecture and Administration
                  for Lycos Europe (http://pressroom.lycos.de/de_en/)
*  C a t O S  *  I O S  *  U n * x  *  W e b O S  *  W i n d o w s  *

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