[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 - using routers2.cgi to generate PNG graphs

Cheshire Cat Computing

Software support and information
It is currently Wed Nov 12, 2025 8:50 pm

All times are UTC + 12 hours [ DST ]




Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Tue Jan 09, 2007 10:29 am 
Offline
User

Joined: Tue Jan 09, 2007 10:24 am
Posts: 3
I have routers 2.17 running fine on apache, and I have several sites I am monitoring, however I want to manually update the PNG files on disk without having to navigate to each site i have setup on the routers2.cgi site.

I've been playing with routers2.cgi -A -D Firewalls/site.cfg -t d, it seems to generate some graphs but they don't have anything in them?

the RRD files are all updated, how do I create a graph from the RRD files.

I want to do this because I am building a script that emails these PNG files out to clients.

Thanks!


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Wed Jan 10, 2007 9:34 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
The -A flag will generate an archived graph (possibly what you want) in the graphs/<cfgfilename>/<targetname> directory. This is then retrievable from within routers2 on the corresponding Archive menu that appears for this target. However, if you use this, then you should also specify the -T option to give the target for which to create the graph. The -A option to the script is the same as clicking on the 'Archive' button from within routers2 (this only appears if you have archive=yes in the routers2.conf, see the documentation HOWTO for more details).

An alternative way to do it is to run the script in image mode. For this, use '-I' instead of '-A'. This will output either an error message, or a .png file.

routers2.pl -I -D cfgfile.cfg -T targetname > graph.png

_________________
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  
 
 Post subject:
PostPosted: Thu Jan 11, 2007 2:46 am 
Offline
User

Joined: Tue Jan 09, 2007 10:24 am
Posts: 3
I am using: /usr/lib/cgi-bin/routers2.cgi -I -D mvg.cfg -T Incoming > incoming.png

I get this error:

Interface: none
Error: Not defined


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Thu Jan 11, 2007 3:01 am 
Offline
User

Joined: Tue Jan 09, 2007 10:24 am
Posts: 3
I figured it out.

I wasn't specifiying the -T or the -D parameter properly. I had to use Firewalls/mvg.cfg since I had it in a subdirectory and -I <ipoftarget>


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Thu Jan 11, 2007 9:16 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
The -T and -D parameters correspond to the Target and Device -- to find out what to use, look for the if= and rtr= parameters in the URL when you click the 'Bookmark' button.

If you use subdirectories, then these need to be included for the -D parameter (use the full path of the .cfg file, minus the confpath).

The -T parameter is the MRTG targetname, IE, the 'ezwf' in the line 'Target[ezwf]: 1:community@device'. If your target is a userdefined graph, you will need to prepend '_' to the userdefined name. The special targets, such as the Incoming and Outgoing graphs, are '__incoming' and '__outgoing' (note the DOUBLE underscore).

_________________
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  
 
 Post subject:
PostPosted: Thu Mar 15, 2007 9:32 am 
Offline
User

Joined: Tue Sep 06, 2005 2:33 am
Posts: 9
Location: Surprise, AZ
I'm having problems with this right now. This url works to display the image only on a web page:

http://xxxxxxxx/cgi-bin/routers2.cgi?rt ... page=image

But running this generates a blank file:

./routers2.cgi -I -D configs/ADA/Ada_DNS.cfg -T ADA_DNS > test.png

Running v2.17 on FC4


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Thu Mar 15, 2007 11:27 am 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
This looks like a bug.

It appears to work correctly the FIRST time, but subsequently this 'Interface: none' error appears. I'll try and get an update release out once this is fixed.

_________________
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  
 
 Post subject:
PostPosted: Thu Mar 15, 2007 2:15 pm 
Offline
User

Joined: Tue Sep 06, 2005 2:33 am
Posts: 9
Location: Surprise, AZ
Thanks for the quick response Steve!

I don't get an error at all however and just end up with an empty file.


Top
 Profile Send private message  
 
 Post subject:
PostPosted: Thu Mar 15, 2007 2:49 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
Seems to work fine under 2.18beta2 althoughI get problems in 2.17a. Even though there should be no difference in this area.

An empty file means that routers2 has found a problem and is unable to generate the image, but cannot output any more info! This should not happen... I can't see any way for it to occur unless the generated graph is empty due to an RRDTool error. Make sure you are running as the same user that the web service runs as, else there may be a permissions issue in creating the graph file (when run from the command line, it creates the file in the cache the same way that the web frontend does)

I've tracked down my other problem, incidentally, to the fact that I also needed to add the -U option to specify authenticated user (the default user did not have visibility of the device in question). So, if you use authentication and per-user cfgfiles directives, you will need to use -U username to establish the rights. Note that this is only valid when called from the command line!

_________________
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  
 
 Post subject:
PostPosted: Thu Mar 15, 2007 2:58 pm 
Offline
Site Admin

Joined: Tue Jul 29, 2003 11:42 am
Posts: 3039
Location: Auckland, New Zealand
Checked the code.

What can happen is that, if RRDTool is unable to create the graph image file, it returns *without* an error status but does not create the file. This means that routers2 will output a null file when used with -I. I have fixed this in v2.18 although I think it is a bug in RRRDTool (it should return an error status in this case!).

So, it appears that, if you are getting an empty file, it means that your current user is (for some reason) unable to write to the graphs directory (where routers2 puts all generated graph images for caching. This applies to both cgi and command line mode. Check that you are running as the web server user or as root (and if as root, then make sure you dont leave files in the graphs dir owned by root!)

_________________
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  [ 12 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