jeisenbath / ansible-collection-solarwinds-orion

An Ansible collection for managing nodes in Solarwinds Orion
10 stars 1 forks source link

Poll Now - Force SNMP Poll #20

Open Andyjb8 opened 2 months ago

Andyjb8 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

Also found this: https://github.com/solarwinds/orionsdk-python/issues/61

jeisenbath commented 2 months ago

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.