-
Notifications
You must be signed in to change notification settings - Fork 3
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Comments
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? |
Also found this: solarwinds/orionsdk-python#61 |
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. |
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. |
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. |
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! |
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.
The text was updated successfully, but these errors were encountered: