ZABBIX Map on Grafana

templating

#1

Hi Everyone

I created a map of all my switchs on ZABBIX, I istalled grafana to show metrics from zabbix, I created a dashbord for each switch, it’s great, but I want to display my map on grafa, and when i click on a switch i have access to its dashbord


#2

Hi! You can display your map in grafana using Grafana’s Text panel. Set mode to html and use your map url as image src, for instance:
<img src="http://zabbix.grafana-zabbix.org/map.php?noedit=1&sysmapid=1&width=&height=&curtime=1495181459&severity_min=0">

Or use markdown:
![mymap](http://zabbix.grafana-zabbix.org/map.php?noedit=1&sysmapid=1&width=&height=&curtime=1495181459&severity_min=0)

Unfortunately, Zabbix uses additional html layer with inks over png image and you cannot just click on the map and redirect to the particular address. You can only use links in panel drildown. or in panel description.
But also you can use this trick. Open your map in zabbix. Open browser dev tools and use selection tool to select map element. Then copy <div class="map-container"... element and past it into Text panel. Find <img> tag and add your zabbix server address to src:
src="map.php?... -> src="http://zabbix.grafana-zabbix.org/map.php?...
Done!

But links will point to zabbix maps, so you should edit it too if you need.


#3

See example here:
http://play.grafana-zabbix.org/dashboard/db/zabbix-map-integration


#4

Hello there,

I have been able to display a zabbix map in grafana but it seem the maps are not being refreshed automatically. I have set refesh at zabbix user level + refresh on dashbaord level . Still same…no referesh is hapenning.

Any way someone can enlight me …

Thanx

izn0g00d


#5

would this work…seem not

head>

img src="http://192.168.100.6/zabbix/map.php?noedit=1&sysmapid=5&width=&height=&curtime=1496710901&severity_min=0"> /head>

i removea tag so u can see the code :slight_smile:


#6

Hello, since Zabbix version 3.4 maps are in SVG format. Now if I open http://zabbixserver/map.php?noedit=1&sysmapid=1&width=&height=&curtime=1495181459&severity_min=0 the output is json like this:

{“mapid”:“1”,“canvas”:{“width”:“750”,“height”:“700”},“background”:“188”,“elements”:[],“links”:[],“shapes”:[{“sysmap_shapeid”:“0”,“type”:“0”,“x”:“0”,“y”:“0”,“width”:“680”,“height”:“15”,“border_type”:“0”,“border_width”:“0”,“border_color”:“000000”,“text”:“Local network”,“font”:“9”,“font_size”:“11”,“font_color”:“000000”,“text_halign”:“0”,“text_valign”:“0”,“background_color”:"",“zindex”:"-1"}],“label_location”:“0”,“timestamp”:“2017-11-08 23:38:35”}

This is blank map to there is not much data . How can I integrate maps into Grafana now that there is no more PNG images?

Thx
Regards


#7

Not sure. I want to create zabbix map panel for grafana, but it requires so much time to implement.


#8

Hi all -

We had similar issue pulling into our internal Wiki, once upgrading to Zabbix 3.4 (last month) we obviously broke the wget png file we were using from our Zabbix host(s). One of our in house guys wrote a quick script using js that we run from cron to pull maps every 5 minutes. Parsing the svg and creating the png to present within the wiki. I’m new to the Grafana community but would be happy to share if if requested - possibly a starting point to get a feature integration into the plugin?


#9

Hi xponet (or whoever can assist),

Please share the script or any insights as I am in a similar bind.

Thanks