This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Automate adding a discovery profile

Hello,

I want to automate adding scheduled discovery profiles.

I am new to Orion and have been tasked with creating a-lot of discovery profiles.  I opened a support ticket with Solarwinds support and they directed me to the SDK for this job.

https://thwack.solarwinds.com/thread/39001

Here is our manual process for creating Discovery Profiles...

Network Sonar Discovery > Add New Discovery > SNMP Credential are listed (Next) > VMware: "Poll for VMware" is checked and the credentials are listed (Next) > Windows Credentials are not listed and must be added (Next) > Network Selection Method is "Subnets" > Add a New Subnet (I enter Subnet Address/Mask) (Next) > Enter Description (Next) > Some of our Discoveries are scheduled Daily some Weekly with the "Advanced" option (Schedule)

I want to automate adding these scheduled discovery profiles with powershell.  I have installed the SDK and have used the Get-SwisData cmdlet to query the Orion database.  I have seen some examples here on thwack related to automatically creating discoveries with powershell but they are using XML input.  I am having trouble finding the XML templates mentioned to review the options I might have?  Can someone help me with this task?

Thanks,

Jeremy

Parents
  • Did anyone ever direct you to a workable template or example?

  • I apologize for the very late reply.  I have created our discovery in powershell and it has been working good.  Luckily, I found everything that I needed here on thwack.  I still struggle with some things.  Like finding a comprehensive list of swis verbs and navigating the schema.

    I have reviewed the wiki and the schema documentation but I am not a programmer.  I understand entity relationship diagrams, SWQL syntax and shell scripting like powershell.

    Home · solarwinds/OrionSDK Wiki · GitHub

    SolarWinds Information Service v3.0 Schema Documentation Index

    When you guys build these xml things I don't understand where you find the values.  For example, where did "<SharedCredentialInfo>" come from?  I see the Orion.Credential table and filled in the ids from there but I never would have gotten there by myself if I did not have the thwack example.

    $CoreParameter = ([xml]"<CorePluginConfigurationContext xmlns:i='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://schemas.solarwinds.com/2012/Orion/Core'>

    <BulkList >

    $build

    </BulkList>

      <Credentials>   

        <SharedCredentialInfo>

        <CredentialID>7</CredentialID>

        <Order>1</Order>

        </SharedCredentialInfo>

        <SharedCredentialInfo>

        <CredentialID>14</CredentialID>

        <Order>2</Order>

        </SharedCredentialInfo>

        <SharedCredentialInfo>

        <CredentialID>23</CredentialID>

        <Order>3</Order>

        </SharedCredentialInfo>

        <SharedCredentialInfo>

        <CredentialID>24</CredentialID>

        <Order>4</Order>

        </SharedCredentialInfo>

        <SharedCredentialInfo>

        <CredentialID>4</CredentialID>

        <Order>5</Order>

        </SharedCredentialInfo>

        <SharedCredentialInfo>

        <CredentialID>6</CredentialID>

        <Order>6</Order>

        </SharedCredentialInfo>

        <SharedCredentialInfo>

        <CredentialID>3</CredentialID>

        <Order>7</Order>

        </SharedCredentialInfo>

      </Credentials>

    <WmiRetriesCount>1</WmiRetriesCount>

    <WmiRetryIntervalMiliseconds>2000</WmiRetryIntervalMiliseconds>

    </CorePluginConfigurationContext>").DocumentElement

    $CoreConfig = Invoke-SwisVerb $swis "Orion.Discovery" "CreateCorePluginConfiguration" @($CoreParameter)

    $CoreConfigInnerPiece = $coreConfig.InnerXml

    $StartDiscoveryCfg = ([xml]"

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

      <Name>$DiscoveryName</Name>

      <EngineId>1</EngineId>

      <JobTimeoutSeconds>36000</JobTimeoutSeconds>

      <SearchTimeoutMiliseconds>100</SearchTimeoutMiliseconds>

      <SnmpTimeoutMiliseconds>500</SnmpTimeoutMiliseconds>

      <SnmpRetries>1</SnmpRetries>

      <RepeatIntervalMiliseconds>1800000</RepeatIntervalMiliseconds>

      <SnmpPort>161</SnmpPort>

      <HopCount>0</HopCount>

      <PreferredSnmpVersion>SNMP2c</PreferredSnmpVersion>

      <DisableIcmp>false</DisableIcmp>

      <AllowDuplicateNodes>false</AllowDuplicateNodes>

      <IsAutoImport>false</IsAutoImport>

      <ImportUpInterface>false</ImportUpInterface>

      <ImportDownInterface>false</ImportDownInterface>

      <ImportShutdownInterface>false</ImportShutdownInterface>

      <IsHidden>false</IsHidden>

      <PluginConfigurations>

        <PluginConfiguration>

            <PluginConfigurationItem>$CoreConfigInnerPiece</PluginConfigurationItem>

        </PluginConfiguration>

      </PluginConfigurations>

    </StartDiscoveryContext>"

    ).DocumentElement

    $out = Invoke-SwisVerb $swis "Orion.Discovery" "StartDiscovery" @($StartDiscoveryCfg)

    $output = $out.innerxml

Reply
  • I apologize for the very late reply.  I have created our discovery in powershell and it has been working good.  Luckily, I found everything that I needed here on thwack.  I still struggle with some things.  Like finding a comprehensive list of swis verbs and navigating the schema.

    I have reviewed the wiki and the schema documentation but I am not a programmer.  I understand entity relationship diagrams, SWQL syntax and shell scripting like powershell.

    Home · solarwinds/OrionSDK Wiki · GitHub

    SolarWinds Information Service v3.0 Schema Documentation Index

    When you guys build these xml things I don't understand where you find the values.  For example, where did "<SharedCredentialInfo>" come from?  I see the Orion.Credential table and filled in the ids from there but I never would have gotten there by myself if I did not have the thwack example.

    $CoreParameter = ([xml]"<CorePluginConfigurationContext xmlns:i='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://schemas.solarwinds.com/2012/Orion/Core'>

    <BulkList >

    $build

    </BulkList>

      <Credentials>   

        <SharedCredentialInfo>

        <CredentialID>7</CredentialID>

        <Order>1</Order>

        </SharedCredentialInfo>

        <SharedCredentialInfo>

        <CredentialID>14</CredentialID>

        <Order>2</Order>

        </SharedCredentialInfo>

        <SharedCredentialInfo>

        <CredentialID>23</CredentialID>

        <Order>3</Order>

        </SharedCredentialInfo>

        <SharedCredentialInfo>

        <CredentialID>24</CredentialID>

        <Order>4</Order>

        </SharedCredentialInfo>

        <SharedCredentialInfo>

        <CredentialID>4</CredentialID>

        <Order>5</Order>

        </SharedCredentialInfo>

        <SharedCredentialInfo>

        <CredentialID>6</CredentialID>

        <Order>6</Order>

        </SharedCredentialInfo>

        <SharedCredentialInfo>

        <CredentialID>3</CredentialID>

        <Order>7</Order>

        </SharedCredentialInfo>

      </Credentials>

    <WmiRetriesCount>1</WmiRetriesCount>

    <WmiRetryIntervalMiliseconds>2000</WmiRetryIntervalMiliseconds>

    </CorePluginConfigurationContext>").DocumentElement

    $CoreConfig = Invoke-SwisVerb $swis "Orion.Discovery" "CreateCorePluginConfiguration" @($CoreParameter)

    $CoreConfigInnerPiece = $coreConfig.InnerXml

    $StartDiscoveryCfg = ([xml]"

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

      <Name>$DiscoveryName</Name>

      <EngineId>1</EngineId>

      <JobTimeoutSeconds>36000</JobTimeoutSeconds>

      <SearchTimeoutMiliseconds>100</SearchTimeoutMiliseconds>

      <SnmpTimeoutMiliseconds>500</SnmpTimeoutMiliseconds>

      <SnmpRetries>1</SnmpRetries>

      <RepeatIntervalMiliseconds>1800000</RepeatIntervalMiliseconds>

      <SnmpPort>161</SnmpPort>

      <HopCount>0</HopCount>

      <PreferredSnmpVersion>SNMP2c</PreferredSnmpVersion>

      <DisableIcmp>false</DisableIcmp>

      <AllowDuplicateNodes>false</AllowDuplicateNodes>

      <IsAutoImport>false</IsAutoImport>

      <ImportUpInterface>false</ImportUpInterface>

      <ImportDownInterface>false</ImportDownInterface>

      <ImportShutdownInterface>false</ImportShutdownInterface>

      <IsHidden>false</IsHidden>

      <PluginConfigurations>

        <PluginConfiguration>

            <PluginConfigurationItem>$CoreConfigInnerPiece</PluginConfigurationItem>

        </PluginConfiguration>

      </PluginConfigurations>

    </StartDiscoveryContext>"

    ).DocumentElement

    $out = Invoke-SwisVerb $swis "Orion.Discovery" "StartDiscovery" @($StartDiscoveryCfg)

    $output = $out.innerxml

Children
No Data