Check Logging
The following scenario shows how to display and register user actions performed on the OSDx CLI (Command Line Interface).
Test CLI Events Logging
Description
This scenario demonstrates how to show and store in a file the different actions that users perform on the CLI.
Scenario
Step 1: Set the following configuration in DUT0 :
set system description DESC1 set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
Step 2: Run the command system journal show | tail -n 20 on DUT0 and expect the following output:
Show output
Sep 16 20:05:20.323908 osdx systemd-journald[2158]: Runtime Journal (/run/log/journal/7ab9d0c6c88d486ab30f6cca192546c5) is 1.8M, max 13.8M, 11.9M free. Sep 16 20:05:20.325315 osdx systemd-journald[2158]: Received client request to rotate journal, rotating. Sep 16 20:05:20.325378 osdx systemd-journald[2158]: Vacuuming done, freed 0B of archived journals from /run/log/journal/7ab9d0c6c88d486ab30f6cca192546c5. Sep 16 20:05:20.338856 osdx OSDxCLI[153932]: User 'admin' executed a new command: 'system journal clear'. Sep 16 20:05:20.586606 osdx OSDxCLI[153932]: User 'admin' executed a new command: 'system coredump delete all'. Sep 16 20:05:20.887663 osdx OSDxCLI[153932]: User 'admin' entered the configuration menu. Sep 16 20:05:21.006537 osdx OSDxCLI[153932]: User 'admin' added a new cfg line: 'set system description DESC1'. Sep 16 20:05:21.124955 osdx OSDxCLI[153932]: User 'admin' added a new cfg line: 'show working'. Sep 16 20:05:21.234464 osdx ubnt-cfgd[154100]: inactive Sep 16 20:05:21.270221 osdx INFO[154107]: FRR daemons did not change Sep 16 20:05:21.287076 osdx cfgd[1899]: [153932]Completed change to active configuration Sep 16 20:05:21.288520 osdx OSDxCLI[153932]: User 'admin' committed the configuration. Sep 16 20:05:21.325761 osdx OSDxCLI[153932]: User 'admin' left the configuration menu.
Step 3: Run the command system login show users on DUT0 and expect the following output:
Show output
NAME LINE TIME COMMENT admin ttyS0 2026-09-16 20:05
Step 4: Run the command system journal show | tail -n 20 on DUT0 and expect the following output:
Show output
Sep 16 20:05:20.323908 osdx systemd-journald[2158]: Runtime Journal (/run/log/journal/7ab9d0c6c88d486ab30f6cca192546c5) is 1.8M, max 13.8M, 11.9M free. Sep 16 20:05:20.325315 osdx systemd-journald[2158]: Received client request to rotate journal, rotating. Sep 16 20:05:20.325378 osdx systemd-journald[2158]: Vacuuming done, freed 0B of archived journals from /run/log/journal/7ab9d0c6c88d486ab30f6cca192546c5. Sep 16 20:05:20.338856 osdx OSDxCLI[153932]: User 'admin' executed a new command: 'system journal clear'. Sep 16 20:05:20.586606 osdx OSDxCLI[153932]: User 'admin' executed a new command: 'system coredump delete all'. Sep 16 20:05:20.887663 osdx OSDxCLI[153932]: User 'admin' entered the configuration menu. Sep 16 20:05:21.006537 osdx OSDxCLI[153932]: User 'admin' added a new cfg line: 'set system description DESC1'. Sep 16 20:05:21.124955 osdx OSDxCLI[153932]: User 'admin' added a new cfg line: 'show working'. Sep 16 20:05:21.234464 osdx ubnt-cfgd[154100]: inactive Sep 16 20:05:21.270221 osdx INFO[154107]: FRR daemons did not change Sep 16 20:05:21.287076 osdx cfgd[1899]: [153932]Completed change to active configuration Sep 16 20:05:21.288520 osdx OSDxCLI[153932]: User 'admin' committed the configuration. Sep 16 20:05:21.325761 osdx OSDxCLI[153932]: User 'admin' left the configuration menu. Sep 16 20:05:21.533704 osdx OSDxCLI[153932]: User 'admin' executed a new command: 'system journal show | tail -n 20'. Sep 16 20:05:21.636355 osdx OSDxCLI[153932]: User 'admin' executed a new command: 'system login show users'.
Step 5: Modify the following configuration lines in DUT0 :
set system syslog file CLI filter def app OSDxCLI set system syslog file CLI filter def level info
Step 6: Login as admin user on DUT0:
admin@osdx
Step 7: Modify the following configuration lines in DUT0 :
set system description DESC2
Step 8: Run the command file show running://log/user/CLI/CLI on DUT0 and expect the following output:
Show output
2026-09-16 20:05:22.373501 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2026-09-16 20:05:22.419537 auth-notice , OSDxCLI: User 'admin' left the configuration menu. 2026-09-16 20:05:22.519840 auth-notice , OSDxCLI: User 'admin' has logged out. 2026-09-16 20:05:24.116475 auth-notice , OSDxCLI: User 'admin' has logged in. 2026-09-16 20:05:24.249196 auth-notice , OSDxCLI: User 'admin' entered the configuration menu. 2026-09-16 20:05:24.306511 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'set system description DESC2'. 2026-09-16 20:05:24.407372 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'show changes'. 2026-09-16 20:05:24.538588 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2026-09-16 20:05:24.587156 auth-notice , OSDxCLI: User 'admin' left the configuration menu.