I am trying to automate the removal of nodes from SolarWinds. What I cannot seem to figure out is the best way to tell me how long a node has been down for.
My basic workflow is the following:
Determine list of nodes whose status is "Node is Down"
Check to see how long the node has been down for.
If it is greater than 3 days, unmanage the node and put a date time stamp into a custom property on the node
Check to see if the unmanaged node is responding to ping, if so remanage, if not see if the node has been unmanaged for more than 40 days
If node has been unmanaged for more than 40 days, check one more time to see if node is responsive, and if not remove the node from SolarWinds and write that to a file/event log/email etc for records.
Thanks in advance for your help on how to determine how long a node has been down for using the API