Ad Widget

Collapse

Use key parameter in trigger name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • de2zotjes
    Junior Member
    Zabbix Certified Specialist
    • Nov 2010
    • 4

    #1

    Use key parameter in trigger name

    I would like to able to do the following:

    having an item : this.key[parm]

    I want to create a trigger:

    name: failure on {ITEM.KEY1}
    trigger expression: this.key[parm].last()=1

    I know this cannot be done directly in the 1.8.5 version, but has anybody found a sneaky slithery alternative to do this anyway?
  • Yello
    Senior Member
    • Apr 2011
    • 309

    #2
    Hi,
    You don't give enough info for me to know whether this is on the right lines or not. But how about:

    item : this.key[{$parm}]

    trigger name: failure on this.key[{$parm}]
    trigger expression: this.key[{$parm}].last()=1


    Regards,
    David

    Comment

    • de2zotjes
      Junior Member
      Zabbix Certified Specialist
      • Nov 2010
      • 4

      #3
      If I could store a value for parm with(in) the item that would be perfect.

      The point is that I need to create a host of items that will only differ in the value of the key parameter. It would be nice to be able to clone the items AND the triggers without having to change the key parameter in more than one place.

      Comment

      • Yello
        Senior Member
        • Apr 2011
        • 309

        #4
        Hi,
        Then what I suggest should work as I sometimes do the same myself.


        Regards,
        David

        Comment

        • de2zotjes
          Junior Member
          Zabbix Certified Specialist
          • Nov 2010
          • 4

          #5
          I don't see how that would help. Perhaps I need to elaborate on what I want. Let's take processes as an example. I want a count of atd-processes on a box:

          item description: number of processes $1
          item key: proc.num['atd']

          Now If I want a count of crond-processes on that same box I clone the item and only need to change the item key.

          One step further is to have triggers on the process counts:
          trigger name: too many atd processes
          trigger expression: proc.num['atd'].last(0) > 1

          I would very much like to be able to change this trigger name to something like too many {ITEM.NAME1.PARAMETER1}.

          In the absence of PARAMETER I am willing to settle for {ITEM.NAME1} as long as I get the 'atd' to show up in the dashboard.

          (I feel an enhancement request coming up..)

          Comment

          • Yello
            Senior Member
            • Apr 2011
            • 309

            #6
            Originally posted by de2zotjes
            (I feel an enhancement request coming up..)
            Perhaps. But how does this match your needs:

            host macro: {$ITEM.NAME1} = number of processes
            host macro: {$PARAM1} = atd
            item description: {$ITEM.NAME1} {$PARAM1}
            item key: proc.num[{$PARAM1}]
            trigger name: {$ITEM.NAME1} {$PARAM1}
            trigger expression: proc.num[{$PARAM1}].last(0) > 1

            Then in your cloning scenario you'd:

            - create another host macro such as {$PARAM2}
            - clone the item changing the key parameter and the item name to reference {$PARAM2}.
            - clone the trigger expression and change the PARAM reference in the key and name to {$PARAM2}.

            I'm assuming here that you want the item description and trigger names to be the same. How far away is what I'm describing from what you want?


            Regards,
            David

            Comment

            • de2zotjes
              Junior Member
              Zabbix Certified Specialist
              • Nov 2010
              • 4

              #7
              Originally posted by Yello
              - create another host macro such as {$PARAM2}
              - clone the item changing the key parameter and the item name to reference {$PARAM2}.
              - clone the trigger expression and change the PARAM reference in the key and name to {$PARAM2}.

              I'm assuming here that you want the item description and trigger names to be the same. How far away is what I'm describing from what you want?
              This would get the texts in the trigger, so yes it does what I want. But there still is this extra step of editing both the trigger expression and the trigger name. Once you start editing the trigger name there is little reason to refer to a macro as opposed to typing the content of that macro..

              de2Zotjes

              Comment

              • Yello
                Senior Member
                • Apr 2011
                • 309

                #8
                Originally posted by de2zotjes
                Once you start editing the trigger name there is little reason to refer to a macro as opposed to typing the content of that macro..
                Once this becomes a concern to me I use the api and do it via script.


                Regards,
                David

                Comment

                Working...