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 command system journal show | tail -n 20 at DUT0 and expect this output:
Show output
Nov 12 13:36:25.294291 osdx systemd-journald[1959]: Runtime Journal (/run/log/journal/5e4ed8d3546348e58126c9438c4a827c) is 1.9M, max 13.8M, 11.8M free. Nov 12 13:36:25.297987 osdx systemd-journald[1959]: Received client request to rotate journal, rotating. Nov 12 13:36:25.298041 osdx systemd-journald[1959]: Vacuuming done, freed 0B of archived journals from /run/log/journal/5e4ed8d3546348e58126c9438c4a827c. Nov 12 13:36:25.304749 osdx OSDxCLI[280825]: User 'admin' executed a new command: 'system journal clear'. Nov 12 13:36:25.530116 osdx OSDxCLI[280825]: User 'admin' executed a new command: 'system coredump delete all'. Nov 12 13:36:25.792552 osdx OSDxCLI[280825]: User 'admin' entered the configuration menu. Nov 12 13:36:25.863059 osdx OSDxCLI[280825]: User 'admin' added a new cfg line: 'set system description DESC1'. Nov 12 13:36:25.975713 osdx OSDxCLI[280825]: User 'admin' added a new cfg line: 'show working'. Nov 12 13:36:26.038699 osdx ubnt-cfgd[281073]: inactive Nov 12 13:36:26.053209 osdx INFO[281079]: FRR daemons did not change Nov 12 13:36:26.060403 osdx cfgd[1656]: [280825]Completed change to active configuration Nov 12 13:36:26.062255 osdx OSDxCLI[280825]: User 'admin' committed the configuration. Nov 12 13:36:26.095405 osdx OSDxCLI[280825]: User 'admin' left the configuration menu.
Step 3: Run command system login show users at DUT0 and expect this output:
Show output
NAME LINE TIME COMMENT admin ttyS0 2025-11-12 13:36
Step 4: Run command system journal show | tail -n 20 at DUT0 and expect this output:
Show output
Nov 12 13:36:25.294291 osdx systemd-journald[1959]: Runtime Journal (/run/log/journal/5e4ed8d3546348e58126c9438c4a827c) is 1.9M, max 13.8M, 11.8M free. Nov 12 13:36:25.297987 osdx systemd-journald[1959]: Received client request to rotate journal, rotating. Nov 12 13:36:25.298041 osdx systemd-journald[1959]: Vacuuming done, freed 0B of archived journals from /run/log/journal/5e4ed8d3546348e58126c9438c4a827c. Nov 12 13:36:25.304749 osdx OSDxCLI[280825]: User 'admin' executed a new command: 'system journal clear'. Nov 12 13:36:25.530116 osdx OSDxCLI[280825]: User 'admin' executed a new command: 'system coredump delete all'. Nov 12 13:36:25.792552 osdx OSDxCLI[280825]: User 'admin' entered the configuration menu. Nov 12 13:36:25.863059 osdx OSDxCLI[280825]: User 'admin' added a new cfg line: 'set system description DESC1'. Nov 12 13:36:25.975713 osdx OSDxCLI[280825]: User 'admin' added a new cfg line: 'show working'. Nov 12 13:36:26.038699 osdx ubnt-cfgd[281073]: inactive Nov 12 13:36:26.053209 osdx INFO[281079]: FRR daemons did not change Nov 12 13:36:26.060403 osdx cfgd[1656]: [280825]Completed change to active configuration Nov 12 13:36:26.062255 osdx OSDxCLI[280825]: User 'admin' committed the configuration. Nov 12 13:36:26.095405 osdx OSDxCLI[280825]: User 'admin' left the configuration menu. Nov 12 13:36:26.231708 osdx OSDxCLI[280825]: User 'admin' executed a new command: 'system journal show | tail -n 20'. Nov 12 13:36:26.290264 osdx OSDxCLI[280825]: 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.
Step 7: Modify the following configuration lines in DUT0 :
set system description DESC2
Step 8: Run command file show running://log/user/CLI/CLI at DUT0 and expect this output:
Show output
2025-11-12 13:36:26.958666 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2025-11-12 13:36:26.978882 auth-notice , OSDxCLI: User 'admin' left the configuration menu. 2025-11-12 13:36:27.068820 auth-notice , OSDxCLI: User 'admin' has logged out. 2025-11-12 13:36:28.811868 auth-notice , OSDxCLI: User 'admin' has logged in. 2025-11-12 13:36:28.960961 auth-notice , OSDxCLI: User 'admin' entered the configuration menu. 2025-11-12 13:36:29.034636 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'set system description DESC2'. 2025-11-12 13:36:29.142734 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'show changes'. 2025-11-12 13:36:29.259339 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2025-11-12 13:36:29.274912 auth-notice , OSDxCLI: User 'admin' left the configuration menu.