7 Replies Latest reply on Sep 23, 2016 1:38 PM by Steven Klassen

    How to set topology data polling interval ?

    james.w.troy

      Dear Sir or Madam -


      In SAM version 5.2, a node property was introduced called  "Poll for Topology Data Every [  ] minutes"  (on the GUI).

       

      I assume this property is only used if there is an associated poller for Layer 3 topology, correct ?

       

      When adding a node via the SWIS interface from Powershell, how do we set the value of this property ?

       

      I used SWQL and SQL Server Management Studio to look for the property in the Orion.Nodes, but I cannot find it.

       

      Thank you.

       

      James Troy

        • Re: How to set topology data polling interval ?
          zizi

          This setting applies to both L2 and L3 topology pollers. It is stored on per node basis in NodeSettings table. Setting name is "Core.TopologyPollInterval". You just need to create a new row with matching NodeID, SettingName and Value (in minutes).

           

          There is also a Orion-wide setting available in Settings table with SettingID "SWNetPerfMon-Settings-Default Node Topology Poll Interval". It might be also edited in GUI on Polling Setting page and it applies to all nodes, which have no custom "Core.TopologyPollInterval" specified in NodeSettings table.

            • Re: How to set topology data polling interval ?
              tdanner

              For "create a new row" in the NodeSettings table, the SWIS entity Orion.NodeSettings supports CRUD, so you can use the powershell New-SwisObject/Set-SwisObject cmdlets for handling that.

              1 of 1 people found this helpful
                • Re: How to set topology data polling interval ?
                  james.w.troy

                  Thank you, TDanner

                  • Re: How to set topology data polling interval ?
                    Steven Klassen

                    Hey tdanner - if I needed to update a Topology Polling Interval for a particular node, what would the Set-SwisObject cmdlet look like? What about if there was no previous Topology Polling Interval? What would the New-SwisObject look like?

                     

                    For example, if I were updating NodeID 2 there:

                    2016-09-23_11-10-07.png

                    I started to do something like Set-SwisObject $swis -EntityType 'Orion.NodeProperties' -Properties @{ SettingValue = 900 } and that's where I got stuck because there are more than one setting name aside from Core.TopologyPollInterval.

                     

                    Thanks in advance,

                     

                    /sk

                      • Re: How to set topology data polling interval ?
                        tdanner

                        Set-SwisObject expects a uri. Best way to get a uri is with a query:

                         

                        $uri = Get-SwisData $swis 'SELECT Uri FROM Orion.NodeSettings WHERE NodeID=@node AND SettingName=@setting' @{node=2; setting='Core.TopologyPollInterval'}
                        

                         

                        Then you can set the value:

                         

                        Set-SwisObject $swis $uri @{SettingValue=900}
                        

                         

                        If you needed to set some setting that didn't exist yet, that would look like this:

                         

                        New-SwisObject $swis Orion.NodeSettings @{NodeID=2;SettingName='Core.TopologyPollInterval';SettingValue=900}
                        

                         

                        You can combine the insert and update like this:

                         

                        Add-PSSnapin SwisSnapin
                        $swis = Connect-Swis -Certificate
                        
                        function Upsert-NodeSetting($nodeID, $setting, $value) {
                            $uri = Get-SwisData $swis 'SELECT Uri FROM Orion.NodeSettings WHERE NodeID=@node AND SettingName=@setting' @{node=$nodeID; setting=$setting}
                        
                            if ($uri) {
                                Set-SwisObject $swis $uri @{SettingValue=$value}
                            } else {
                                New-SwisObject $swis Orion.NodeSettings @{NodeID=$nodeID; SettingName=$setting; SettingValue=$value}
                            }
                        }
                        
                        Upsert-NodeSetting 2 'Core.TopologyPollInterval' 900