Ad Widget

Collapse

Using {ITEM.VALUE1&2} in the trigger name and intentionally flapping to update name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mattykay
    Junior Member
    • Mar 2018
    • 7

    #1

    Using {ITEM.VALUE1&2} in the trigger name and intentionally flapping to update name

    Hi guys!

    I'm wanting to do something a little odd with triggers to address a need - effectively wanting to pass the latest data from two items to be in the trigger name visible on the dashboard etc until it is no longer a problem.

    The only way I've thought about achieving this to have the latest values is to make the trigger "flap" to cause the new trigger to replace the macros with the latest value, however haven't yet been able to achieve this so that it is constantly there (at least to the user).

    Zabbix Version: 2.4.8

    Items:
    • status (External script that polls a SAN every 5m)
      • stores a string of current state (e.g. "resuming", "failed")
    • eta (Zabbix trapper that receives values from external script)
      • stores either a estimated time to address issue or "no eta available" otherwise (for failed state)

    Trigger Name: "Disk {#DISK_NUMBER} at {#DISK_LOCATION} {ITEM.VALUE1} ({ITEM.VALUE2})"

    Trigger Expression:
    ({TRIGGER.VALUE}=0 and {host:status.regexp("resuming")}=1 and {host:eta.strlen(#1)}>1)

    The expression triggers as expected and then clears, however it does it at every data change (as designed) meaning it toggles on/off leaving a gap where it does not appear on the dashboard before reappearing at next data change. I thought about using a time value to cause this to be every 30 seconds, but again there is a slight gap where it is not visible for some time instead of appearing to be there constantly.

    So expected event log would be something like;

    Time Description Status Severity Duration
    2018-07-30 16:50:35 Disk 40 in location 21:8:0 is resuming (1h 55m) Problem Information 5m
    2018-07-30 16:45:36 Disk 40 in location 21:8:0 is resuming (2h) OK Information 1s
    2018-07-30 16:40:35 Disk 40 in location 21:8:0 is resuming (2h) Problem Information 5m

    Currently it is more like;

    Time Description Status Severity Duration
    2018-07-30 16:55:35 Disk 40 in location 21:8:0 is resuming (1h 55m) Problem Information 5m
    2018-07-30 16:50:36 Disk 40 in location 21:8:0 is resuming (2h) OK Information 5m
    2018-07-30 16:40:35 Disk 40 in location 21:8:0 is resuming (2h) Problem Information 5m

    Any ideas?
  • mattykay
    Junior Member
    • Mar 2018
    • 7

    #2
    Bump.

    I've sort of achieved the intended effect by having a second trigger with a similar name and making the two dependent on each other which means they flip on and off like;

    Trigger One on
    Trigger One off
    Trigger Two on
    Trigger Two off
    Trigger One on
    Trigger One off

    Problem being this complicates things in the event log or to people who want to tweak the trigger(s) - plus can't do dependencies for discovered triggers as these will need to be.

    Any better ideas?

    Comment

    • mattykay
      Junior Member
      • Mar 2018
      • 7

      #3
      Final update; upon testing the original trigger it actually works as I'd expect for any newly discovered items - not sure if it wasn't working because i was configuring the trigger after it had discovered & triggered originally.. anyway all is well.

      Comment

      Working...