Ad Widget

Collapse

How to get multiple retries of an Action if it fails

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    How to get multiple retries of an Action if it fails

    I have a Web Scenario which activates a Trigger which fires an Action. This is all working fine. But I'm running into a situation where the initial running of the Action doesn't seem to fix the problem.

    I'd like to have a subsequent Action that checks the status of a Trigger again, 2 minutes later, and if it is STILL active (i.e. the service is down) then it should try an additional Operation.

    I've looked at {Trigger.Value} to determine the state of a Trigger, but it doesn't seem like you can use this in an Action -> Operation step. And Operation steps don't appear to allow for conditional execution. Something like this pseudo code:
    - Service goes down
    - Trigger goes active
    - Action -> Operation is performed (attempt to restart service)
    - Loop
    Is Trigger still active? Is service still down?
    Perform Action -> Operation (same as above - or could be slightly different)
    - End Loop


    Hmm...maybe the solution is just a 2nd Trigger that has a longer sequence of necessary failures. My current trigger goes active when it fails for 2 consecutive tests. Maybe I need another one that goes active when it fails for 4 or 5 consecutive tests.

    #2
    If I understand your question correctly, you could just define multiple steps with a custom duration for your operation. For example, you could define your restart service operation to have 3 steps, so it loops for three times in total, once every x minutes. You can check out some of the examples in the official documentation here - https://www.zabbix.com/documentation...on/escalations

    Comment


      #3
      Hi Arturs,
      Thanks for responding. Yes, what you describe sounds close to what I'm after...except that I want the loop to be conditionally executed.

      This Escalations feature sounds exactly like what I'm after. I had noticed these 'Step ranges' on the Operations steps, but had been confused on exactly what they would do or how to configure them.

      I'll do some more reading on these and see if I can figure it out from the examples. From my brief overview so far...it sounds like the conditional aspect of my request is handled by the Recovery steps - that IF the service comes back up, then it will halt the Operation steps and switch over to the Recovery steps. Does that sound right?

      Comment


        #4
        Hmmm...I'm not exactly sure that I have it configured correctly. And it's all based on the assumption that if the Trigger is 'fixed', that the Operations steps of the Action will be aborted and it will move into Recovery steps.

        To achieve what I think I need I ended up just adding additional Steps to the Operation...it's not exactly a loop, but achieves the purpose. I didn't think that I could use the 2-3 notation because I have a sequence of steps that need to be executed in order, with a pause between them. It's my understanding that using the "2-3" notation in a single Step for "Steps" would cause each step to be performed at Time intervals 2 and 3, and not really loop over Step 2, pause, then Step 3, repeat.

        Here's what I have:
        Click image for larger version  Name:	Screen Shot 2018-12-28 at 13.13.21 .png Views:	1 Size:	97.8 KB ID:	371316

        The two Stop steps and the two Start steps are identical. For this to function they way I want it relies on this sequence of steps being aborted as soon as the Trigger is OK, and the Recovery steps are executed.
        Last edited by J_Adatasol; 28-12-2018, 23:36.

        Comment

        Announcement

        Collapse
        No announcement yet.
        Working...
        X