Ad Widget

Collapse

Additional items in the operational data field of the trigger.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • themailman
    Junior Member
    • Sep 2024
    • 6

    #1

    Additional items in the operational data field of the trigger.

    Hello,
    I have been trying to add additional items in the same Low level discovery trigger. The twist is that i dont need the items for the trigger, but want to include it in the operational data field for "more informasjon" about the problem itself.

    I can start by showing a little (I will censor some info). BTW i use modbus, but the idea is the same. This is the items in the discovery:
    Click image for larger version  Name:	image.png Views:	0 Size:	27.6 KB ID:	491058

    after that i would like to add it to a trigger and the expression itself just include the error_code if it hit a int that is predefined in the relevant document, ERROR_NUMBER and PRIORITY is just additional data i want to give to operational field without impact of problem expression.

    This is the first thing i tried for in operational data field.
    Code:
    Error_code: {?last(/xxx Modbus/modbus.get[MB1,,3,{#ERROR_CODE},1,int16,be,0])}
    Error_number: {?last(/xxx Modbus/modbus.get[MB1,,3,{#ERROR_NUMBER},1,int16,be,0])}
    Priority: {?last(/xxx Modbus/modbus.get[MB1,,3,{#PRIORITY},1,int16,be,0])}
    This didnt work, just outputet the whole code itself to the alarm system.


    After trying many different i just simply added this to the problem expression:
    Code:
    min(/xxx Modbus/modbus.get[MB1,,3,{#ERROR_CODE},1,int16,be,0],#100)=zz and
    last(/xxx Modbus/modbus.get[MB1,,3,{#ERROR_CODE},1,int16,be,0])=yy and
    last(/xxx Modbus /modbus.get[MB1,,3,{#ERROR_NUMBER},1,int16,be,0])>0 and
    last(/xxx Modbus/modbus.get[MB1,,3,{#PRIORITY},1,int16,be,0])>0
    and did this in the operational data
    Code:
    error_code: {ITEM.LASTVALUE2} error_number: {ITEM.LASTVALUE3} prrity: {ITEM.LASTVALUE4}
    This worked OK, but not good practice.

    If you read this i think the point is clear, just want to add additional latest data in the same Low level disocvery to the trigger in operational data field, and not iclude it in the problem expression. Just want to know good practice to do this.
    Thank you for reading
    Last edited by themailman; 10-09-2024, 15:45.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Seems like the way you did it, is currently the way, as you can use data of the items, what you used in expression. You cannot use data from other items...

    Comment

    Working...