03-26-2014 10:37 AM
I am new to EEM and was wondering if it was possible to get an applet to run for a specific user when that user logins to the device? If so, which event would I be looking for?
Thanks in advance.
03-27-2014 10:40 PM
Yes. If you enable:
login on-success log
Then a syslog message will be generated when a user logs in. You can react to that syslog message with an EEM applet. Something like:
event manager applet user-login
event syslog pattern "Login Success \[user: CISCO]"
action 1.0 syslog msg "User CISCO has logged in"
04-01-2014 12:03 PM
Joseph...thank you very much for the help. I have another question however. I am trying to piece together a very simple script that will show the running config if a particular user logs into the device. So I have this so far:
event manager applet login
event syslog pattern "Login Success \[user: testuser]"
action 1.0 cli command "enable"
action 2.0 cli command "sh run"
!
Once I login as "testuser" it would appear that the applet runs but not in the current session....as in testuser does not see the results. I have tried to add the following
action 3.0 puts "$_cli_result"
But again no difference. Is there a way to pipe the information to the cli session of testuser?
Thanks again!
04-01-2014 01:30 PM
This is not possible, unfortunately. The syslogs are asynchronous, and there is no controlling terminal onto which messages can be displayed. The best you could do is push down an autocommand from a AAA server that would execute "show run" when a specific user logs in.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide