Ad Widget

Collapse

Can extract one result with discovery rules

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alexxowo
    Junior Member
    • Sep 2021
    • 4

    #1

    Can extract one result with discovery rules

    Hi guys!
    I'm new with zabbix, and I am trying to get the model name from a host, the host I am trying to get is a ubiquiti antenna. I am using the discovery rules to read through SNMP, which is being the correct thing, but I am obtaining two values ​​with different SNMP indexes, but the content of the variable is the same, what interests me is to automatically obtain a single SNMP entry OID. Can I somehow filter the discovery in such a way that I can be left with just one? Now i am using Zabbix 5.4

    The following JSON is the answer of my Discovery rule

    [
    { "{#SNMPINDEX}": "7", "{#MODEL}": "LiteAP GPS" },
    { "{#SNMPINDEX}": "12", "{#MODEL}": "LiteAP GPS" }, <- i want delete that, or get only one for this data
    ]

    if i use prototype item, it show conflict with same item key, because i'm getting the double result


    thanks for you help, and sorry for my bad english!
  • Semiadmin
    Senior Member
    • Oct 2014
    • 1625

    #2
    Hi, alexxowo.
    I'd create a text item with the same SNMP OID as your LLD rule, i.e. with the word "discovery" and macro {#MODEL}, and use JSONPath preprocessing:
    $..['{#MODEL}'].first()

    Comment


    • alexxowo
      alexxowo commented
      Editing a comment
      Hi~
      thanks for your answer, its worked for me
Working...