ZABBIX Forums  
  #1  
Old 22-08-2011, 04:46
McMonte McMonte is offline
Junior Member
 
Join Date: Aug 2011
Posts: 2
Default User Macro to Display Item Value on Map

I've been through the forums, the wiki, the documentation and the book "Zabbix 1.8 Network Monitoring" and havent found anything definitive as to whether what I want to do is possible, or how to go about it.

Essentially; I am receiving data from some environmental monitoring devices (temperature probes and whatnot) and zabbix (v1.8.5) is recording and graphing this information just fine.
I want to build a graphical view of my comms room and display the current values for each of the temperature probes on a Map.

I presumed that the way to go about this would be to build a User Macro that referenced the current value of the SNMP item which was associated with each probe. Theoretically this macro would then be used in the label on an icon on my Map to display the current temperature.

I haven't been able to make this work, and I cant work out if I am going about it the wrong way or if it just wont work with this version of Zabbix (1.8.5)
  • According to the bug tracker, it should now work (was a bug fixed in 1.8.5) https://support.zabbix.com/browse/ZBX-3562
  • According to the 1.8 documentation (http://www.zabbix.com/documentation/...os#user_macros ) it /might/ work (Says that user macros are supported in item descriptions, but the matrix does not show a cross in works for Map labels)
  • and According to Rihards book in the section on p245 for Macros in labels on Maps he says "another use could be the display of live data. For example, showing the number of currently connected users for each wireless hotspot"
    - he doesn't go into any detail on the specifics of how however...


Can someone confirm if this is indeed possible, and if so could you help walk me through setting up the User Macro correctly to retrieve the right value, and then how to get the User Macro to display on the Map icon label.

Thanks for any help.
McMonte
Reply With Quote
  #2  
Old 23-08-2011, 19:08
andre_passos andre_passos is offline
Junior Member
Zabbix Certified Specialist
 
Join Date: Mar 2011
Location: Brasil
Posts: 6
Default

Quote:
Originally Posted by McMonte View Post
I've been through the forums, the wiki, the documentation and the book "Zabbix 1.8 Network Monitoring" and havent found anything definitive as to whether what I want to do is possible, or how to go about it.

Essentially; I am receiving data from some environmental monitoring devices (temperature probes and whatnot) and zabbix (v1.8.5) is recording and graphing this information just fine.
I want to build a graphical view of my comms room and display the current values for each of the temperature probes on a Map.

I presumed that the way to go about this would be to build a User Macro that referenced the current value of the SNMP item which was associated with each probe. Theoretically this macro would then be used in the label on an icon on my Map to display the current temperature.

I haven't been able to make this work, and I cant work out if I am going about it the wrong way or if it just wont work with this version of Zabbix (1.8.5)
  • According to the bug tracker, it should now work (was a bug fixed in 1.8.5) https://support.zabbix.com/browse/ZBX-3562
  • According to the 1.8 documentation (http://www.zabbix.com/documentation/...os#user_macros ) it /might/ work (Says that user macros are supported in item descriptions, but the matrix does not show a cross in works for Map labels)
  • and According to Rihards book in the section on p245 for Macros in labels on Maps he says "another use could be the display of live data. For example, showing the number of currently connected users for each wireless hotspot"
    - he doesn't go into any detail on the specifics of how however...


Can someone confirm if this is indeed possible, and if so could you help walk me through setting up the User Macro correctly to retrieve the right value, and then how to get the User Macro to display on the Map icon label.

Thanks for any help.
McMonte
Use like this:
{<HOSTNAME>:<itemkey>.last(0)} like as show in trigger expression
Reply With Quote
  #3  
Old 24-08-2011, 00:14
McMonte McMonte is offline
Junior Member
 
Join Date: Aug 2011
Posts: 2
Thumbs up Resolved

Thanks Andre! - now working fine.

To clarify in further detail for anyone else interested;
My initial assumption was incorrect - You do not need a User Macro on your host to get item specific data onto your map.

I had my host named "Enviromux"
The item key I wanted was called "Temp1"

I setup a new Map with the Icon Label type set to 'Label'
Added a new icon
Set the Icon type to "Host"
In the Label field typed " {Enviromux:Temp1.last(0)} "

The current temperature now appearing on my map!

Regards,
McMonte
Reply With Quote
  #4  
Old 02-03-2012, 20:18
xibbaz xibbaz is offline
Member
Zabbix Certified Specialist
 
Join Date: Jun 2009
Posts: 73
Default

Would be nice to have something similar in graphs. I would have love to put {Template_SNMPv2_4548GT:ifDescr1.last(0)} in the name along with graphing ifInOctets1 and ifOutOctets1.
Reply With Quote
  #5  
Old 05-03-2012, 13:09
paul87st paul87st is offline
Junior Member
 
Join Date: Mar 2012
Posts: 1
Default

Would be nice to have something similar in graphs. I would have love to put in the name along with graphing ifInOctets1 and ifOutOctets1.
Reply With Quote
  #6  
Old 19-03-2014, 11:44
CeeEss CeeEss is offline
Member
Zabbix Certified Specialist
 
Join Date: Nov 2007
Location: London, UK
Posts: 97
Default

Nice one, McMonte! Works a treat!
Reply With Quote
Reply

Tags
icon, macro, maps, user

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:11.