2 Replies Latest reply on Feb 8, 2014 12:08 PM by derhally

    Unexpected query results via Orion SDK 1.8 / PowerShell

    scottfraley

      Hi all,

       

      Ok, so I have a quandry from the guy who integrates our network automation PS scripts into/onto the production boxen.

       

        So I did a little testing on this and got some unexpected results.

        I used the Get-SwisData command directly using the same queries that we embedded in the functions, and surprisingly the device status seldom changes from ChildStatus = 1, StatusName = Up.  Even when the device and interface were fully Unmanaged the query still returned these two values.

        Only if you are quick – and I mean really quick – and run the query at the right time just after the device has been set back to Manage, will you see it flip to ChildStatus = 0, StatusName = ‘Unknown’


        [<OurServerName>]: PS C:\Users\Uzer\Documents> $QueryToUse
        SELECT N.ChildStatus, SI.StatusName FROM Orion.Nodes N INNER JOIN Orion.StatusInfo SI ON SI.StatusId = N.ChildStatus WHERE N.NodeID = '915'
        [<OurServerName>]: PS C:\Users\Uzer\Documents> $result = Get-SwisData $swis $QueryToUse
        [<OurServerName>]: PS C:\Users\Uzer\Documents> $result

      ChildStatus StatusName
      ----------- ----------
           1 Up

        [<OurServerName>]: PS C:\Users\Uzer\Documents> $result = Get-SwisData $swis $QueryToUse
        [<OurServerName>]: PS C:\Users\Uzer\Documents> $result

      ChildStatus StatusName
      ----------- ----------
           1 Up

        [<OurServerName>]: PS C:\Users\Uzer\Documents> $result = Get-SwisData $swis $QueryToUse
        [<OurServerName>]: PS C:\Users\Uzer\Documents> $result

      ChildStatus StatusName
      ----------- ----------
           1 Up

        [<OurServerName>]: PS C:\Users\Uzer\Documents> $result = Get-SwisData $swis $QueryToUse
        [<OurServerName>]: PS C:\Users\Uzer\Documents> $result

      ChildStatus StatusName
      ----------- ----------
           0 Unknown

        [<OurServerName>]: PS C:\Users\Uzer\Documents> $result = Get-SwisData $swis $QueryToUse
        [<OurServerName>]: PS C:\Users\Uzer\Documents> $result

      ChildStatus StatusName
      ----------- ----------
           1 Up

       

      Is this expected behavior, or am I looking in the 'wrong place' for this info?


      Thanks,
      Scott Fraley