Ad Widget

Collapse

Zabbix LLD Item Prototype name via regex of OID

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 5893
    Junior Member
    • Mar 2023
    • 1

    #1

    Zabbix LLD Item Prototype name via regex of OID

    Hello,

    I am creating a new SNMP template that utilizes LLD. The device i am monitoring uses an OID string similar to the following:

    ifOperStatus.10401
    • 1= Chassis
    • 04= Slot
    • 02= Interface

    Is there a way using regex or other means, where the Item Prototype "Name" can be set to something along the lines of "Slot-X Interface-Y"?

    If so, could you help provide guidance regarding the name, key, and OID field format?

    I am certainly far from an expert, but I have successfully implemented custom templates using LLP several times. Sadly, I have not been able to figure this out on my own.

    Thanks in advance for any assistance!
  • Dr. Doofenshmirtz
    Junior Member
    • Jul 2023
    • 2

    #2
    Hi,

    Do you mean something like this: {{#SNMPINDEX}.regsub("(\d)(\d\d)(\d\d)", "Chassis \1 Slot \2 Interface \3")}
    Maybe you need to change the LLD-Marco if you use a different one.

    Perhapsthere is a better way to use the Regex but it works for me.

    If you don't want "Chassis" in your name, you can simply delete it.

    Cheers,

    Comment

    Working...