Quantcast
Channel: THWACK: Popular Discussions - Orion SDK
Viewing all articles
Browse latest Browse all 3719

Adding node with DNS instead of IP

$
0
0

Searched around the forums and google for a bit and not coming up with an answer as to why this might not be working for me. How do I add nodes that use DHCP instead of a static IP? Below is a snippet of the code i'm using, but when I go into NCM/NPM the node shows as unknown and it's polling IP is always 0.0.0.0. It's like it's not even attempting to resolve the FQDN and start walking the device.

 

    orion_props = {

     'DynamicIP': True,

     'EngineID': 1,

     'ObjectSubType': 'SNMP',

     'SNMPVersion': 2,

     'DNS': device,

     'Community': 'read-only-SNMP',

     'NodeName': device}

 

 

    node_uri = conn.create('Orion.Nodes', **orion_props)

 

 

    # Verify unicode string result return, otherwise there was a problem

    if isinstance(node_uri, dict):

        raise RuntimeError('Node add failed: {0}'.format(node_uri['ExceptionType']))

    else:

        node_id = re.search('(\d+)$', node_uri).group(0)

 

 

    pollers_enabled = {

        'N.Status.ICMP.Native': True,

        'N.Status.SNMP.Native': False,

        'N.ResponseTime.ICMP.Native': True,

        'N.ResponseTime.SNMP.Native': False,

        'N.Details.SNMP.Generic': True,

        'N.Uptime.SNMP.Generic': True,

        'N.Cpu.SNMP.HrProcessorLoad': True,

        'N.Memory.SNMP.NetSnmpReal': True,

        'N.AssetInventory.Snmp.Generic': True,

        'N.Topology_Layer3.SNMP.ipNetToMedia': False,

        'N.Routing.SNMP.Ipv4CidrRoutingTable': False}

 

 

    pollers = []

    for k in pollers_enabled:

        pollers.append({

            'PollerType': k,

            'NetObject': 'N:' + node_id,

            'NetObjectType': 'N',

            'NetObjectID': node_id,

            'Enabled': pollers_enabled[k]})

 

 

    for p in pollers:

        response = conn.create('Orion.Pollers', **p)

        pprint(response)


Viewing all articles
Browse latest Browse all 3719

Trending Articles



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