PHP Network Weathermap 0.8 (now 0.9)

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
User avatar
Alice
Cacti User
Posts: 111
Joined: Tue Oct 28, 2003 4:54 pm
Location: Bucharest, RO.

Post by Alice »

Howie wrote:
Alice wrote: I'm sorry, but I suck @ php and it would take too long to make it myself.
Since it's a pretty specific thing, I'd suggest an alternative approach: make an image in an image-processing program, like Paint or Photoshop of the key as you'd like to see it, then place a NODE on your map, with that image as it's icon.
Yeah, that may work :)
Howie wrote:
Alice wrote: Also, I didn't read all the thread (i'll read it today I hope), and I don't know how you draw the links. How about some anti-aliasing? :)
The GD library only has anti-aliasing for wireframe lines (not filled polygons), but it's possible, if I figure out how to do it all myself. It would be nice, but it won't be in the next release.
No shit? :)
It's damn simple (just found it in about 2 minutes of google):

Weathermap.class.php
around line 414:

Code: Select all

                if (!is_null($fillcolours[$arrayindex]))

                    {
add this line:===>>>     imageantialias($image, TRUE);

                        imagefilledpolygon($image, $there_points, count($there_points) / 2, $fillcolours[$arrayindex]); }
It looks WAY better.
Also a much nicer display when using
'outlinecolour' => array(100, 100, 100),
instead of
'outlinecolour' => array(0, 0, 0),

Now... some problems:

1.

