Network discovery through rest api

So I am trying to see how far I can take the rest api for the network discovery.   I have found the below links as well as a few on thwack that all pretty much have about the same level of information.   

Just a note I only have NPM, NCM, and SAM at the moment, important latter on for the configuration profiles later on. 

We can schedule a network discovery via the API however the only things we can setup is the Core plugin configuration which going off the example lets us specify

IP Address bulk list
IP Ranges
Subnets 
Credentials to use to scan 
WMI Retry count
WMI Retry interval

We then need to setup the Interface plugin configuration and this allows us to specify the types of interfaces to improt 

Status [Up | Down | Shutdown]
Type [Virtual | Physical]
VLAN Type [Trunk | Access | Unknown]

Also we can specify if we just use the Default settings which then ignores the above settings. 

Finally we need to combine these and specify a few other settings to build the actual discovery profile. 

What polling engine to run against 
Should the profile be deleted after it completes
Name for the discovery profile
Job timeout 
Search timeout
SNMP timeout
SNMP retries
Repeat Interval
SNMP Port
Hop Count
What SNMP version to use
Import if only ICMP
If duplicate nodes are allowed

So after this we can then combine all these and run the base discovery via the rest API. 

Now stating all this, I did some digging and finally found the actual complete XML for the full discovery profile after its built.  It is saved in the SQL database, however not accessible via the SWQL infrastructure so either their database manager or full SQL management studio to get to it.   

Its in the DiscoveryProfiles table, look at the "PluginConfigurations" field.

Now with all this in hand i built a in application WMI scan using just the Active Directory search for the nodes to discover.   After I ran the initial scan I pulled out the XML and discovered there are additional configuration files that can be used. 

Dumped as is from the XML i see 

SolarWinds.Orion.Core.Models.Discovery.CoreDiscoveryPluginConfiguration,SolarWinds.Orion.Core.Models.V1
SolarWinds.VIM.Common.Configuration.VimDiscoveryPluginConfiguration,SolarWinds.VIM.Common
SolarWinds.NCM.Contracts.Discovery.NcmDiscoveryPluginConfiguration,SolarWinds.NCM.Contracts
SolarWinds.Interfaces.Common.Models.Discovery.InterfacesDiscoveryPluginConfiguration,SolarWinds.Interfaces.Common
SolarWinds.APM.BlackBox.Sql.Common.Models.Discovery.ApmBlackBoxSqlDiscoveryPluginConfiguration,SolarWinds.APM.BlackBox.Sql.Common
SolarWinds.APM.BlackBox.Exchg.Common.Models.Discovery.ExchangeDiscoveryPluginConfiguration,SolarWinds.APM.BlackBox.Exchg.Common
SolarWinds.APM.BlackBox.Wstm.Common.Models.Discovery.DiscoveryPluginConfiguration,SolarWinds.APM.BlackBox.Wstm.Common
SolarWinds.APM.BlackBox.IIS.Common.Models.Discovery.IISDiscoveryPluginConfiguration,SolarWinds.APM.BlackBox.IIS.Common
SolarWinds.APM.BlackBox.ActiveDirectory.Common.Models.Discovery.ActiveDirectoryDiscoveryPluginConfiguration,SolarWinds.APM.BlackBox.ActiveDirectory.Common

So it looks like we can a config for the app insight tools: SQL, Exchange, IIS and, Active Directory

Also there looks to be a config for Virtual infrastructure and the NCM module.  

Not sure what the WSTM is at the moment 

And finally looks like the Core and Interface configs are listed as expected.  

So with all this information now, does anyone know what the WSTM config is for and do we have a template for the other plugin configuration templates so that we could script this all out by chance?  Being that some are listed as "BlackBox" not sure if there is anything we can get but want to ask. 

I'm also trying to figure out if its possible via the API to work with the discovery ignore list, I found a link that had some direct SQL manipulation.  Can go down this route if possible but would like to keep it API based if possible. 

