| Cheshire Cat Computing http://www.steveshipway.org/forum/ |
|
| updating .png images http://www.steveshipway.org/forum/viewtopic.php?f=11&t=1070 |
Page 1 of 1 |
| Author: | socaltenor21 [ Sat Mar 03, 2007 10:40 am ] |
| Post subject: | updating .png images |
I am designing a rough web site independent of the Routers2.cgi front end to more or less better discriminate the info that is most relevant (bandwidth utilization on ports of interest in our switches). By the way, I am running MRTG on a Win2k3 server. In the source code, to display a graph, I give the image source of the .png image in the C:\mrtg\wwwroot\graphs directory. However, when the page is refreshed after the 5 minute polling interval, the graph is not updated UNLESS I have that particular interface selected in the routers.cgi page. After looking at the directory, the .png was never updated unless I specifically selected it in the routers.cgi page. How can I ensure that all the .png images are updated every 5 minutes? |
|
| Author: | stevesh [ Mon Mar 05, 2007 1:29 pm ] |
| Post subject: | |
The graphs in the graphs directory are only created when needed by routers2, and then remain there in case another invocation requires them. So, you cannot directly link to them as there is no guarentee they will be created unless you go via routers2. You can ask routers2 to give you the image, however. Use something like IMG SRC=/cgi-bin/routers2.cgi?page=image&rtr=file.cfg&if=targetname&xgtype=d&xgstyle=n in your image tag to get the image created on demand -- see the HOWTO documentation for use of this method. By using the Bookmark button in the routers2 interface, you can find out the required options to pass to the CGI for the image you require. |
|
| Author: | socaltenor21 [ Tue Mar 06, 2007 7:55 am ] |
| Post subject: | |
Thanks Steve- I will check that out! |
|
| Author: | socaltenor21 [ Tue Mar 06, 2007 12:30 pm ] |
| Post subject: | challenge |
Thanks again for the follow up Steve. I actually tried to use this as my img src: "http:<ip>:9191/?rtr=10.10.1.1.cfg&xgtype=d&if=10.10.1.1_Fa1_0_1" No luck though- no graph appears. I read the documentation on your site to try to find an answer. I wonder if I need to be more specific on the directory? |
|
| Author: | stevesh [ Tue Mar 06, 2007 5:52 pm ] |
| Post subject: | |
You MUST add the '&page=image' to the URL (see the example above) so that it knows to hand over just the image for a IMG tag. Otherwise, it will deliver up the HTML for the top frameset. I see you are using the script as index.cgi or something similar in the root of the web server. I think this is how the Open Innovations Bundle installs it (ugly, but there you are). Usually it is better to give an explicit URL rather than making it default but thats just a convention, it should work your way. |
|
| Page 1 of 1 | All times are UTC + 12 hours [ DST ] |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|