Ad Widget

Collapse

Item Values in Trigger Name Space

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tiller
    Junior Member
    • Dec 2011
    • 6

    #1

    Item Values in Trigger Name Space

    Is there a way to use a template item value in the name space of a trigger for a different template item? For example I am trying to monitor link speed and interface up and down using SNMP. I can use the SNMP OID ifDescr.1 to get the OS name of the interface. Can I somehow use that value in the name space of other triggers?

    Any help would be appreciated.

    Thanks

    Tiller
  • netmon
    Member
    • Feb 2012
    • 30

    #2
    I had the same problem.
    My case was comparable to yours.


    Challenge:
    I use an external perl script to discover items with LLD in Zabbix 2.0 (1.9.10 alpha).
    I have multiple Items (LLD prototypes) defined:
    - Process Name (value: Name of Porcess)
    - Process Status (value: OK/Problem)

    I want to create a trigger which alerts if a process goes into Problem state.

    Expression:
    {Template: process.status.str("OK")}#1

    Unfortunately I cannot use the value from process.name within the trigger name.
    How to change that?
    Add the process.name to the trigger expression and use {ITEM.VALUE<1-9>} in the trigger name.

    I changed my trigger expression to:
    {Template: process.status.str("OK")}#1|{Template: process.name.strlen(0)}<0

    The expression "{Template: process.name.strlen(0)}<0" will never match, but this way I can use {ITEM.VALUE2} (value of the 2nd statement in the expression -> process.name) in my trigger name.

    Trigger Name:
    Process {ITEM.VALUE2} Status changed to {ITEM.VALUE1}


    For your case the trigger could look like:

    Trigger Name:
    Status on Interface {ITEM.VALUE2} changed to {ITEM.VALUE1}
    Expression:
    {Template:ifOperStatus.1.change(0)}=1|{Template:if Descr.1.strlen(0)}<0
    Last edited by netmon; 12-03-2012, 12:58.

    Comment

    • tiller
      Junior Member
      • Dec 2011
      • 6

      #3
      Thanks for the response. I actually ended up doing something very similar. In the trigger I was able to get the name of the interface and get the status. Here is what I ended up with:

      Name: {HOSTNAME}:{ITEM.LASTVALUE1} Is Down

      Expression:
      AND
      {Template_Test:ifDescr.3.strlen(#2)}#2
      {Template_Test:ifOperStatus.3.last(0)}>1

      I have been out of town, so I haven't been able to post.

      Thanks again for the response. This confirms what I did is the only way to do this.

      Comment

      • zeds
        Junior Member
        Zabbix Certified Specialist
        • Jan 2009
        • 20

        #4
        thank you for sharing this. It was super helpful.
        I was banging my head against table trying to figure out how to do this.

        Comment

        • turtlelu
          Junior Member
          • Mar 2019
          • 4

          #5
          its helpful

          Comment

          Working...