Ad Widget

Collapse

Value mapped item to populate an inventory field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • joda
    Junior Member
    • May 2024
    • 3

    #1

    Value mapped item to populate an inventory field

    I have some LTE-based cellular devices that we monitor using Zabbix and SNMP.

    One of the items polled are the ID of the cell tower they're connected to.

    I have created a value mapping of the tower ID to both latitude and longitude values for each tower in Zabbix.
    This works as expected and looks something like this when looking an the items for a device
    Name Last Check Last Value
    Tower ID 10m 1234
    Tower lat 10m 61.40288 (1234)
    Tower lon 10m 22.2340 (1234)
    The value for Tower lat and Tower lon gets presented like this by Zabbix, like the value mapped value 61.40288 followed by the (1234) looked up value within parenteses.
    However when chosing to use this value to "Populates host inventory field" the looked value within parenteses are also included.

    So in this case the Location latitude for the device will be 61.40288 (1234) which really breaks the idea of using the lat/long values to geomap devices.

    Is there any way to address this issue?
    I've tried regexing it using Preprocessing, but the Preprocessing takes place before value mapping (hence the name Pre-processing )

    Any ideas are welcome!
  • joda
    Junior Member
    • May 2024
    • 3

    #2
    I just wanted to follow up with the solution I found to make my way around this.

    I ended up using the pre-processing function in order to lookup the Tower ID and resolve the lat / lon values.

    Added pre-processing using the JavaScript option and added this snippet:

    Click image for larger version

Name:	image.png
Views:	181
Size:	36.3 KB
ID:	484408

    It takes the Tower ID from the device Item and returns lat. If the Tower ID is not found it returns 0.00.

    Comment

    Working...