Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poll Now - Force SNMP Poll #20

Open
Andyjb8 opened this issue Apr 29, 2024 · 7 comments
Open

Poll Now - Force SNMP Poll #20

Andyjb8 opened this issue Apr 29, 2024 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@Andyjb8
Copy link

Andyjb8 commented Apr 29, 2024

Maybe I am missing it in one of the modules, but is there a way to force a snmp poll? I want to trigger snmp poll sooner than waiting for the standard interval, just like clicking the "Poll Now" button in the Managment box does on a node.

@Andyjb8
Copy link
Author

Andyjb8 commented May 3, 2024

I found this: https://thwack.solarwinds.com/products/the-orion-platform/f/orion-sdk/12918/api---forcing-a-manual-poll/289668

The reason I think this would be beneficial is I want to force a poll after adding a node, my playbook would then validate that snmp is working (without having to wait the polling interval) with orion_node_info.py. If snmp isn't working it would then output a list of nodes not working to alert the administrator for troubleshooting.

Maybe a better way to do this if there was a way to "Test" that the snmp credentials (like you can when adding snmp credentials under edit node) are valid when adding a node with orion_node.py and alert if there was a snmp failure?

@Andyjb8
Copy link
Author

Andyjb8 commented May 3, 2024

Also found this: solarwinds/orionsdk-python#61

@jeisenbath
Copy link
Owner

Interesting thoughts, I personally add a node when configuring a device, so I'm confident snmp is configured the same way on the device and haven't ran into this issue. I also will say that if you are adding interfaces to your node, then you are essentially testing SNMP because it has to discover the interfaces in order to add them (it runs that DiscoverInterfacesOnNode verb mentioned in your last comment). In general I also have a report that shows nodes with LastPollTimeUTC not up to date, generally to trigger an snmp restart or alert us of poller-wide issues.

orion_node_info could be updated to return the LastPollTimeUTC, and get a new param to trigger the Poll Now. I don't know how long that poll usually takes, so might need some loop to check that LastPollTimeUTC updated, but something like that sounds doable.

@jeisenbath jeisenbath self-assigned this Jun 30, 2024
@jeisenbath jeisenbath added the enhancement New feature or request label Jun 30, 2024
@jeisenbath
Copy link
Owner

I pushed a commit to the devel-2.1.x branch, get_node() in the OrionModule class will now return the LastSystemUpTimePollUtc field, which corresponds to the last SNMP poll. I added a function poll_now() to OrionModule, and put some logic in to orion_node_info to poll if the node is SNMP, and either has a null value or the last poll is over 300 seconds ago (this second part I could take out, or increase the time, but once I worked out the logic I figured I'd keep it in for now).

You should be able to combine this with until, retries, and delay logic on your orion_node_info task, let me know when you find time if this works for you.

@Andyjb8
Copy link
Author

Andyjb8 commented Aug 9, 2024

Immediately after adding a snmpv3 node, with orion_node_info as expected I see:
"lastsystemuptimepollutc": null,

I run it again a few seconds later and I get:
"lastsystemuptimepollutc": "2024-08-09T15:32:02.1930000Z",

But that works even if the SNMPv3 credential are incorrect, so it appears to be getting lastsystemuptimepollutc via icmp? Per orion_node_poller_info output below, I am using N.Status.ICMP.Native instead of N.Status.SNMP.Native, so that seems to indicate that icmp is still being used for uptime status.

See here my node details still haven't been populated (snmp creds are good) over 5 minutes later.
image

Doing some more research and testing here, it appears the rediscover is what actually triggers it to pull the nodes detail after it has been added. Maybe we need a rediscover module to do that so I can get the snmpv3 node detail info populated sooner? Primarily though I want to test/verify snmpv3 credentials are correct as we have had issue with snmpv3 configs on Junipers recently. I want to be able to identify the nodes with snmp not working and have it reaapply the snmv3 configs.

orion_node_poller_info debug output

    "pollers": [
        {
            "Enabled": false,
            "PollerType": "N.Status.SNMP.Native"
        },
        {
            "Enabled": false,
            "PollerType": "N.ResponseTime.SNMP.Native"
        },
        {
            "Enabled": false,
            "PollerType": "N.Routing.SNMP.Ipv4CidrRoutingTable"
        },
        {
            "Enabled": false,
            "PollerType": "N.Topology_Layer3.SNMP.ipNetToMedia"
        },
        {
            "Enabled": true,
            "PollerType": "N.Status.ICMP.Native"
        },
        {
            "Enabled": true,
            "PollerType": "N.ResponseTime.ICMP.Native"
        },
        {
            "Enabled": true,
            "PollerType": "N.Details.SNMP.Generic"
        },
        {
            "Enabled": true,
            "PollerType": "N.Uptime.SNMP.Generic"
        }
    ]
}

@jeisenbath
Copy link
Owner

You're probably correct, in that the Node Details might get populated with Discovery and not just a simple Poll. There's a RediscoverNow Verb also on Orion.Nodes, that could be another easy add to the module.

That field, however, I've used it for several years at this point to monitor issues with SNMP polling, from bad credentials, firewall issues, to whole polling engines stopping polling. My test node is using the same pollers as your node does. If I add the node with purposefully bad creds, that field stays null. If I change the node from good to bad creds, that field goes stale and stops updating.

@Andyjb8
Copy link
Author

Andyjb8 commented Aug 9, 2024

Hmm, I am not sure why I was getting a different result earlier, but after testing again it behaving as you described. That being the case, this will be helpful to identify nodes that SNMP is not working. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants