1 Reply Latest reply on Oct 9, 2014 6:08 AM by madhavan

    Creating discoveries using subnets

    dkeyser

      I'm hoping this is a simple question for those that know how to do this. I'm looking to use the SDK to create discoveries for Subnets now. I've been using it to import single nodes on demand from CSV or parameter passing to my PowerShell script. I'm not seeing any info on what is required to get it to discover using the Subnets section of the CreateCorePluginConfiguration verb. Checking in the DB I'm seeing that of course I'll need the subnet IPs and masks but how are those added into the XML. Single IP addresses are converted from <IPAddress><Address>1.1.1.1</Address></IPAddress> to <String>1.1.1.1</String> so it's not readily evident what <a:SubnetIP> and <a:SubnetMask> was converted from.

       

      Any help is always appreciated!

        • Re: Creating discoveries using subnets
          madhavan

          Hi,

           

          I used the below provided PS sample. Let me know if this solves your need.

           

          $xmlParam = ([xml]"

              <CorePluginConfigurationContext xmlns:i='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://schemas.solarwinds.com/2012/Orion/Core'>

                  <BulkList />

                  <IpRanges />

                  <Subnets>

                      <AddressSubnet><SubnetIP>XX.XXX.X.XXX</SubnetIP><SubnetMask>255.255.0.0</SubnetMask></AddressSubnet>

                  </Subnets>

                  <Credentials />

                  <WmiRetriesCount>0</WmiRetriesCount>

                  <WmiRetryIntervalMiliseconds>0</WmiRetryIntervalMiliseconds>

              </CorePluginConfigurationContext>"

              ).DocumentElement

           

          $PlugInConfiguration = Invoke-SwisVerb $swis "Orion.Discovery" "CreateCorePluginConfiguration" @($xmlParam)

          $coreCfgText = $PlugInConfiguration.InnerXml

           

           

          $startDiscoveryParam = ([xml]@("

              <StartDiscoveryContext xmlns:i='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://schemas.solarwinds.com/2012/Orion/Core'>

                <Name>AutomaticDiscovery2</Name>

                <EngineId>1</EngineId>

                <JobTimeoutSeconds>3600</JobTimeoutSeconds>

                <SearchTimeoutMiliseconds>2000</SearchTimeoutMiliseconds>

                <SnmpTimeoutMiliseconds>2000</SnmpTimeoutMiliseconds>

                <SnmpRetries>1</SnmpRetries>

                <RepeatIntervalMiliseconds>1500</RepeatIntervalMiliseconds>

                <SnmpPort>161</SnmpPort>

                <HopCount>0</HopCount>

                <PreferredSnmpVersion>SNMP2c</PreferredSnmpVersion>

                <DisableIcmp>false</DisableIcmp>

                <AllowDuplicateNodes>false</AllowDuplicateNodes>

                <IsAutoImport>true</IsAutoImport>

                <IsHidden>false</IsHidden>

                <PluginConfigurations>",

                  "<PluginConfiguration>

                      <PluginConfigurationItem>$coreCfgText</PluginConfigurationItem>

                  </PluginConfiguration>",

                "</PluginConfigurations>

              </StartDiscoveryContext>"

              )).DocumentElement

           

           

          Invoke-SwisVerb $swis "Orion.Discovery" "StartDiscovery" @($startDiscoveryParam) | Out-Null