EEM Script to call Python Script for CLI Accounting for NX-OS
Hey All -
I'm trying to write up an NX-OS script that is equivalent to "archive log config" in IOS. What I am considering is having EEM call a python script anytime that some command is entered in CLI. My question is, how CPU intensive is this if it were to call the script every single time any command is entered?
So far what I have for my eem script is:
event manager applet test
event cli match "*"
action 1.0 cli source syslog.py
action 2.0 event-default
And my python script looks as follows:
import syslog from cisco import *
x = cli("show accounting log | i 'configure terminal'") if 'configure terminal' in x: syslog.syslog(3,x);
x = cli("clear accounting log")
We need the CLI commands to be sent to a syslog server so accounting using TACACS or RADIUS isn't an option. This is a messy solution but it was the only way I could think of. Any idea on if running the script constantly like that would cause issues on a Nexus box? Another option would be just running it on a scheduler but that isn't ideal.
You'll clearly want to test this. I doubt anyone has done such a thing before. It seems risky to me, but it would only cause load when CLI commands are executed, so the scaling factor will be the number of simultaneous sessions + the number of simultaneous CLI commands executed. You should test as aggressively as your customer plans to use the CLI.
I'm working on a project that includes basic router configurations. I configurated everything including: line console 0, line vty 0 15 and secret passwords. There are 3 routers in the network and every LAN is going t...
Desire to create Terminal Server ("TS" in this document) out of 2811 Cisco Router with HWIC-16A card (with Octal cables)
Desire to use SSH over Telnet
TS is ip'ed, SSH access configured (to the TS)
Python based Script to BULK Import/Delete devices using Cisco Prime API
Check my Repo on GitHub for all the details ( see below link )