Maintaining offline/dead servers

Hi Octopus team!

i’m looking for a way, how to maintain the servers in octopus which are dead(showing as offline). Since many servers gets replaced/destroyed and many people/teams are involved in this, so it’s really hard to keep up what is happening and keep track of this to remove servers from octopus too. My idea was to generate some kind of report, by getting information when the server was last time online/active. Right now, i don’t see that it is possible. You can get via /api/machines/machine-1/connection “LastChecked” field, but basically it’s not what i need

I need to know, when the last time server was active/online, to remove it if it’s offline for one month. Any suggestions how i could accomplish this? I was thinking that maybe getting information when the last time the release was deployed by particular server which is now offline to get the date, but it seems it would require matching roles and etc to identify which server/servers participated in the deployment so it’s quite big work to write a script for this…

Any suggestions would be appreciated!

Hi @fog,

Thanks for reaching out.

We’ve just released the beta of Octopus 3.4 which has a feature called “Machine Policies” that’ll fit perfectly here. It’ll basically allow you to say “Delete this machine if it has been offline for X hours”. You can read more about it at the bottom of this doc:

We are currently in Beta1 for 3.4, and aiming for another beta in a couple of weeks, and then RTM a few weeks after that.

I strongly suggest you to download the beta, install it a separate server and play around with it to see if it might fit your needs. Being so close to releasing this version, I can’t recommend you to script your way through this right now.

That said, if you strongly need to script it now, let me know and I’ll give you a hand.

Best regards,

Cheers Dalmiro! This is exactly what i need. Glad i asked before trying to figure out the scripted way:) btw, will it allow to to set for example 168 hours (7 days)? Or just maximum 24 hours? I mean sometimes there could be issues with tenticle itself that will be addressed manually and nobody really might notice issues with it once next deployment happens. And deployment sometimes happens once per week/2 weeks (based on project) so it would be cool to have possibility to set more hours/days for this option to work. In description it doesnt state if there will be any limit how many hours max it will support

Hi There,

I double checked this with one of the devs currently working on that feature, just to make sure I got the right answer for anyone else running into this thread.

See that attached screenshot. You’ll like the answer :wink:

Spoiler: you wont have problems with the limit.