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
Jun 03 12:10:12.000190 osdx systemd-timedated[231411]: Changed local time to Wed 2026-06-03 12:10:12 UTC Jun 03 12:10:12.001579 osdx OSDxCLI[233427]: User 'admin' executed a new command: 'set date 2026-06-03 12:10:12'. Jun 03 12:10:12.017032 osdx systemd[1]: Starting logrotate.service - Rotate log files... Jun 03 12:10:12.046601 osdx systemd[1]: logrotate.service: Deactivated successfully. Jun 03 12:10:12.046751 osdx systemd[1]: Finished logrotate.service - Rotate log files. Jun 03 12:10:12.353169 osdx systemd-journald[2151]: Runtime Journal (/run/log/journal/140771393e044d28bd27951346e92000) is 1.9M, max 13.8M, 11.8M free. Jun 03 12:10:12.356649 osdx systemd-journald[2151]: Received client request to rotate journal, rotating. Jun 03 12:10:12.356719 osdx systemd-journald[2151]: Vacuuming done, freed 0B of archived journals from /run/log/journal/140771393e044d28bd27951346e92000. Jun 03 12:10:12.364313 osdx OSDxCLI[233427]: User 'admin' executed a new command: 'system journal clear'. Jun 03 12:10:12.569006 osdx OSDxCLI[233427]: User 'admin' executed a new command: 'system coredump delete all'. Jun 03 12:10:12.922437 osdx OSDxCLI[233427]: User 'admin' entered the configuration menu. Jun 03 12:10:12.977504 osdx OSDxCLI[233427]: User 'admin' added a new cfg line: 'set system description DESC1'. Jun 03 12:10:13.085085 osdx OSDxCLI[233427]: User 'admin' added a new cfg line: 'show working'. Jun 03 12:10:13.139143 osdx ubnt-cfgd[233569]: inactive Jun 03 12:10:13.155115 osdx INFO[233576]: FRR daemons did not change Jun 03 12:10:13.165845 osdx cfgd[1899]: [233427]Completed change to active configuration Jun 03 12:10:13.166386 osdx OSDxCLI[233427]: User 'admin' committed the configuration. Jun 03 12:10:13.197714 osdx OSDxCLI[233427]: 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 2025-03-06 00:00
Step 4: Run the command system journal show | tail -n 20 on DUT0 and expect the following output:
Show output
Jun 03 12:10:12.000190 osdx systemd-timedated[231411]: Changed local time to Wed 2026-06-03 12:10:12 UTC Jun 03 12:10:12.001579 osdx OSDxCLI[233427]: User 'admin' executed a new command: 'set date 2026-06-03 12:10:12'. Jun 03 12:10:12.017032 osdx systemd[1]: Starting logrotate.service - Rotate log files... Jun 03 12:10:12.046601 osdx systemd[1]: logrotate.service: Deactivated successfully. Jun 03 12:10:12.046751 osdx systemd[1]: Finished logrotate.service - Rotate log files. Jun 03 12:10:12.353169 osdx systemd-journald[2151]: Runtime Journal (/run/log/journal/140771393e044d28bd27951346e92000) is 1.9M, max 13.8M, 11.8M free. Jun 03 12:10:12.356649 osdx systemd-journald[2151]: Received client request to rotate journal, rotating. Jun 03 12:10:12.356719 osdx systemd-journald[2151]: Vacuuming done, freed 0B of archived journals from /run/log/journal/140771393e044d28bd27951346e92000. Jun 03 12:10:12.364313 osdx OSDxCLI[233427]: User 'admin' executed a new command: 'system journal clear'. Jun 03 12:10:12.569006 osdx OSDxCLI[233427]: User 'admin' executed a new command: 'system coredump delete all'. Jun 03 12:10:12.922437 osdx OSDxCLI[233427]: User 'admin' entered the configuration menu. Jun 03 12:10:12.977504 osdx OSDxCLI[233427]: User 'admin' added a new cfg line: 'set system description DESC1'. Jun 03 12:10:13.085085 osdx OSDxCLI[233427]: User 'admin' added a new cfg line: 'show working'. Jun 03 12:10:13.139143 osdx ubnt-cfgd[233569]: inactive Jun 03 12:10:13.155115 osdx INFO[233576]: FRR daemons did not change Jun 03 12:10:13.165845 osdx cfgd[1899]: [233427]Completed change to active configuration Jun 03 12:10:13.166386 osdx OSDxCLI[233427]: User 'admin' committed the configuration. Jun 03 12:10:13.197714 osdx OSDxCLI[233427]: User 'admin' left the configuration menu. Jun 03 12:10:13.363648 osdx OSDxCLI[233427]: User 'admin' executed a new command: 'system journal show | tail -n 20'. Jun 03 12:10:13.429356 osdx OSDxCLI[233427]: 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-06-03 12:10:14.057986 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2026-06-03 12:10:14.086211 auth-notice , OSDxCLI: User 'admin' left the configuration menu. 2026-06-03 12:10:14.160232 auth-notice , OSDxCLI: User 'admin' has logged out. 2026-06-03 12:10:15.670826 auth-notice , OSDxCLI: User 'admin' has logged in. 2026-06-03 12:10:15.810752 auth-notice , OSDxCLI: User 'admin' entered the configuration menu. 2026-06-03 12:10:15.866419 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'set system description DESC2'. 2026-06-03 12:10:15.962115 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'show changes'. 2026-06-03 12:10:16.051446 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2026-06-03 12:10:16.078170 auth-notice , OSDxCLI: User 'admin' left the configuration menu.