Quantcast
Channel: THWACK: Popular Discussions - Orion SDK
Viewing all articles
Browse latest Browse all 3719

Unexpected query results via Orion SDK 1.8 / PowerShell

$
0
0

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


Viewing all articles
Browse latest Browse all 3719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>