I found the login.slax in a github repository, trying to convert to python but having a hard time finding the user to logout.
Trying to conver the slax:
if ($response == "no") {
var $rpc = <command> "request system logout user " _ $user;
var $noresponse = jcs:invoke($rpc);
to python
with Device() as dev: #Call Device this way becuase it will automatically open and close the connection
jcs.output('..')
jcs.output('..')
jcs.output('Logging Out')
res = dev.rpc.cli('request system logout user ' + username, format='text', normalize=False)
I am hoping someone knows how to fund the logged in user. We are suing Cisco ISE and TACACS to login which gets mapped to a local user on the switch so cant log that user out.
I am hoping to logout the user that attempted to login using their username they entered: JDI
show system users
fpc0:
--------------------------------------------------------------------------
6:48AM up 1 day, 19:54, 1 users, load averages: 0.15, 0.23, 0.24
USER TTY FROM LOGIN@ IDLE WHAT
JDIZZLE pts/0 10.192.175.124 6:14AM - -cl
#pyezlogoffuser