Using PowerShell and the API to clean-up down volumes and find new volumes for those devices.
I don't know about yourselves, but we suffer with volumes reporting as down and Orion not picking up on their new instances automatically.
We think this is down to VM migrations or just configuration changes.
I used to go through a process of using SQL to find the dead volumes, then going to Node Manager, removing the down volumes and then running List Resources against the node to pick up on the new drive instances. This was a long winded and slow process, with an average of 140 down volumes found every week.
So I thought to myself, this needs some automation!
1. Find the down Volumes with a bit of SWQL
2. Remove these volumes using the API
3. Create URLs for each NodeID (found with down volumes) to open the 'List Resources' in a internet browser, with auto-refresh, so that you can manually select the volumes.
As you can't do this via the API yet.
So here's a PowerShell script, that hopefully you can use to assist you.
Relies on having Chrome installed, to change from chrome.exe, delete the Stat-Process chrome.exe line and un-comment the iexplorer.exe line underneath.
The SELECT statement is limited to the first 10 down volumes, this limits the script to opening 10 List Resources at a time. You may want to increase or decrease this number.
Please ensure that you test this, somewhere safe, as I wouldn't want you to break anything.
# Description: SWIS PowerShell to find , then delete and then open the List Resources for that Node, so we can reselect the hard drives manually.
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community.
More than 150,000 members are here to solve problems, share technology and best practices, and directly
contribute to our product development process.
Learn more today by joining now.