Healthcheck for a listening tentacle


I am trying to achieve the creation of a health check for our Listening Tentacle and, based on the response of the health check, make some steps. For this, I tried to use a runbook with a health check as our first step. Still, it doesn’t work because the tentacle is not visible for the step, so now I am using the tentacle as the worker for a bash step where I assign a value to a variable and, based on that variable, I check if the following steps run or not. Still, for some reason, independent of the result of the first step, it keeps responding false so the following steps are skipped. Is there something I am doing wrong or is there some other approach for this objective?

Hey @andres.carcamo , thanks for reaching out and welcome to the forum!

I have a few questions so I can understand your process and goals a bit better.

  1. It looks like you’re wanting to send notifications when a Tentacle goes down/fails a health check, is that correct?
  2. Can you tell me a little more about what you mean when you say “it doesn’t work because the tentacle is not visible for the step” - I’m having trouble understanding what issue you’re talking about here.

In general, I think your issue here primarily stems from the syntax in your variable run condition.

  • #{if Octopus.Action[Healthcheck] == "false"} true #{/if} is specifically checking the value of the output variable from the step titled Healthcheck, which is step 1 in your process.
  • This value is being set to true by the line set_octopusvariable "active" true in line 3 of your Bash script.
  • The output variable in your second step (which is set to false) would be accessible as #{Octopus.Action[Set Status Variable]} instead.

Looking forward to hearing more about your goals and intentions so we can hopefully help get you sorted out!

Thank you very much for the response Cory.

The first statement is correct, I want to send a notification via Slack and PagerDuty (the last one by a bash script) when the health check of our tentacle fails, that’s why I am trying to do so with a runbook instead just the normally scheduled health check.

When I say “it doesn’t work because the tentacle is not visible for the step”, I refer to this:

Our tentacle is not in any deployment target so we cant does this health check directly with this step.

Excellent, thanks for the additional clarification and information!

A couple of options that may help - we have a community step template called Worker - Health Check. It’s written in PowerShell, but allows you to target a worker with a health check script, which should be easier to manage than your current step.

As an alternative, Octopus also has an internal concept of subscriptions for subscribing to specific event streams. One of the subscription event categories you can subscribe to is Machine found to be unhealthy, as well as Machine health changed. Using a subscription, you can set up a webhook process to post the information to Slack. We don’t currently have a documented process to do the same for PagerDuty, but I’m sure that could also be handled with a webhook processor.

Let me know what you think of the options above - happy to keep working through this as you get your process figured out!