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.

Node created from API never gets polled

FormerMember
FormerMember

When I create a node and add pollers through the API, the node never seems to get polled.  The node status never changes, I don't get get descriptive information like the node's name, vendor, etc. and it doesn't collect cpu, mem, volume, or interface statistics.  If I add the node through the Solarwinds GUI, everything works as it should.

I am using the Python SDK and my Orion Platform is 2015.1.2 (NPM 11.5.2).  Here is the relevant code I'm using trying to add a Cisco router.

swis = SwisClient(host, user, pass)

request =  swis.create("Orion.Nodes", IPAddress="192.168.1.1", EngineID=1, ObjectSubType="SNMP", SNMPVersion=2, Community="public")

At this point, the node has been added.  I can see it in Solarwinds "Manage Nodes" but it has no name or any other information associated with it because it hasn't been polled yet.

#In these queries, I'll use a hard coded NodeId just to demonstrate, assume the NodeId is 100

request = swis.create("Orion.Pollers", NetObject="N:100", netObjectType="N", netObjectID=100, PollerType="N.Status.ICMP.Native")

request = swis.create("Orion.Pollers", NetObject="N:100", netObjectType="N", netObjectID=100, PollerType="N.ResponseTime.ICMP.Native")

request = swis.create("Orion.Pollers", NetObject="N:100", netObjectType="N", netObjectID=100, PollerType="N.Details.SNMP.Generic")

request = swis.create("Orion.Pollers", NetObject="N:100", netObjectType="N", netObjectID=100, PollerType="N.Uptime.SNMP.Generic")

At this point, the pollers have been successfully added but nothing else has changed, I don't see status or additional node info, etc.  I have tried doing a "Poll Now" from the Solarwinds GUI and also invoking a "PollNow" through the API but I still get nothing.  The node just shows status "Unknown".  Now, if I do a "List Resources" from the Solarwinds GUI on the node, I can see all the routing topology, interfaces, etc. (and if I add these items, I can see these pollers are getting added in the DB.  Though if I add, say an interface now, I still can't get interface statistics because the node never appears to get polled).

Does anyone know what I might be doing wrong here?

  • Hi,

    Some details appear after rediscovery of the node. You can check the RediscoveryInterval (which is set to 30 minutes by default) and NextRediscovery to see when the rediscovery will happen. You can also trigger Rediscovery from GUI and see the details.

    Also NextPoll will give you details on when is the next polling will happen (It has interval of 2 minutes by default).

    Check and let me know if you still face issues.

  • FormerMember
    0 FormerMember in reply to madhavan

    I appear to be getting better results with this today.  Not sure if I had typos when I was testing last week or what.  The node did eventually start getting SNMP polled but it seemed to be hours after I created it (maybe during the Rediscovery process?).

    In testing today, I can get the ICMP status just from creating the pollers and waiting a couple minutes.  If I then do a "Poll now" through the GUI, I am now getting all of the SNMP related info I'm looking for.  I can't seem to get the PollNow invoke verb to work though.  I'm issuing:

    #Using hard coded NodeId again as an example

    res = swis.invoke("Orion.Nodes", "PollNow", "N:100")

    print res

    Which returns "None", I assume that is fine to see in the return but the node never appears to get polled.  The "netObjectId(System.String)" is supposed to be the NodeId right?  And in "N:XXX" format?

    Also, is there a way to invoke rediscovery via API?  I didn't see it in the SWIS schema under Orion.Nodes.

  • Hi,

    The syntax for PollNow is correct. How do you confirm that the node is not getting polled?

    Check the PollInterval, to see how what is the interval set for polling (by default it is 120 seconds, so every 2 minutes polling should happen.)

    If you want to check if the pollNow via SDK  is working, increase the polling interval to say 5 minutes (300) and invoke pollNow, you should see the NextPoll is updated to 5 minutes from the time when invoke was called. (there may be delay of few seconds as it is a background process)

    There is no verb for Rediscovery as of now.

    Thanks

  • FormerMember
    0 FormerMember in reply to madhavan

    It looks like "Rediscovery" is the key here like you mentioned in your first reply.  I checked the "NextPoll" time as you suggested and it looks like invoking "PollNow" via API is working but its functionality doesn't seem to mirror the "Poll now" option in the GUI.  I noticed when I do a "Poll now" in the GUI, it updates the "NextRediscovery" time.  So, when I either "Poll now" or "Rediscover" via the GUI, I get all the node details, etc.

    Do you have any suggestions for getting SNMP info back as quick to real time as possible?  For now, I guess I'll set RediscoveryInterval=1 and PollInterval=60 when I create the node, then issue an "Update" on the URI for that node to change it back to normal after I get the data I'm looking for.

    On a side note, do you have any basic rundown of what common tasks are currently possible or impossible using the API?  I've dug through Thwack quite a bit looking for answers to things like whether you can add volumes, whether you can detect pollers automatically, etc.  I stumbled across something I think you may have posted including use of the "Discovery" verbs that had a bunch of strange looking XML attached to it.  I'm not sure if things have changed since these posts, just trying to get an idea of what the current state of things is.

    Thanks.

  • I'm having the same issue but unfortunately it's not clearing up on its own like mlrabbitt‌'s issue. Here's the test code I'm using. It creates the node without issue but then sits there as Unknown and doesn't poll. I've let it sit for hours and there's no change.

    https://gist.github.com/mrxinu/223c73c6f3636ff489a4

    --

    Steven Klassen

    Developer Analyst @ Loop1 Systems, Inc.

    http://www.loop1systems.com/

  • FormerMember
    0 FormerMember in reply to mrxinu

    Have you tried doing a Rediscover through the GUI after creating the node?  In my case, my nodes didn't start polling correctly until the Rediscovery happened, which in my environment is 240 minutes (4 hours).

  • I did and that doesn't seem to make a difference. I went ahead and created the node in the GUI, took stock of all the pollers assigned to it (and their Enabled settings) and mimicked that exactly in the code. Same result.

    https://gist.github.com/mrxinu/223c73c6f3636ff489a4/revisions

    --

    Steven Klassen

    Developer Analyst @ Loop1 Systems, Inc.

    http://www.loop1systems.com/

  • FormerMember
    0 FormerMember in reply to mrxinu

    I ran the first script you included and it worked for me.  I'm not sure what's different about your environment.  Are you sure your IPAddress, Community, EngineID are all correct?

    Here's an alternate (probably better) way of adding a node via API that might be worth trying: Perl SDK - Start Discovery - PluginConfigurations

  • Well that's encouraging. =) I'll check out running this against another system.

    --

    Steven Klassen

    Developer Analyst @ Loop1 Systems, Inc.

    http://www.loop1systems.com/