Re: Make Summary Graph Default

Steve Shipway <[email protected]>
Newsgroups gmane.network.mrtg.user
Message-ID <7294716191A1E142B80615ED2C633BCA0109F9C6@uxcn10-2.UoA.auckland.ac.nz>
Userdefined graphs have one initial underscore; automatic userdefineds (such as summary, incoming, outgoing) have two.  If you specify directives for userdefineds, then you can optionally add a leading underscore (but if you don’t, the software will do it for you).  So, either one or two should work.

 

The problem with trying to make the automatic summary the default is that it is not defined until after the config file is parsed, so adding options like this will not work (I told you this was an experimental option…).  Ordinary Targets, and userdefined targets, are defined during the parsing of the cfg file so you can add this sort of directive after the relevant Target or routers.cgi*Graph or routers.cgi*Summary line.

 

The only thing you can do is this (and it is a bit messy).

 

1.       Add ‘routers.cgi*InSummary[_]: no’ so that nothing is in the summay page, effectively removing it.

2.       Create your own summary page, by adding ‘routers.cgi*Summary[xxx]: mysummary’ on each target xxx (you can’t use the default target ‘_’ here as this is a multiple-instance directive)

3.       Make your new summary the default ‘routers.cgi*Options[mysummary]: default’

4.       Maybe set appropriate menu labels etc ‘routers.cgi*ShortDesc[mysummary]: Summary’

 

I have not yet tried this but it should work.  Probably :-l

 

Steve

 

  _____  

Steve Shipway

ITS Unix Services Design Lead

University of Auckland, New Zealand

Floor 1, 58 Symonds Street, Auckland

Phone: +64 (0)9 3737599 ext 86487

DDI: +64 (0)9 924 6487

Mobile: +64 (0)21 753 189

Email:  <mailto:[email protected]> [email protected]

P Please consider the environment before printing this e-mail 

 

 

From: [email protected] [mailto:[email protected]] 
Sent: Thursday, 19 January 2012 4:48 a.m.
To: Steve Shipway
Cc: [email protected]
Subject: RE: [mrtg] Make Summary Graph Default

 

Hey Steve, 

I tried the "__summary" but it doesn't seem to be working... Is it 2 underscores "__summary" or only one "_summary"? 

I put this line at the very end of the cfg file: 

                routers.cgi*Options[__summary]: default 

Does that look correct? And is the end of the cfg file the correct place for that directive? 

Thanks Again, 
Matt 




From:        Steve Shipway <[email protected]> 
To:        "[email protected]" <[email protected]>, "[email protected]" <[email protected]> 
Date:        01/18/2012 07:45 AM 
Subject:        RE: [mrtg] Make Summary Graph Default 

  _____  




I’m assuming you mean the Summary graphs as in the Routers2 frontend. 
  
You can use the ‘defaulttarget’ directive in the routers2.conf file, which can be set to ‘summary’ or ‘incoming’ or other values (see the routers2.conf for details in the comments).  This affects the default for ALL devices for ALL users. 
  
You can use per-user sections – [user-xxx] and place a defaulttaget rule in there for individual users, but this affects ALL targets.  You can also allow users to set their personal preferences (which overrides the defaults I nthe routers2.conf file). 
  
However, if you want to set a default for just one Device, you can add in the MRTG cfg file the line 
  
routers.cgi*Options[xxxx]: default 
  
This will make the target ‘xxxx’ the default for ALL users (overriding any defaulttarget definitions in the routers2.conf but not overriding a user’s personal preferences).  If you want to make a particular userdefined graph, or summary page, the default, then xxxx must match the name of the userdefined graph or summary page.  The autogenerated summary page is ‘__summary’ and the autogenerated incoming/outgoing are ‘__incoming’ and ‘__outgoing’. 
  
Note that this is an experimental directive that is not fully reliable; however if it works for you then all to the good. 
  
Steve 
  

 

  _____  


Steve Shipway 
ITS Unix Services Design Lead 
University of Auckland, New Zealand 
Floor 1, 58 Symonds Street, Auckland 
Phone: +64 (0)9 3737599 ext 86487 
DDI: +64 (0)9 924 6487 
Mobile: +64 (0)21 753 189 
Email:  <mailto:[email protected]> [email protected] 
P Please consider the environment before printing this e-mail 
  
  
From: [email protected] [ <mailto:[email protected]> mailto:[email protected]] On Behalf Of [email protected]
Sent: Tuesday, 17 January 2012 4:38 a.m.
To: [email protected]
Subject: [mrtg] Make Summary Graph Default 
  
Hello All, 

Is there a directive, or an option of a directive, that would make the Summary Graph be the default graph for a specific target? 

I'm pretty sure there's a way to make it the default in routers2.conf, but I don't want it to be the default for all targets, just one. 
And there is also a way to do it through the preferences page on the Web UI, but I didn't want to rely on cookies for this, and I know 
that, that would have to be set on each individual user's computer. 

Any thoughts would be great... 

Thanks in Advance, 
Matt

_______________________________________________
mrtg mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
smime.p7s (application/x-pkcs7-signature, 5.9 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.