1 Reply Latest reply on Jan 3, 2012 3:44 PM by tdanner

    Unmanage & Remanage verbs do not update in SDK 1.3 w/ NPM 10.2

    jgoldber13

      I've installed the 1.3 SDK and have written a Powershell script to unmanage and remanage nodes using the provided Verbs:

      Unmanage:

          $nodename=$args[0]

         $nodeid = Get-SwisData $swis "SELECT NodeID FROM Orion.Nodes WHERE SysName like '$nodename' or IP_Address like '$nodename'"

         $now=[DateTime]::Now

         $later=$now.AddMinutes(15)

         Invoke-SwisVerb $swis Orion.Nodes Unmanage @("N:$nodeid",$now,$later,"false")

      Remanage:

         Invoke-SwisVerb $swis Orion.Nodes Remanage @("N:$nodeid")

      When using "Unmanage", the Nodes.Status column in the database stays set to 9 and Node.GroupStatus remains as "Down.gif" even after Node.Unmanaged is set to 0 after 15 minutes.

      Similarly, when using "Remanage", the Nodes.Status column in the database stays set to 0 and Node.GroupStatus remains as "Unknown.gif" even though Node.Unmanaged is set to 0.

      Additionally, I am getting Node Down alerts for Nodes that have been Unmanaged through the PowerShell script.

      I had previously been using my own Perl script to modify the database:

       

         $sql = "UPDATE Nodes SET Status=9, UnManageUntil='" . $endtime . "' WHERE NodeID = $nodeid";

       

      As of 10.2 my own script stopped working, and SolarWinds support staff suggested I move to use the API.  In the event, it's no better - and actually a little worse - to use the API!

       

      I'm looking to see if anyone's run into this and found a solution, or if the SolarWinds development team can help with this.

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

      (Background info for those who may find the approach useful)

      We have > 2000 hosts that are monitored with SolarWinds, most of which are on a weekly reboot job.  So that we don't get spurious alerts for machines that are rebooted like this (or rebooted in an orderly fashion by an SA rather than crashing), we have set up:

       - An init script that on shutdown logs an "orderly shutdown" event via syslog

       - Orion NPM receives these log messages, and has a filter rule that executes our unmanage script with "${Hostname}" as an argument

       - This takes our servers out of monitoring for 15 minutes so we don't get alerted on scheduled reboots or those that we already know about.

      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

       

      Thanks in advance for any help!

       

           Cheers

           Jay

        • Re: Unmanage & Remanage verbs do not update in SDK 1.3 w/ NPM 10.2
          tdanner

          Do the normal unmanage/remanage commands in the website work correctly for you?

          I made a fresh install of NPM 10.2 and SDK 1.3 to test this scenario and the Unmanage/Remanage verbs worked correctly for me.

          When you call Remanage, how long does the Status stay at 0 (Unknown)? It is normal for the node status to be 0 for a minute or two after Remanage. Remanage (or the expiration of the unmanage interval) does not cause the node to be polled immediately - it just schedules it for polling.