Introduction
Links between maps, and links to other sites are often requested as ‘new features’, even though they are already possible. Here are the things you need to know:
- Any node or link can have a URL associated with it, using the INFOURL keyword. Usually, this is a link to a Cacti graph or something similar, but it doesn’t have to be.
- A node doesn’t have to represent a router or device either.
- For Cacti in particular, the ‘random’ ID in the weathermap name doesn’t ever change, and is safe to use in (HTML) links.
Simple version
So, putting all that together:
NODE link-to-other-map POSITION 300 300 LABEL Other Map INFOURL http://my-cacti-server/plugins/weathermap/weathermap-cacti-plugin.php?action=viewmap&id=4df1356edd3366055c5f
Will make a text link to your other map, using Cacti’s authentication to make sure you are allowed to see it. If you don’t use Cacti, this would just be the URL for the other map as you see it in the browser.
Fancier version
How about having a thumbnail of the other map that you can click on?
As long as both maps are on the same Cacti server, Weathermap already generates a thumbnail to use in the web interface, which you can use too.
Some things you need to think about though: Weathermap updates the maps in the order they are listed in the management page, including the thumbnail updates. So if you want to be sure of getting the latest thumbnail, your master top-level map should be the last one in the list. You can put it in its own group though, so it isn’t all the way down a page of maps, and Weathermap remembers which group you last clicked on, so that shouldn’t be a problem either.
NODE link-to-other-map POSITION 300 300 LABEL Other Map ICON 64 64 output/4df1356edd3366055c5f.thumb.png INFOURL http://my-cacti-server/plugins/weathermap/weathermap-cacti-plugin.php?action=viewmap&id=4df1356edd3366055c5f
So now we are using the thumbnail image as the icon for our node, and also telling Weathermap to scale it down so that it fits in a 64×64 pixel box.
Final Notes
The only real limitations are that you can’t use a URL for an ICON (this is possible with PHP, but not enabled on all installations. Also, try to avoid using the icon scaling to scale full-size images down to thumbnails, if you are concerned about performance (like updating a set of maps once per minute).