Forum Discussion
On 4/4/2022 at 12:04 PM, Stuart Weenig said:Expect can be used to obtain any data through an SSH connection. Here's an example: https://github.com/sweenig/monitoring-recipes/blob/master/DataSources/Groovy/Expect/Groovy_Expect_Example.groovy
If we're talking about the same Linux_SSH logicmodule, then that uses JSch, which is great, but all the examples I've seen only execute one command per session. With Expect, you can control the entire back and forth of the SSH session. Log in, set some parameters (like terminal width and height to 0), enter privileged exec mode and execute some commands. Then it's just a matter of figuring out how to do it manually through SSH and then programming Expect to do it. Once you have the command output, you can parse through the data however you need.
Thanks. I was looking over the Expect example you provided, and if we opt to go with the discovery script, this definitely looks like the way to go.
However, I was also looking at an option to clone the BGP DataSource and keep the active discovery as snmp polling, but leverage the instance grouping with a regex expression to group the tropos peer group. I just need to figure out what that regex needs to look like to identify the peers by that peer group name.
Any comments or suggestions you might have on that solution path as opposed to using the groovy script to identify the instances?
Related Content
- 3 months ago