Help configuring a simple script - CISCO

Hello everyone, 

I'm pretty new at scripting in solarwinds, that's why I request your wise.

I'd like to run a script which will be pretty simple, it will run the following command:

"show crypto ssl stats | i Active connections"

The output will be similar to this:

Active connections : 54 AAA pending reqs : 0

So I would like that after running the script, It's return the 54 value (in this particular case)

Later I would like to schedule a job for this, but that is another story.

Anyone could give me a hand on this?

thanks!

  • The existing NCM script engine doesnt parse the results, it just executes the given commands and saves the whole result. There is work in progress on expanding NCM to support Python scripts but that's still in early work so don't count on it in the immediate future.

    For cases similar to this I have done fairly complicated worked arounds in the past, such as scheduling jobs to execute the command on a list of hosts then using sql to pull the responses out of the database and into powershell where I could parse and manipulate them and then setting a custom property in Orion to display the value I was interested in. That's a pretty complex process though and not something I would suggest to someone new to solarwinds unless you are already comfortable in SQL and scripting with REST APIs.
  • Thanks Mesverrum for your quick response.

    When you say "saves the whole result", is there any way to see this?

    It is such a pitty this could not be done via scripting since it could be very handy for many many tasks

    Regards

  • I'm guessing there is an OID/MIB you can query to get this same value, and poll it periodically via an Universal Device Poller (UnDP)?   That way you can store it, chart it, etc...

    Maybe this is what you're looking for?

    - Total number of RAS sessions : 1.3.6.1.4.1.9.9.392.1.3.1.0

    - Number of IPSec VPN tunnels : 1.3.6.1.4.1.9.9.171.1.3.1.1.0

    - Total number of SSL Sessions : 1.3.6.1.4.1.3076.2.1.2.26.1.2.0

    Got them from here:

    https://community.cisco.com/t5/network-security/asa-ssl-snmp-oid-s/td-p/1205345

  • Hello Norborg,

    I tried with the OID 1.3.6.1.4.1.3076.2.1.2.26.1.2, the device itself is a cisco CSR 1000v. I performed a snmpwalk from the orion console and this OID doesn't appear. Unless there is another value that i'm not aware of, i'm lost on this.

    Thanks for this. Glad to see that people help a lot! it has been many years without posting on any forum.

    Best regards

  • Just to let you know. I have opened a case with cisco, and the outcome was that there is no OID value for CSR 1000v. End of this story

    It has to be done via scripts, which we declined to invest our time doing it.