Parents
  • I inherited a script from a predecessor that had some level of config for the plugin discovery - I'm amazed at how little documentation there is on this. I'll add in below the small amount we have.  I've been struggling to find a way to modify this to stop the discovery from applying AppInsight for IIS, and Windows Scheduled Task monitors.  Right now I just go into our application list every few months and delete the items out..

    The VIM xml config that I already had in my powershell discovery scripts:

    $vimParam = ([xml]"
    <VimPluginConfigurationContext xmlns:i='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://schemas.solarwinds.com/2012/Orion/VIM'>
      <Enabled>true</Enabled>
      <Credentials>
        <SharedCredentialInfo>
            <CredentialID>56</CredentialID>        
        </SharedCredentialInfo>       
      </Credentials>
    </VimPluginConfigurationContext>"
    ).DocumentElement
    
    $vimCfg = Invoke-SwisVerb $swis "Orion.VIM.Discovery" "CreateVimPluginConfiguration" @($vimParam)
    $vimCfgText = $vimCfg.InnerXml

    I looked at the DB table you referenced (DiscoveryProfiles table, column "PluginConfigurations") and compared the XML for a discovery created via powershell (that has all of the 'applications' configured to discover/import) vs one created via UI (that has none of the applications configutd to discover/import). This is the relevant XML that I found different; this being from the discovery created by UI that has the applications disabled as well as interfaces disabled.

    <ArrayOfDiscoveryPluginConfigurationBase xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SolarWinds.Orion.Core.Models.Discovery">
    	<DiscoveryPluginConfigurationBase xmlns:d2p1="http://schemas.solarwinds.com/2008/Orion" i:type="d2p1:CoreDiscoveryPluginConfiguration">
            <d2p1:AutoImportVolumeTypes xmlns:d3p1="http://schemas.datacontract.org/2004/07/SolarWinds.Common.Snmp">
    			<d3p1:VolumeType>FixedDisk</d3p1:VolumeType>
    			<d3p1:VolumeType>FlashMemory</d3p1:VolumeType>
    			<d3p1:VolumeType>MountPoint</d3p1:VolumeType>
    			<d3p1:VolumeType>Other</d3p1:VolumeType>
    			<d3p1:VolumeType>RAM</d3p1:VolumeType>
    			<d3p1:VolumeType>RAMDisk</d3p1:VolumeType>
    		</d2p1:AutoImportVolumeTypes>
    	</DiscoveryPluginConfigurationBase>
    
    	<DiscoveryPluginConfigurationBase xmlns:d2p1="http://schemas.solarwinds.com/2008/Interfaces" i:type="d2p1:InterfacesDiscoveryPluginConfiguration">
    		<d2p1:AutoImportExpressionFilter xmlns:d3p1="http://schemas.datacontract.org/2004/07/">
    			<d3p1:InterfaceFiltering.Expression>
    				<d3p1:Op>any</d3p1:Op>
    				<d3p1:Prop>type</d3p1:Prop>
    				<d3p1:Val>
    				</d3p1:Val>
    			</d3p1:InterfaceFiltering.Expression>
    		</d2p1:AutoImportExpressionFilter>
    		<d2p1:AutoImportStatus xmlns:d3p1="http://schemas.datacontract.org/2004/07/SolarWinds.Interfaces.Common.Enums" />
    		<d2p1:AutoImportVirtualTypes xmlns:d3p1="http://schemas.datacontract.org/2004/07/System" />
    		<d2p1:AutoImportVlanPortTypes xmlns:d3p1="http://schemas.datacontract.org/2004/07/SolarWinds.Orion.Core.Models.Enums" />
    	</DiscoveryPluginConfigurationBase>
    	<DiscoveryPluginConfigurationBase xmlns:d2p1="http://schemas.solarwinds.com/2007/08/APM" i:type="d2p1:ApmBlackBoxSqlDiscoveryPluginConfiguration">
    		<d2p1:EnableAutoImport>false</d2p1:EnableAutoImport>
    	</DiscoveryPluginConfigurationBase>
    	<DiscoveryPluginConfigurationBase xmlns:d2p1="http://schemas.solarwinds.com/2007/08/APM" i:type="d2p1:ExchangeDiscoveryPluginConfiguration">
    		<d2p1:EnableAutoImport>false</d2p1:EnableAutoImport>
    	</DiscoveryPluginConfigurationBase>
    	<DiscoveryPluginConfigurationBase xmlns:d2p1="http://schemas.solarwinds.com/2007/08/APM" i:type="d2p1:DiscoveryPluginConfiguration">
    		<d2p1:EnableAutoImport>false</d2p1:EnableAutoImport>
    	</DiscoveryPluginConfigurationBase>
    	<DiscoveryPluginConfigurationBase xmlns:d2p1="http://schemas.solarwinds.com/2007/08/APM" i:type="d2p1:IISDiscoveryPluginConfiguration">
    		<d2p1:EnableAutoImport>false</d2p1:EnableAutoImport>
    	</DiscoveryPluginConfigurationBase>
    	<DiscoveryPluginConfigurationBase xmlns:d2p1="http://schemas.solarwinds.com/2007/08/APM" i:type="d2p1:ActiveDirectoryDiscoveryPluginConfiguration">
    		<d2p1:EnableAutoImport>false</d2p1:EnableAutoImport>
    	</DiscoveryPluginConfigurationBase>

    I'm going to attempt modifying my powershell XML config for the VIM Plugin discovery portion to disable interfaces and application discovery, and see if it works.  I will post back here if I get further.

