How to kick off a machine health check when the machine starts up

Hi,

I’ve got loads of endpoints coming on and off all the time. I’m using the auto-deployments functionality which is great for a dynamic environment, but I still have to wait for the time between health checks before it deploys.

To minimise this I intend to trigger a health check from the machine itself when it boots up…but I can’t figure out the best way. Options are

  1. Make the tentacle.exe do it - it doesn’t have this functionality
  2. A scheduled task that runs some PowerShell that calls the API - I have to store an API key somewhere
  3. Make my app use Octo.exe and call the API - same API key problem and I want it to update the app for me
  4. Drop the time between health checks - a lot more chatty than it needs to be

Looks like 2 or 3 are my only options, unless you can recommend anything?

Thanks

/Matt

Hi Matt,

Thanks for getting in touch! I think I may have some helpful information for you here.

We have a Health Check step which can be added to your project. This is a simple way to make the health check a part of the deployment and gives you some control over how it is run.

We cover this in our documentation on Immutable Infrastructure. The documentation here is fairly in depth and may help you streamline this process.

Does this sound like what you are after?

If you have any further questions here or run into any roadblocks, feel free to let me know. :slight_smile:

Best regards,
Daniel

Hi Daniel,

Not quite as this will get machines green before the deployment if they’re on, but if they’re off then I still have the (default) hour wait for them to be seen for auto-deployments.

I’m trying to minimise the time between the machine switching on and the next health check so that the auto-deployments react quicker and deploy the latest version of my software.

Does that make sense?

Thanks,

/Mat

Hi Mat,

Thanks for the clarification! I think I better understand your requirements, my solution did not take into account the auto-deployment aspect of your scenario.

Currently I believe the API methods you have suggested are the best ways to achieve this. Unfortunately, this does require storing the API key on the target server.

It may be a good idea to create an account in Octopus and experiment with the minimal permissions required to perform the health check to mitigate further security issues of having an API key stored on the target.

I did some testing and you can use the following script from our GitHub repository to run a health check through the API:

I created a new team to test the minimum requirements for running a health check task:

EnvironmentView
MachineEdit
MachineView
TaskCreate
TaskView

Furthermore, after discussing with the team, we agree that it is worth looking into the feasibility of implementing some form of health check on Tentacle service start up. As a result, I have created a GitHub issue for the team to investigate.

Let me know if this is helpful. If you have any further questions here, please don’t hesitate to let me know.

Best regards,
Daniel

Hi Daniel,

The GitHub issue is the utopia indeed. Do you reckon this feature could be delivered any time soon? Just trying to work out if I should do the scheduled task calling the API (:face_vomiting: ) or just wait.

I am using Octopus Cloud so it benefits you to do this too so I won’t have to lower health check intervals :wink:

Thanks again

/Mat

Hi Mat,

Thanks for the update. Unfortunately I am not able to give you any kind of ETA on this. The team responsible will need to assess if it is even something we can realistically add to Octopus. We would also need to ensure it does not create any form of vulnerability or security hole. Lots of moving parts involved.

However, we do agree that it is a great idea and will help a lot of people trying to make their health checks more responsive.

I would suggest setting up the scheduled task over waiting as it may take a while. :slight_smile:

Let me know if you have any further thoughts here.

Best regards,
Daniel

Thanks Daniel I’ll do that just in case :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.