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
Feb 12 23:18:18.360472 osdx systemd-journald[681778]: Runtime Journal (/run/log/journal/fef7273cfed74888920ec39438478308) is 2.3M, max 17.2M, 14.9M free. Feb 12 23:18:18.363017 osdx systemd-journald[681778]: Received client request to rotate journal, rotating. Feb 12 23:18:18.363089 osdx systemd-journald[681778]: Vacuuming done, freed 0B of archived journals from /run/log/journal/fef7273cfed74888920ec39438478308. Feb 12 23:18:18.371866 osdx OSDxCLI[781593]: User 'admin' executed a new command: 'system journal clear'. Feb 12 23:18:18.645051 osdx OSDxCLI[781593]: User 'admin' executed a new command: 'system coredump delete all'. Feb 12 23:18:18.984704 osdx OSDxCLI[781593]: User 'admin' entered the configuration menu. Feb 12 23:18:19.099038 osdx OSDxCLI[781593]: User 'admin' added a new cfg line: 'set system description DESC1'. Feb 12 23:18:19.246511 osdx OSDxCLI[781593]: User 'admin' added a new cfg line: 'show working'. Feb 12 23:18:19.347217 osdx ubnt-cfgd[781830]: inactive Feb 12 23:18:19.369331 osdx INFO[781836]: FRR daemons did not change Feb 12 23:18:19.379692 osdx cfgd[1631]: [781593]Completed change to active configuration Feb 12 23:18:19.385240 osdx OSDxCLI[781593]: User 'admin' committed the configuration. Feb 12 23:18:19.410561 osdx OSDxCLI[781593]: 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 2026-02-12 23:18
Step 4: Run command system journal show | tail -n 20 at DUT0 and expect this output:
Show output
Feb 12 23:18:18.360472 osdx systemd-journald[681778]: Runtime Journal (/run/log/journal/fef7273cfed74888920ec39438478308) is 2.3M, max 17.2M, 14.9M free. Feb 12 23:18:18.363017 osdx systemd-journald[681778]: Received client request to rotate journal, rotating. Feb 12 23:18:18.363089 osdx systemd-journald[681778]: Vacuuming done, freed 0B of archived journals from /run/log/journal/fef7273cfed74888920ec39438478308. Feb 12 23:18:18.371866 osdx OSDxCLI[781593]: User 'admin' executed a new command: 'system journal clear'. Feb 12 23:18:18.645051 osdx OSDxCLI[781593]: User 'admin' executed a new command: 'system coredump delete all'. Feb 12 23:18:18.984704 osdx OSDxCLI[781593]: User 'admin' entered the configuration menu. Feb 12 23:18:19.099038 osdx OSDxCLI[781593]: User 'admin' added a new cfg line: 'set system description DESC1'. Feb 12 23:18:19.246511 osdx OSDxCLI[781593]: User 'admin' added a new cfg line: 'show working'. Feb 12 23:18:19.347217 osdx ubnt-cfgd[781830]: inactive Feb 12 23:18:19.369331 osdx INFO[781836]: FRR daemons did not change Feb 12 23:18:19.379692 osdx cfgd[1631]: [781593]Completed change to active configuration Feb 12 23:18:19.385240 osdx OSDxCLI[781593]: User 'admin' committed the configuration. Feb 12 23:18:19.410561 osdx OSDxCLI[781593]: User 'admin' left the configuration menu. Feb 12 23:18:19.616848 osdx OSDxCLI[781593]: User 'admin' executed a new command: 'system journal show | tail -n 20'. Feb 12 23:18:19.708664 osdx OSDxCLI[781593]: 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
2026-02-12 23:18:20.528106 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2026-02-12 23:18:20.543232 auth-notice , OSDxCLI: User 'admin' left the configuration menu. 2026-02-12 23:18:20.629577 auth-notice , OSDxCLI: User 'admin' has logged out. 2026-02-12 23:18:22.169204 auth-notice , OSDxCLI: User 'admin' has logged in. 2026-02-12 23:18:22.320012 auth-notice , OSDxCLI: User 'admin' entered the configuration menu. 2026-02-12 23:18:22.397579 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'set system description DESC2'. 2026-02-12 23:18:22.497190 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'show changes'. 2026-02-12 23:18:22.589241 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2026-02-12 23:18:22.655576 auth-notice , OSDxCLI: User 'admin' left the configuration menu.