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.

cannot discover snmpv3 node via discover_one_node.py script

am trying to use the discover_one_node.py script provided at GitHub - solarwinds/orionsdk-python: Python client for interacting with the SolarWinds Orion API

but am getting this error when i run it:

requests.exceptions.HTTPError: 400 Client Error: ProvideFault failed, check fault information. for url: orion:17778/.../StartDiscovery

here's my script:

from __future__ import print_function

import re

import requests

from orionsdk import SwisClient

def main():

    npm_server = 'orion'

    username = '<userid>

    password = '<password>'

    target_node_ip = 'vlxadmp04'

    snmpv3_credential_id = 181

    orion_engine_id = 1

    swis = SwisClient(npm_server, username, password)

    print("Add an SNMP v3 node:")

    corePluginContext = {

        'BulkList': [{'Address': target_node_ip}],

        'Credentials': [

                {

                        'CredentialID': snmpv3_credential_id,

                        'Order': 1

                }

        ],

        'WmiRetriesCount': 0,

        'WmiRetryIntervalMiliseconds': 1000

    }

    corePluginConfig = swis.invoke('Orion.Discovery', 'CreateCorePluginConfiguration', corePluginContext)

    discoveryProfile = {

        'Name': 'discover_one_node.py',

        'EngineID': orion_engine_id,

        '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}]

    }

    print("Running discovery...")

    result = swis.invoke('Orion.Discovery', 'StartDiscovery', discoveryProfile)

    print("Returned discovery profile id {}".format(result))

requests.packages.urllib3.disable_warnings()

if __name__ == '__main__':

    main()

  • i resolved the problem myself.

    the issue was the orion_engine_id was wrong. managed to find out from some other forum post that i had to check the Orion.Engines node to see what was the appropriate engine id which brings me to an important point about the orion sdk link. the sample scripts provided have ZERO explanation on the options that it uses.

    twice i had to scour many forum posts before coming to a solution. the first was that nowhere is there any explanation of what a credential id is and that was the first problem i faced. i finally found the solution in a forum post. there should hv been either a comment in the script or some form of documentation somewhere of how a credential id should be found, which in this case, is by going to Orion.Credentials (using SWQL studio) and looking for the id that matched my snmp credentials.

    second, was that the orion_engine_id was used in this script but again not explained and i later found out that i had to use SWQL studio and look up Orion.Engines to find the appropriate engine id for my case.

    this would've saved me a ton of time trying to figure this out (and i'm sure a lot of people would have this same problem figuring this out) if they had just put in some comments into the same scripts or some documentation to explain the parameters that were used.