Quantcast
Channel: THWACK: All Content - Orion SDK
Viewing all articles
Browse latest Browse all 2677

More Automated Discovery

$
0
0

With a lot of help from some very knowledgeable people here I have managed to build a script for discovering network devices that works but, I have a few more questions.

1. Depending on the location and type of network device (router, switch, loadbalancer, firewall) I'm discovering, a different SNMP community string may be required. What I'm needing to confirm is wether this syntax will work in terms of having the discovery process attempt to use multiple credentials until it hits a working one.

2. If I wanted to create a second script that was for windows servers only (WMI), do I need these?

3. What can be done to push the agent for discovery/polling in the script

 

 

$CorePluginConfigurationContext = ([xml]"
    <CorePluginConfigurationContext xmlns='http://schemas.solarwinds.com/2012/Orion/Core' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
    <BulkList>
    <IpAddress><Address>$theAddress</Address></IpAddress>
    </BulkList>
    <Credentials>
     <SharedCredentialInfo>
      <CredentialID>6</CredentialID>
      <Order>1</Order>
      <CredentialID>3</CredentialID>
      <Order>2</Order>
      <CredentialID>4</CredentialID>
      <Order>3</Order>
      <CredentialID>5</CredentialID>
      <Order>4</Order>
      <CredentialID>10</CredentialID>
      <Order>5</Order>
      <CredentialID>9</CredentialID>
      <Order>6</Order>
     </SharedCredentialInfo>
    </Credentials>
    <WmiRetriesCount>1</WmiRetriesCount>
    <WmiRetryIntervalMiliseconds>15000</WmiRetryIntervalMiliseconds>
    </CorePluginConfigurationContext>
    ").DocumentElement

    $CorePluginConfiguration = Invoke-SwisVerb $swis Orion.Discovery CreateCorePluginConfiguration @($CorePluginConfigurationContext)
    $InterfacesPluginConfigurationContext = ([xml]"
    <InterfacesDiscoveryPluginContext xmlns='http://schemas.solarwinds.com/2008/Interfaces'
                                  xmlns:a='http://schemas.microsoft.com/2003/10/Serialization/Arrays'>
    <AutoImportStatus>
     <a:string>Up</a:string>
     <a:string>Down</a:string>
     <a:string>Shutdown</a:string>
    </AutoImportStatus>
    <AutoImportVirtualTypes>
     <a:string>Virtual</a:string>
     <a:string>Physical</a:string>
    </AutoImportVirtualTypes>
    <AutoImportVlanPortTypes>
     <a:string>Trunk</a:string>
     <a:string>Access</a:string>
     <a:string>Unknown</a:string>
    </AutoImportVlanPortTypes>
    <UseDefaults>true</UseDefaults>
    </InterfacesDiscoveryPluginContext>
    ").DocumentElement

    $InterfacesPluginConfiguration = Invoke-SwisVerb $swis Orion.NPM.Interfaces CreateInterfacesPluginConfiguration @($InterfacesPluginConfigurationContext)
    $DeleteProfileAfterDiscoveryCompletes = "false"
    $StartDiscoveryContext = ([xml]"
    <StartDiscoveryContext xmlns='http://schemas.solarwinds.com/2012/Orion/Core' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
     <Name> $theAddress $([DateTime]::Now)</Name>
     <EngineId>$EngineID</EngineId>
     <JobTimeoutSeconds>3600</JobTimeoutSeconds>
     <SearchTimeoutMiliseconds>2500</SearchTimeoutMiliseconds>
     <SnmpTimeoutMiliseconds>2500</SnmpTimeoutMiliseconds>
     <SnmpRetries>1</SnmpRetries>
     <RepeatIntervalMiliseconds>2500000</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>$($CorePluginConfiguration.InnerXml)</PluginConfigurationItem>
       <PluginConfigurationItem>$($InterfacesPluginConfiguration.InnerXml)</PluginConfigurationItem>
      </PluginConfiguration>
     </PluginConfigurations>
    </StartDiscoveryContext>


Viewing all articles
Browse latest Browse all 2677

Trending Articles



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