Removing or preventing duplicate RMM agents

We use ConnectWise Automate. I have a script to install on VM's when they're created and uninstall on VM's when they're destroyed. But Automate doesn't remove the agent in its database. When a Host Pool VM gets destroyed and re-created during auto-scaling, we get several duplicates in Automate. Have any of your other clients run into this problem? Have you seen a solution to this with some sort of combo of NERDIO scripts and Automate script?
1

Comments (3 comments)

Avatar
DStephenson

If you find a solution to this, we'd be interested in it.
We reached out to CW support on this, and they basically told us, "Not our problem".

I'm thinking if you can get a runbook to connect to the CW Automate DB and look for a duplicate name (with the same public IP address) and then only keep the agent with the latest check-in date, that may get you what you're wanting. Where it's going to get difficult is if you don't keep the same name when auto-scaling.

0
Avatar
Richard

You should be be able to use Connectwise Automate "callback" function to run the "retire" script on the old entry.  People have used this webhook function in power automate to do various things.  I would imagine Nerdio would need to store come credentials for the connection.  I have not really played with it.

0
Avatar
Dave Stephenson

Thanks, Richard.
I love it when new community members go out of their way to contribute to older posts! 🎉

It looks like Rewst has a way to do this (How to retire endpoints in one take with automation).
But, for those without Rewst, you could likely do this with a Scripted Action and the API Key stored as a Secure Variable in NMM.
I did a quick search with a GPT, and it was able to throw together a rough script.
If you have access to https://developer.connectwise.com, you could likely get the rest of the pieces you need to "Automate" the Automate Agent Abolishment😂 as part of your Run Scripted actions when host VM is REMOVED step of the AVD Host Pool Properties.

If anyone is going to be at NerdioCon, we could probably throw together an ad-hoc "Hackathon" and knock this out pretty quick. 🤓

 

 

 

0

Please sign in to leave a comment.