Hello everyone,
We are suddenly experiencing a problem with network discovery via API which stopped working (returns nothing instead of discovery id).It worked fine for the past year or so and we used it a lot. Code sequence is exactly like in the example on github, but I'm posting it just in case. Nothing changed in the code. The only recent change was upgrading Solarwinds to a more recent version.
Does anyone know how to diagnose this strange issue?
Thanks a lot!!!
class Client():
requests.packages.urllib3.disable_warnings()
def __init__(self,host,user,password):
self.swis = SwisClient(host, user, password)
self.host = host
def discover_host(self,target_node_ip,credentials_id):
""" Automatically discovers and add a host provided
its ip address and the id that identifies
snmp community to use from the Orion.Credentials table (197 for linux hosts)
"""
corePluginContext = {
'BulkList': [{'Address': target_node_ip}],
'Credentials': [
{
'CredentialID': credentials_id,
'Order': 1
}
],
'WmiRetriesCount': 0,
'WmiRetryIntervalMiliseconds': 1000
}
corePluginConfig = self.swis.invoke('Orion.Discovery', 'CreateCorePluginConfiguration', corePluginContext)
discoveryProfile = {
'Name': 'discovery_host',
'EngineID': 5,
'JobTimeoutSeconds': 3600,
'SearchTimeoutMiliseconds': 5000,
'SnmpTimeoutMiliseconds': 5000,
'SnmpRetries': 2,
'RepeatIntervalMiliseconds': 1800,
'SnmpPort': 161,
'HopCount': 0,
'PreferredSnmpVersion': 'SNMP2c',
'DisableIcmp': False,
'AllowDuplicateNodes': False,
'IsAutoImport': True,
'IsHidden': True,
'PluginConfigurations': [{'PluginConfigurationItem': corePluginConfig}]
}
discoveryid = self.swis.invoke('Orion.Discovery', 'StartDiscovery', discoveryProfile)
return discoveryid
[..]
class Client(): requests.packages.urllib3.disable_warnings() def __init__(self,host,user,password): self.swis = SwisClient(host, user, password) self.host = host
def discover_host(self,target_node_ip,credentials_id): """ Automatically discovers and add a host provided its ip address and the id that identifies snmp community to use from the Orion.Credentials table (197 for linux hosts) """
corePluginContext = { 'BulkList': [{'Address': target_node_ip}], 'Credentials': [ { 'CredentialID': credentials_id, 'Order': 1 } ], 'WmiRetriesCount': 0, 'WmiRetryIntervalMiliseconds': 1000 } corePluginConfig = self.swis.invoke('Orion.Discovery', 'CreateCorePluginConfiguration', corePluginContext)
discoveryProfile = { 'Name': 'discovery_host', 'EngineID': 5, 'JobTimeoutSeconds': 3600, 'SearchTimeoutMiliseconds': 5000, 'SnmpTimeoutMiliseconds': 5000, 'SnmpRetries': 2, 'RepeatIntervalMiliseconds': 1800, 'SnmpPort': 161, 'HopCount': 0, 'PreferredSnmpVersion': 'SNMP2c', 'DisableIcmp': False, 'AllowDuplicateNodes': False, 'IsAutoImport': True, 'IsHidden': True, 'PluginConfigurations': [{'PluginConfigurationItem': corePluginConfig}] }
discoveryid = self.swis.invoke('Orion.Discovery', 'StartDiscovery', discoveryProfile) return discoveryid
[..]