Ad Widget

Collapse

How to trigger an item after another item was executed?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hhasenfratz
    Junior Member
    • Apr 2019
    • 2

    #1

    How to trigger an item after another item was executed?

    Hi,
    I have an item that ran a script in the endpoint machine which gives me a numeric value for memory trend use,

    I want to have another item that will be triggered beforehand that will do a preparation for the 2nd script
    and one more item that will run after to do some finalization.

    Is it possible to have such dependency orchestration?

    thanks,
    Hadar
  • brunohl
    Senior Member
    Zabbix Certified Specialist
    • Mar 2019
    • 215

    #2
    I don't know if I got what you mean, but why don't you use Escalations (https://www.zabbix.com/documentation...on/escalations) with Scripts or Custom Media?

    Comment

    • hhasenfratz
      Junior Member
      • Apr 2019
      • 2

      #3
      Sorry, I'm not so familiar with zabbix - the operation escalation does not happen after an item is running? I usually use it to send me a mail when something is wrong.
      can I do that it will perform a custom script before the item runs?


      I'll explain what I meant in the dependency orchestration?

      I need to have:
      a. zabbix command that shutdown a firewall in the endpoint
      b. after it is down, it should trigger a script I wrote on the endpoint that gives me info on the system.
      c. when it finishes it should turn the firewall back on.


      this is something that will occur every 1 hour.


      what I currently have is an item with no triggers or actions that triggers the script I wrote once every hour and receive a numeric value from the script output.



      I know I can write in the script I wrote that it will turn it off before the command run and back on when it is finished - this is the easiest solution
      However, due to the fact that we have a lot of endpoints, I do not want to replace the scripts on all 1000 endpoints, especially when it's not the first time I need this kind of hierarchy.
      So, I'm searching for a dependency option in Zabbix that if I forgot something in a script I can add dependency levels


      thanks,
      Hadar

      Comment

      • brunohl
        Senior Member
        Zabbix Certified Specialist
        • Mar 2019
        • 215

        #4
        Hmm, ok, now I understand. What you are looking for it's not trivial, but I guess that you could work with custom intervals:
        - 1) Create an item that will run 8,9,10,11 and so on that will drop your firewall rule;
        - 2) Create an item that will run 8h5,9h5 ... that will check your info
        - 3) Create an item that will run 8h10,9h10 that will raise your rule
        Or
        You could create a script that does all this in one place (which I think it's more logical)

        Don't know if this is what you are looking for, but there's the two ways that I see it happening.

        Comment

        • steeladept
          Member
          • Sep 2018
          • 69

          #5
          Another alternative is create the item that will trigger on the hour to drop the firewall, then another trigger that is monitoring the firewall to run a script that checks the info then raises the firewall. That way if it drops at other times it will check the status as well and try to recover, even if it is mid-hour (if that is desireable, anyway).

          Comment

          • MARKRONSON
            Junior Member
            • Apr 2019
            • 1

            #6
            hey,
            thanks steeladept .. i was also looking for the same. I referred to many guides like this ( https://routerlogin.one/192-168-0-10/) and your solution with that worked for me.
            best regards!!
            Last edited by MARKRONSON; 13-08-2019, 15:30.

            Comment

            Working...