I have the web server running on 10.0.0.10, port 80. Let's call it stats2.mydomain.com
on 194.194.194.194 (another machine - let's call it stats1.mydomain.com) i have a redirect: 194.194.194.194:8888 => 10.0.0.10:80.

almost everything works ok, but when i put my mouse on a 'link', instead of searching the graph @ http://194.194.194:8888/grap.php?... it searches @ http://10.0.0.10/graph.php?...
Maybe I'll look @ it when I have time..

2.
A generated map, viewed from cacti.
Hoover a link - the graph is displayed @ mouse position. all ok.
Click on a blank spot on the image. When I hoover a link again, instead of showing the graph @ mouse position, it opens a new page with that graph.

3.
Question actually :D
Is there a link somewhere in cacti for the editor? because I allways type the address manually :p (http://host/plugins/weathermap/editor.php)

4
VIA points:
simple approach (at least I think):
a button like 'add link': instead of clicking on first and second host, you click on the link and the second click would be the VIA point (add a new one). If it can be coded in 4-5 copy/paste & 2-3 lines, maybe you (or someone else) can do it as a patch, before 0.9. I tried but I didn't succeded.

Also a list with via points (when clicking on a link) and the option to delete one or all of them would be nice.
[url=http://www.x-graphs.com/]http://www.x-graphs.com[/url] [color=red]X[/color]-[color=blue]graphs[/color] :: All kind of graphs
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Alice wrote: No shit? :)
It's damn simple (just found it in about 2 minutes of google):

Weathermap.class.php
around line 414:

Code: Select all

                if (!is_null($fillcolours[$arrayindex]))

                    {
add this line:===>>>     imageantialias($image, TRUE);

                        imagefilledpolygon($image, $there_points, count($there_points) / 2, $fillcolours[$arrayindex]); }
It looks WAY better.
That's wierd. The manual says: "Activate the fast drawing antialiased methods for lines and wired polygons.". Mind you, it also says it only works with the built-in GD library, so maybe it's still not a solution. I'll have a play.
Alice wrote: Now... some problems:

1.

I have the web server running on 10.0.0.10, port 80. Let's call it stats2.mydomain.com
on 194.194.194.194 (another machine - let's call it stats1.mydomain.com) i have a redirect: 194.194.194.194:8888 => 10.0.0.10:80.

almost everything works ok, but when i put my mouse on a 'link', instead of searching the graph @ http://194.194.194:8888/grap.php?... it searches @ http://10.0.0.10/graph.php?...
Maybe I'll look @ it when I have time..
Change the OVERLIBGRAPH to be correct then. The editor gets the URI for Cacti from editor-config.php, so if that's correct this shouldn't be a problem.
Alice wrote: 2.
A generated map, viewed from cacti.
Hoover a link - the graph is displayed @ mouse position. all ok.
Click on a blank spot on the image. When I hoover a link again, instead of showing the graph @ mouse position, it opens a new page with that graph.
I don't get this (just checking with Safari on my Powerbook). What browser and what platform is this on?
Alice wrote: 3.
Question actually :D
Is there a link somewhere in cacti for the editor? because I allways type the address manually :p (http://host/plugins/weathermap/editor.php)
No. Part of my plan for rewriting the editor in 0.9 (we'll see if it happens), is to make the editor sit nicely inside Cacti. The way auth and input validation works inside cacti makes it not as simple as just adding the link, from memory (I did have a link in my test 0.8 version for a while, and it broke something).
Alice wrote: 4
VIA points:
simple approach (at least I think):
a button like 'add link': instead of clicking on first and second host, you click on the link and the second click would be the VIA point (add a new one). If it can be coded in 4-5 copy/paste & 2-3 lines, maybe you (or someone else) can do it as a patch, before 0.9. I tried but I didn't succeded.

Also a list with via points (when clicking on a link) and the option to delete one or all of them would be nice.
I'm not touching the editor at all until I've finished adding 0.9's features. It's just wasted time, and I don't have that much to spend on it in the first place. Anyone else is welcome to, obviously. The changes for 0.8 may well not work with 0.9's editor. My plan is to have via points visible and clickable/draggable in the editor though, with an add mechanism roughly like you describe.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
Alice
Cacti User
Posts: 111
Joined: Tue Oct 28, 2003 4:54 pm
Location: Bucharest, RO.

Post by Alice »

about anti-aliasing: it's a solution for me :). tell me if you need more info about my system

1. if I edit the map configs it's ok
editor-config.php: $config['base_url']='http://stats.mydomain.com:8888/';
I have to play. tomorrow.

2. SORRY. It's a browser problem (maxthon - internet explorer addon, ie7 beta2, win 2k3 AS x86). with ie7 and firefox it's ok.

3/4 ok.
[url=http://www.x-graphs.com/]http://www.x-graphs.com[/url] [color=red]X[/color]-[color=blue]graphs[/color] :: All kind of graphs
User avatar
adrianmarsh
Cacti User
Posts: 437
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

Post by adrianmarsh »

Alice,

What effect does the anti-aliasing do for you? Can you post a before/after example ?
User avatar
Alice
Cacti User
Posts: 111
Joined: Tue Oct 28, 2003 4:54 pm
Location: Bucharest, RO.

Post by Alice »

sure.
Also a much nicer display when using
'outlinecolour' => array(100, 100, 100),
instead of
'outlinecolour' => array(0, 0, 0),
It's 100,100,100 in both graphs. with 0,0,0, un-anti-aliased it looks even worse.


*slackware-current, stock, both 32bit & 64bit version (slamd64)
Attachments
weathermap_2_aa.png
weathermap_2_aa.png (101.6 KiB) Viewed 6158 times
weathermap_2_noaa.png
weathermap_2_noaa.png (67.74 KiB) Viewed 6158 times
[url=http://www.x-graphs.com/]http://www.x-graphs.com[/url] [color=red]X[/color]-[color=blue]graphs[/color] :: All kind of graphs
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Alice wrote:sure.
Also a much nicer display when using
'outlinecolour' => array(100, 100, 100),
instead of
'outlinecolour' => array(0, 0, 0),
It's 100,100,100 in both graphs. with 0,0,0, un-anti-aliased it looks even worse.
I had a quick try this morning, and it doesn't work so well with my setup. I didn't experiment too much, but on several of my maps I use
'OUTLINECOLOR none', which means you get no anti-aliasing (it is only the outline that is AAed). It also goes a bit nasty against dark backgrounds (I use the gradient background from the example map for a few of mine) - the blending is pretty visible. For the white BG maps, it does look smoother though.

From that, I think that when the outlinecolor is none, it should really just draw the outline in the same colour as the link, instead of nothing at all. I was already thinking about an 'outlinecolor contrast' option, to choose whichever of black and white is better contrasting, so maybe it'll go in then.

Not sure about the visible blending problem.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
tman
Cacti User
Posts: 97
Joined: Thu Oct 14, 2004 4:14 pm

Post by tman »

I'm using the latest weathermap 0.82, and am having problems getting background images to be recognised.

Basically, Weathermap runs as a Cacti plugin, and the map I've created displays fine. The map has a resolution of 1024x768 which I originally defined with the WIDTH and HEIGHT commands.

I then created a 1024x768 PNG file as the background, and put it in the same folder as the conf file I created. I then added BACKGROUND <filename>.png to the conf file (the WIDTH and HEIGHT commands were automatically removed), but when I view the map in Cacti, the background is ignored, and the map is truncated to 800x600, thus losing some map data.

Can't imagine what's going wrong. Any ideas?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

tman wrote:I'm using the latest weathermap 0.82, and am having problems getting background images to be recognised.

Basically, Weathermap runs as a Cacti plugin, and the map I've created displays fine. The map has a resolution of 1024x768 which I originally defined with the WIDTH and HEIGHT commands.

I then created a 1024x768 PNG file as the background, and put it in the same folder as the conf file I created. I then added BACKGROUND <filename>.png to the conf file (the WIDTH and HEIGHT commands were automatically removed), but when I view the map in Cacti, the background is ignored, and the map is truncated to 800x600, thus losing some map data.

Can't imagine what's going wrong. Any ideas?
Check your Cacti log. I would guess that it just can't find the file. If you just put filename.png then your background image should be in the weathermap directory, not the images directory.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
tman
Cacti User
Posts: 97
Joined: Thu Oct 14, 2004 4:14 pm

Post by tman »

tman wrote:I'm using the latest weathermap 0.82, and am having problems getting background images to be recognised.

Basically, Weathermap runs as a Cacti plugin, and the map I've created displays fine. The map has a resolution of 1024x768 which I originally defined with the WIDTH and HEIGHT commands.

I then created a 1024x768 PNG file as the background, and put it in the same folder as the conf file I created. I then added BACKGROUND <filename>.png to the conf file (the WIDTH and HEIGHT commands were automatically removed), but when I view the map in Cacti, the background is ignored, and the map is truncated to 800x600, thus losing some map data.

Can't imagine what's going wrong. Any ideas?
Ok, sorted this now. Moved the background image to the root weathermap folder (not the configs folder)
jmadrid2
Posts: 43
Joined: Thu May 04, 2006 9:32 am
Location: Bayonne, NJ

Post by jmadrid2 »

The weathermap is working for me and is being updated via cacti. The problem is that none of the thumbnails are being shown via the Weathermap tab even though they are being created. Also the HTMLOUTPUTFILe and OUTPUTFILE directive are not being followed.

From my logs:
06/21/2006 06:31:48 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update weathermap_maps set sortorder=id where sortorder is null;"
06/21/2006 06:31:48 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update weathermap_maps set sortorder=id where sortorder is null or sortorder=0;"
06/21/2006 06:31:48 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select * from weathermap_maps where active='on'"
06/21/2006 06:31:48 PM - WEATHERMAP: Poller[0] Map: /opt/cacti/plugins/weathermap/configs/network.conf -> /opt/cacti/plugins/weathermap/output/weathermap_2.html & /opt/cacti/plugins/weathermap/output/weathermap_2.png
06/21/2006 06:31:48 PM - WEATHERMAP: Poller[0] Wrote map to /opt/cacti/plugins/weathermap/output/weathermap_2.png and /opt/cacti/plugins/weathermap/output/weathermap_thumb_2.png
06/21/2006 06:31:48 PM - WEATHERMAP: Poller[0] Wrote HTML to /opt/cacti/plugins/weathermap/output/weathermap_2.html
06/21/2006 06:31:48 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update weathermap_maps set titlecache='Core Network' where id=2"
06/21/2006 06:31:48 PM - WEATHERMAP: Poller[0] Map: /opt/cacti/plugins/weathermap/configs/atlantacolo.conf -> /opt/cacti/plugins/weathermap/output/weathermap_4.html & /opt/cacti/plugins/weathermap/output/weathermap_4.png
06/21/2006 06:31:48 PM - WEATHERMAP: Poller[0] Wrote map to /opt/cacti/plugins/weathermap/output/weathermap_4.png and /opt/cacti/plugins/weathermap/output/weathermap_thumb_4.png
06/21/2006 06:31:48 PM - WEATHERMAP: Poller[0] Wrote HTML to /opt/cacti/plugins/weathermap/output/weathermap_4.html
06/21/2006 06:31:48 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update weathermap_maps set titlecache='Atlanta Colo' where id=4"

In my atlantacolo.conf I have the following directives:
IMAGEOUTPUTFILE output/atlantacolo.png
HTMLOUTPUTFILE output/atlantacolo.html

Any ideas?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

jmadrid2 wrote:The weathermap is working for me and is being updated via cacti. The problem is that none of the thumbnails are being shown via the Weathermap tab even though they are being created. Also the HTMLOUTPUTFILe and OUTPUTFILE directive are not being followed.

Any ideas?
The Cacti plugin ignores the HTMLOUTPUTFILE and IMAGEOUTPUTFILE directives. The output files will always be named for the map ID in the database. That should be documented, sorry.

I don't know why you can't see the thumbnails though. Just to be sure you should be seeing thumb_1.png (or whatever your map ID is) in the output folder, and it should be non-zero size and with the same permissions as the regular-sized map... do you get the 'not created yet' text? or just nothing?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
jmadrid2
Posts: 43
Joined: Thu May 04, 2006 9:32 am
Location: Bayonne, NJ

Post by jmadrid2 »

I get the "You Have No Maps" error. Here is an ls from my output dir. If I goto cacti/plugins/weathermap/output I can see all of the thumbnails and even the maps that are being updated.

$ ls -al output/
total 164
drwxr-xr-x 2 apache noc 4096 Jun 21 19:16 .
drwxr-xr-x 8 jmadrid monitoring 4096 Jun 21 16:34 ..
-rw-r--r-- 1 root root 6385 Jun 21 16:41 atlantacolo.html
-rw-r--r-- 1 root root 20241 Jun 21 16:41 atlantacolo.png
-rw-r--r-- 1 root root 0 Jun 20 18:09 eathermap_4.html
-rw-r--r-- 1 apache noc 5721 Jun 21 19:16 weathermap_2.html
-rw-r--r-- 1 apache noc 16265 Jun 21 19:16 weathermap_2.png
-rw-r--r-- 1 apache noc 5721 Jun 21 16:31 weathermap_3.html
-rw-r--r-- 1 apache noc 16195 Jun 21 16:31 weathermap_3.png
-rw-r--r-- 1 root root 5995 Jun 21 19:16 weathermap_4.html
-rw-r--r-- 1 root root 20138 Jun 21 19:16 weathermap_4.png
-rw-r--r-- 1 apache noc 14385 Jun 21 19:16 weathermap_thumb_2.png
-rw-r--r-- 1 apache noc 14239 Jun 21 16:31 weathermap_thumb_3.png
-rw-r--r-- 1 root root 17031 Jun 21 19:16 weathermap_thumb_4.png
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

jmadrid2 wrote:I get the "You Have No Maps" error.
You have no maps at all? no empty boxes?

OK. Check the permissions in the Manage... Weathermap section for the maps you have vs the user you are logged in as. That's what you'd get if you don't have permission to see the maps that are generated.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
jmadrid2
Posts: 43
Joined: Thu May 04, 2006 9:32 am
Location: Bayonne, NJ

Post by jmadrid2 »

Howie, you are the man!!! I saw it a thousand times saying Admin could see it, but I never put 2+2 together to guess that I no longer log in as admin. Thanks alot and your program is the best!!!!!
_JPL_
Cacti User
Posts: 67
Joined: Mon Nov 29, 2004 11:34 am

Post by _JPL_ »

I don't see maps at all after the poller runs. I chmod 777 the output folder to make sure there were sufficient perms (will undo once I get it working). I have the conf file in the configs folder.

In the poller at the very end I see the error:
PHP Fatal error: Cannot redeclare class html_imagemap_area_polygon in /usr/share/pear/HTML_ImageMap.class.php on line 140
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests