Sample script to log all users out of a target device attached to a serial port

Sample script to log all users out of a target device attached to a serial port

Please note this is only an example and should be tested before using in production.  The script may require customization to use the appropriate commands to log out of the specific targets involved. Usage instructions for this sample script:
  1. Unzip log_all_out.py.zip
  2. Copy the script to Nodegrid: scp log_all_out.py admin@10.20.30.40:/etc/scripts/access/log_all_out.py
  3. Log into the CLI as admin (or equivalent configuration permissions)
  4. Access the root shell: shell sudo su -
  5. Set execution permission: chmod +x /etc/scripts/access/log_all_out.py
  6. Return to the admin CLI: exit
  7. Enable the script via Session Stop Script setting (i.e. port 1): set /settings/devices/ttyS1/management/ on_session_stop=log_all_out.py
    1. Repeat enabling script on additional ports as appropriate
  8. Save the changes: commit