I was looking at possible way to take a network device that has been offline for 45 days and have it change to Unmanaged. We have equipment that gets turned off, but not picked up from the site, so the network team does not want it removed from SW until it has been retrieved and checked back in.
Would probably have to write some custom scripts for this. I'm most comfortable in python and think you could set up a schedule to run the below once a day with some modifications
Might want to check this but here is a SWQL query that you could use to replace the example in the script above
#Only want the NodeID, Caption for the script just added the other stuff to help make it more obvious to what it is doing.
SELECT TOP 1000 NodeID, Caption, Status, StatusIcon, LastSystemUpTimePollUtc, GETUTCDATE() - 45 as checkWhere
where lastSystemUpTimePollUTC <= GETUTCDATE() - 45 and status = 2
order by lastSystemUpTimePollUTC desc
so instead of
results = swis.query('SELECT NodeID, Caption FROM Orion.Nodes WHERE IPAddress = @ip_addr', ip_addr='127.0.0.1')
you could put
results = swis.query('SELECT NodeID, Caption FROM Orion.Nodes where lastSystemUpTimePollUTC <= GETUTCDATE() - 45 and status = 2 order by lastSystemUpTimePollUTC desc)
This change could return more than one Node so you would need to create a way to loop through the results instead of just if results['results']
you would want
#loop through results and the swis.invoke here
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.