Reply
  • I inherited a script from a predecessor that had some level of config for the plugin discovery - I'm amazed at how little documentation there is on this. I'll add in below the small amount we have.  I've been struggling to find a way to modify this to stop the discovery from applying AppInsight for IIS, and Windows Scheduled Task monitors.  Right now I just go into our application list every few months and delete the items out..

    The VIM xml config that I already had in my powershell discovery scripts:

    $vimParam = ([xml]"
    <VimPluginConfigurationContext xmlns:i='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://schemas.solarwinds.com/2012/Orion/VIM'>
      <Enabled>true</Enabled>
      <Credentials>
        <SharedCredentialInfo>
            <CredentialID>56</CredentialID>        
        </SharedCredentialInfo>       
      </Credentials>
    </VimPluginConfigurationContext>"
    ).DocumentElement
    
    $vimCfg = Invoke-SwisVerb $swis "Orion.VIM.Discovery" "CreateVimPluginConfiguration" @($vimParam)
    $vimCfgText = $vimCfg.InnerXml

    I looked at the DB table you referenced (DiscoveryProfiles table, column "PluginConfigurations") and compared the XML for a discovery created via powershell (that has all of the 'applications' configured to discover/import) vs one created via UI (that has none of the applications configutd to discover/import). This is the relevant XML that I found different; this being from the discovery created by UI that has the applications disabled as well as interfaces disabled.

    <ArrayOfDiscoveryPluginConfigurationBase xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SolarWinds.Orion.Core.Models.Discovery">
    	<DiscoveryPluginConfigurationBase xmlns:d2p1="http://schemas.solarwinds.com/2008/Orion" i:type="d2p1:CoreDiscoveryPluginConfiguration">
            <d2p1:AutoImportVolumeTypes xmlns:d3p1="http://schemas.datacontract.org/2004/07/SolarWinds.Common.Snmp">
    			<d3p1:VolumeType>FixedDisk</d3p1:VolumeType>
    			<d3p1:VolumeType>FlashMemory</d3p1:VolumeType>
    			<d3p1:VolumeType>MountPoint</d3p1:VolumeType>
    			<d3p1:VolumeType>Other</d3p1:VolumeType>
    			<d3p1:VolumeType>RAM</d3p1:VolumeType>
    			<d3p1:VolumeType>RAMDisk</d3p1:VolumeType>
    		</d2p1:AutoImportVolumeTypes>
    	</DiscoveryPluginConfigurationBase>
    
    	<DiscoveryPluginConfigurationBase xmlns:d2p1="http://schemas.solarwinds.com/2008/Interfaces" i:type="d2p1:InterfacesDiscoveryPluginConfiguration">
    		<d2p1:AutoImportExpressionFilter xmlns:d3p1="http://schemas.datacontract.org/2004/07/">
    			<d3p1:InterfaceFiltering.Expression>
    				<d3p1:Op>any</d3p1:Op>
    				<d3p1:Prop>type</d3p1:Prop>
    				<d3p1:Val>
    				</d3p1:Val>
    			</d3p1:InterfaceFiltering.Expression>
    		</d2p1:AutoImportExpressionFilter>
    		<d2p1:AutoImportStatus xmlns:d3p1="http://schemas.datacontract.org/2004/07/SolarWinds.Interfaces.Common.Enums" />
    		<d2p1:AutoImportVirtualTypes xmlns:d3p1="http://schemas.datacontract.org/2004/07/System" />
    		<d2p1:AutoImportVlanPortTypes xmlns:d3p1="http://schemas.datacontract.org/2004/07/SolarWinds.Orion.Core.Models.Enums" />
    	</DiscoveryPluginConfigurationBase>
    	<DiscoveryPluginConfigurationBase xmlns:d2p1="http://schemas.solarwinds.com/2007/08/APM" i:type="d2p1:ApmBlackBoxSqlDiscoveryPluginConfiguration">
    		<d2p1:EnableAutoImport>false</d2p1:EnableAutoImport>
    	</DiscoveryPluginConfigurationBase>
    	<DiscoveryPluginConfigurationBase xmlns:d2p1="http://schemas.solarwinds.com/2007/08/APM" i:type="d2p1:ExchangeDiscoveryPluginConfiguration">
    		<d2p1:EnableAutoImport>false</d2p1:EnableAutoImport>
    	</DiscoveryPluginConfigurationBase>
    	<DiscoveryPluginConfigurationBase xmlns:d2p1="http://schemas.solarwinds.com/2007/08/APM" i:type="d2p1:DiscoveryPluginConfiguration">
    		<d2p1:EnableAutoImport>false</d2p1:EnableAutoImport>
    	</DiscoveryPluginConfigurationBase>
    	<DiscoveryPluginConfigurationBase xmlns:d2p1="http://schemas.solarwinds.com/2007/08/APM" i:type="d2p1:IISDiscoveryPluginConfiguration">
    		<d2p1:EnableAutoImport>false</d2p1:EnableAutoImport>
    	</DiscoveryPluginConfigurationBase>
    	<DiscoveryPluginConfigurationBase xmlns:d2p1="http://schemas.solarwinds.com/2007/08/APM" i:type="d2p1:ActiveDirectoryDiscoveryPluginConfiguration">
    		<d2p1:EnableAutoImport>false</d2p1:EnableAutoImport>
    	</DiscoveryPluginConfigurationBase>

    I'm going to attempt modifying my powershell XML config for the VIM Plugin discovery portion to disable interfaces and application discovery, and see if it works.  I will post back here if I get further.

Children
  • How did it go?
    I am building out discovery profile creation scripts in PowerShell also.

    Samples of XML containing some varieties of AutoImportExpressionFilter XML for InterfacesDiscoveryPluginContext would be great.

    The introduction of HCO licensing has meant that getting discovery setup flexible enough to roll out to more pollers is the key for my needs.

    So, for example - monitoring 3000+ SNMP nodes - and wanting to introduce 2 more pollers - having the ability to deploy identical and well filtered AutoImport rules would be great.