Ad Widget

Collapse

Multiple host combined trigger / action

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amanogue
    Member
    • Mar 2015
    • 34

    #1

    Multiple host combined trigger / action

    Hello.

    I'm trying to launch a action to shutdown to my hosts when 2 of my UPS get under 15min remaining battery.

    I'm able to do this if I only use one host (ups) at the action. No way to do it work using two hosts (the two required ups).

    Any idea?

    Thanks in advance.
  • kloczek
    Senior Member
    • Jun 2006
    • 1771

    #2
    Add dummy host (with interface on localhost/127.0.0.1) and using UPS snmp monitoring data create trigger evaluating data from multiple sources.
    With this go to Configuration -> Actions switch to trigger and add in condition your "trigger name" and "trigger value".
    In Operations tab switch "Execute on:" to "zabbix server", add remote command which will cause shutdown of your host(s).
    Your command will be executed on server or proxy (if your dummy host is monitored over proxy).

    If you have more like this group of hosts you should create template and use it on multiple dummy hosts.
    It shuld be possible to use set of macros in such template pointing to macroed UPSes and to use macroed hostnames which should be shuted down.
    "Trigger name" of course in this case must be unique to not fire your actions in other conditions :P
    Last edited by kloczek; 13-04-2016, 12:46.
    http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
    https://kloczek.wordpress.com/
    zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
    My zabbix templates https://github.com/kloczek/zabbix-templates

    Comment

    • amanogue
      Member
      • Mar 2015
      • 34

      #3
      Thank you kloczek

      Could you please tell me how to create trigger evaluating data from multiple sources? I've never done that before.

      Thanks in advance.
      Last edited by amanogue; 13-04-2016, 13:01.

      Comment

      • kloczek
        Senior Member
        • Jun 2006
        • 1771

        #4
        Originally posted by amanogue
        Thank you kloczek

        Could you please tell me how to create trigger evaluating data from multiple sources? I've never done that before.
        Go to you host/template triggers -> "create trigger" -> on right side of the "Expression" editor area you have small "Add" rectangle with kind of simple wizard helping entering complicated expression. On choose "Item" you can point to exact hots/template -> items.
        When you will finish this wizard in Expression edit are will be exact trigger expression which you can modify on defining more such triggers.
        http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
        https://kloczek.wordpress.com/
        zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
        My zabbix templates https://github.com/kloczek/zabbix-templates

        Comment

        • amanogue
          Member
          • Mar 2015
          • 34

          #5
          I`m trying with this trigger. Is this what you mean?

          TIA.
          Attached Files

          Comment

          • kloczek
            Senior Member
            • Jun 2006
            • 1771

            #6
            Yep .. something like this.
            http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
            https://kloczek.wordpress.com/
            zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
            My zabbix templates https://github.com/kloczek/zabbix-templates

            Comment

            • Danny5398
              Junior Member
              • Apr 2019
              • 1

              #7
              This is probably better handled by using a more generic action type and just having more reducers listen to it. If there are mutations that would also trigger after more specific actions are dispatched you can call functions that do that mutation in multiple reducers Walgreens Survey.
              Last edited by Danny5398; 23-04-2019, 06:16.

              Comment

              Working...