cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
805
Views
1
Helpful
2
Replies

How do i get the active user session details via maapi

spasingh
Cisco Employee
Cisco Employee

admin@ncs# who

Session User  Context From      Proto   Date     Mode       

*3109   admin cli     127.0.0.1 console 09:15:39 operational

admin@ncs#
how do I get the user info who has logged in using Maapi API 

2 Replies 2

jvikman
Cisco Employee
Cisco Employee

Take a look at the get_user_session_identification and get_user_session_identification in the low level Maapi.

cohult
Cisco Employee
Cisco Employee

If the MAAPI client starts a user session using any context other than the default "system" context, the user will be listed by, for example, the CLI "who" command. Example:

 

 

$ ncs_cmd -u admin -x my-maapi-context -c "mtrans; sleep 60" &
$ echo "who" | ncs_cli -u admin -C
Session User  Context          From      Proto   Date     Mode           
*416    admin cli              127.0.0.1 console 13:34:33 operational    
 415    admin my-maapi-context 127.0.0.1 tcp     13:34:30 config-terminal