cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1873
Views
3
Helpful
3
Replies

Run EEM applet on login

murphycp3
Level 1
Level 1

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.

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

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"

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!

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.

Review Cisco Networking for a $25 gift card