Popup with snmp device info in weathermap

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

mgb
Cacti User
Posts: 124
Joined: Mon Jun 21, 2004 4:06 am
Location: North of the Netherlands

Popup with snmp device info in weathermap

Post by mgb »

For Weathermaps I made a small script to display device snmp info when we do mouseover. Put the script info.php in the weathermap dir and add the following to the NODE part for your devices in weathermap.
NOTES <iframe width=\"400px\" height=\"350px\" src=\"/plugins/weathermap/info.php?node={node:this:cactiid}\"> </iframe>
replace {node:this:cactiid} with the cactiid of the device. The device will be polled by the script for its information.

If you add
OVERLIBGRAPH images/cisco-6509.PNG
to the Node aswell you can add pictures of you're device in the same window.
make sure you've got an image with your device in the images directory of weathermap and point to it.

Michael
Attachments
info.zip
script info.php to put in the weathermap directory
(1.15 KiB) Downloaded 552 times
colejv
Posts: 46
Joined: Wed Mar 19, 2008 10:50 am

Post by colejv »

I like this I've been trying to figure out what to have on mouseover of my switches.

I added a few Items which someone else may or may not find useful. But are very useful in my environment.

Count of DHCP Snooping Bindings
Count of Dot1x Authenticated Users

Interface Count with Counts of Up/down ifoperstatus (This is So-So in my environment where every Switch has at least 20 SVI's)

5 Min CPU

Boot Image

Hardware (This oid works well on 3750s and 6500's(IOS))

Also I reduced the font to 60%
Attachments
info.php.zip
(1.75 KiB) Downloaded 364 times
User avatar
egarnel
Cacti Pro User
Posts: 708
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

Post by egarnel »

hmm....
getting the "SNMP not in use" message on the pop-up. seems like it is not pulling the snmp values from within cacti.
if I am in /var/www/html/cacti/plugins/weathermap, then line 3

Code: Select all

chdir('../../');
should put me in /var/www/html/cacti
then the include statements should work then....


scratching my head on this one.
Cacti1 OS: CentOS 5.6 | 300+ devices
Cacti2 OS: CentOS 5.6 | 300+ devices
King of the Elves
Local Anarchists Union #427
"Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others." -Edward Abbey
colejv
Posts: 46
Joined: Wed Mar 19, 2008 10:50 am

Post by colejv »

I was getting that by cutting and pasting the example above, On my setup I had to use

Code: Select all

NOTES <iframe width=\"400px\" height=\"400px\" src=\"/cacti/plugins/weathermap/info.php?node={node:this:cacti_id}\"> </iframe>
node:this:cacti_id not node:this:cactiid

My Apache Configuration also necessitated adding /cacti/ to the path
mgb
Cacti User
Posts: 124
Joined: Mon Jun 21, 2004 4:06 am
Location: North of the Netherlands

Post by mgb »

Weird, cactiid is working for me. I know it was quick and dirty and frankly for me it was a quick hack to get something working. Will look into the script to make it a bit more versatile.

Michael
User avatar
egarnel
Cacti Pro User
Posts: 708
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

Post by egarnel »

The fix for me was to add a set config for each node

Code: Select all

NODE 6506A_core
        LABEL 6506A
        SET cacti_id 14
        LABELOUTLINECOLOR none
        OVERLIBCAPTION South Shownet1 6506A Core switch handles odd numbered vlans and subnets
        NOTES <iframe width=\"400px\" height=\"350px\" src=\"/cacti/plugins/weathermap/info.php?node={node:this:cacti_id}\"> </iframe>
        OVERLIBGRAPH images/6500.png
        ICON images/6500.png
        LABELOFFSET 10 40
        POSITION 144 118
Cacti1 OS: CentOS 5.6 | 300+ devices
Cacti2 OS: CentOS 5.6 | 300+ devices
King of the Elves
Local Anarchists Union #427
"Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others." -Edward Abbey
colejv
Posts: 46
Joined: Wed Mar 19, 2008 10:50 am

Post by colejv »

Your really just defining/setting a variable so there really is no right/wrong way, I have cacti_id because I copied Howie's example but cactiid,idcacti,foo work just as well as long as the node:this:foo matches the SET foo.


egarnel if your not using 0.96 and templates or specifying it as default then

Code: Select all

NOTES <iframe width=\"400px\" height=\"350px\" src=\"/cacti/plugins/weathermap/info.php?node=14\"> </iframe> 
without the set command makes for a cleaner config.
User avatar
egarnel
Cacti Pro User
Posts: 708
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

Post by egarnel »

I tried that initially, but it did not seem to work. I will try it again on another map soon
Cacti1 OS: CentOS 5.6 | 300+ devices
Cacti2 OS: CentOS 5.6 | 300+ devices
King of the Elves
Local Anarchists Union #427
"Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others." -Edward Abbey
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

The only exception is if you are using poller_ouput/rrd or dsstats, and then weathermap will set some of those variables for you (including cacti_host_id) :-)
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!)
robogoat
Posts: 7
Joined: Mon Oct 26, 2009 4:17 pm

Post by robogoat »

Works great! Thanks for the post...
mgb
Cacti User
Posts: 124
Joined: Mon Jun 21, 2004 4:06 am
Location: North of the Netherlands

Post by mgb »

Glad to help,

Weathermap starts to get better than WUG :wink:

Michael
User avatar
zoemu
Cacti User
Posts: 287
Joined: Fri Jul 10, 2009 1:38 pm
Location: Toronto, Canada

Post by zoemu »

works like a charm for me here, just one small question!!!...

Is it possible to make the windows popup upward instead of downward!!!

LA
User avatar
egarnel
Cacti Pro User
Posts: 708
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

Post by egarnel »

zoemu wrote:works like a charm for me here, just one small question!!!...

Is it possible to make the windows popup upward instead of downward!!!

LA
Yeah, that would be nice!
Cacti1 OS: CentOS 5.6 | 300+ devices
Cacti2 OS: CentOS 5.6 | 300+ devices
King of the Elves
Local Anarchists Union #427
"Anarchism is founded on the observation that since few men are wise enough to rule themselves, even fewer are wise enough to rule others." -Edward Abbey
joseme
Cacti User
Posts: 90
Joined: Fri May 15, 2009 9:36 am

Hi

Post by joseme »

Hi
I've installed it on a windows 2003 server , but although I can see the snmp info, the pop up disappears quickly, (the same happens on IE 8 an Mozilla).


my cacti is 0.8.7.d (windows 2003 server)
my weathermap 0.95b.

Please could you check it?.

Thanks
mgb
Cacti User
Posts: 124
Joined: Mon Jun 21, 2004 4:06 am
Location: North of the Netherlands

Post by mgb »

Made my version with WM 0.96a. Not sure if all works in previous versions.
Displaying of the script is done by the javascript part of weathermap. You could try to replace info.php with a simple html page to make sure it's not the script that is the problem.

Michael
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests