[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Cheshire Cat Computing • View topic - Feedback on new symbol replacement

Cheshire Cat Computing

Software support and information
It is currently Mon Nov 10, 2025 12:14 pm

All times are UTC + 12 hours [ DST ]




Post new topic Reply to topic  [ 14 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Wed Feb 25, 2009 12:55 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
The new v2.20 from beta5 have additional symbols available for the PageTop , PageFoot etc text.

You can now use %ENV(xxx)% to include environment variable xxx, or %INCLUDE(xxxxx)% to include the contents of file xxxx, in addition to the other various things available.

Now I'm looking for feedback as to what would be of use. Here's a few suggestions:

%EXEC(xxxx)% runs the executable xxxx as the current user, and includes the output. I'd need to put in some sort of timeout to prevent hangs.

%OID(xxxx)% uses SNMP to query the device (if community string and device address are known from the parsing of the target) and insert the contents of the specified OID. This would be done in real time so it could cause a hang - there would need to be a timeout, eg 5sec, to handle this.

%GET(xxxx)% retrieves the URL xxxx and includes the returned HTML in here.

%IF(symbol="value")%
%ENDIF% to switch on and off a section depending on a test of some sort, but I'm not sure how to specify the test...

There could also be enhanced parsing of tokens to allow tokens within tokens (of more use in the INCLUDE token, I guess) although this would be difficult.

Please let me know your thoughts.

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Wed Feb 25, 2009 12:57 pm 
Offline
Gold user

Joined: Fri Mar 07, 2008 8:51 am
Posts: 125
Location: Fairbanks , AK
Hello "SIR" Steve I so announce you , This is wonderful stuff , Thank you . JimL


Top
 Profile Send private message  
 
PostPosted: Fri Feb 27, 2009 8:43 am 
Offline
Gold user

Joined: Fri Mar 07, 2008 8:51 am
Posts: 125
Location: Fairbanks , AK
in routers2.conf I entered ...

pagefoot = %EXEC(/usr/bin/cat index.html)%

and received in the browser display ...

%EXEC(/usr/bin/cat index.html)%

How does one use these items ?
Also is it possible to use the 'Symbol's as described in the books as variables in these 'Symbol replacements' ?

Tia , JimL

routers.cgi Version v2.20beta5 : © Steve Shipway 2000-2008 : http://www.steveshipway.org/software/
Current system load average: 1.50 1.23 0.75
Page took 0.9s to generate


Top
 Profile Send private message  
 
PostPosted: Fri Feb 27, 2009 11:31 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
%EXEC, %OID, %GET and %IF are not yet implemented - I'm seeking feedback as to which would be of the most use.

%ENV and %INCLUDE are implemented and should work fine.

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Fri Feb 27, 2009 12:46 pm 
Offline
Gold user

Joined: Fri Mar 07, 2008 8:51 am
Posts: 125
Location: Fairbanks , AK
Hello Steve ,

Is it possible to use the 'Symbol's as described in the books as variables in these 'Symbol replacements' ?

Tia , JimL


Top
 Profile Send private message  
 
PostPosted: Sat Feb 28, 2009 10:30 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
No, symbols cannot contain symbols like this: %ENV(%MYSYM%)% (doesnt work)

However, the CONTENT of symbols can sometimes contain symbols, particularly with the %INCLUDE% symbol, although the order of symbol processing makes it not work for most. So the %INCLUDE(xxx)% file can contain something like the symbol %LU%

First INCLUDEs are done, then the various fixed ones as in the book, then the environment variables, then the symbols created with SetSymbol[]

Steve

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Sat Feb 28, 2009 10:47 am 
Offline
Gold user

Joined: Fri Mar 07, 2008 8:51 am
Posts: 125
Location: Fairbanks , AK
Hello Steve , Having found out by trial that Yes %NaMe% variables as described in the Manual can be used . At least in the %INCLUDE()% case .
Interesting , %LU% does not seem to be in my books list of "Symbols" .

I have a few suggestions for further variables , Tho most of these if not all can be acquired by the %EXEC()% function , If and when it becomes available .

%DISCRIPT% = Description:

%GRAPHFN% = The Graphs Filename
%GRAPHSZX% = Graphs Size in 'X' direction
%GRAPHSZY% = Graphs Size in 'Y' direction

%BANDWIDTH% = Bandwidth: (ie: MaxBytes[]:)
%BANDWHARD% = Hard Maximum: (ie: AbsMax[]:)

%INTIP% = Interface IP:
%INTNUM% = Interface #

%WORKDAVGIN% = Working day Average IN
%WORKDAVGOUT% = Working day Average out

%INMAX% = In: Max
%INAVG% = In: Avg
%INLAST% = In: Last

%OUTMAX% = Out: Max
%OUTAVG% = Out: Avg
%OUTLAST% = Out: Last

Easy guess where I got all those from ;-) .


Top
 Profile Send private message  
 
PostPosted: Sat Feb 28, 2009 2:34 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
The IP address is already available as %IP%
The interface number, and maxbytes/absmax are easily added.

The graph image filename and sizes should be possible (why do you want these anyway? To get the graph image, it is better to call routers2 with the page=image option, which is possible with <IMG SRC=%ROUTERS2%?page=image&xgstyle=%STYLE%&xgtype=%TYPE%> although this doesnt have sizes)

The description should be simple - ie, the graph Title or ShortDesc.

The other numbers are not simple to do as they are only within the graph and are not normally output to the script in any way. A big change would be necessary to get these.

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
PostPosted: Thu Mar 05, 2009 7:08 am 
Offline
Gold user

Joined: Fri Mar 07, 2008 8:51 am
Posts: 125
Location: Fairbanks , AK
Hello Steve ,
For my vote %EXEC()% would provide everything , I can think of , I'd require . That said , I can also see a use for the %if()% construct .

Can you please tell me where there is completely concise list of %symbol% variables available at ? Because it seems there are more than the ones in the book available .

More on my request for further %symbol% definitions ...
Note: the Naming of these items I leave in your hands , these are just examples .
? = Poss, but diff ? , Y = Readilly easy , X = Already have , ... = ???

>... %GRAPHFN% = The Graphs Filename With "<IMG" , using ?
Would you please provide a complete example of howto acquire that information ?

>? %GRAPHSZX% = Graphs Size in 'X' direction
>? %GRAPHSZY% = Graphs Size in 'Y' direction
Just as in the legend above , Are these able to be acquired but difficult to implement ?
To answer your question I would like to be able to present the raw graphs name & sizes when presenting it to the user . Hopefully to allow easier access to these items for presentation creation . Ie: using samba on the Monitoring system , ...

>Y %BANDWIDTH% = Bandwidth: (ie: MaxBytes[]:)
>Y %BANDWHARD% = Hard Maximum: (ie: AbsMax[]:)
>Y %INTNUM% = Interface #
Actually all of these would be nice to have in order to rebuild (manually) the 'PageTop' so I match the 'sysdetails' string(s) .

> X %INTIP% = Interface IP: as %IP% <already implemented>

Thank you for your consideration of these items . JimL


Top
 Profile Send private message  
 
PostPosted: Thu Mar 05, 2009 12:57 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
Although I can give the graph filename and x/y sizes (but only for the PageFoot - since the graph has not been generated at the point that the PageTop is output), it is not a good idea because the graph filename is only temporary and should not be relied on more than 5min after creation. Remember the graph file is only updated if it is requested via the web interface. This is why you should access it via routers2.cgi?page=image instead of directly to the image filename.

I suppose I coul make %GRAPHURL% expand out to %ROUTERS2%?rtr=%DEVICE%&if=%TARGET%&xgstyle=%STYLE%&xgtype=%TYPE%&page=image which would take care of things...?

There is a complete list of symbols in the doc/MRTG_INFO file with routers2. The ones in the book are the ones supported in v2.19 ; many more have been added in v2.20beta

_________________
Steve Shipway
UNIX Systems, ITSS, University of Auckland, NZ
Woe unto them that rise up early in the morning... -- Isaiah 5:11


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ]  Go to page 1, 2  Next

All times are UTC + 12 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group