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
Mar 05 17:09:14.340385 osdx systemd-journald[2121]: Runtime Journal (/run/log/journal/78445f9299f9414990e66dc8aa510838) is 1.8M, max 13.8M, 11.9M free. Mar 05 17:09:14.341235 osdx systemd-journald[2121]: Received client request to rotate journal, rotating. Mar 05 17:09:14.341279 osdx systemd-journald[2121]: Vacuuming done, freed 0B of archived journals from /run/log/journal/78445f9299f9414990e66dc8aa510838. Mar 05 17:09:14.351644 osdx OSDxCLI[288385]: User 'admin' executed a new command: 'system journal clear'. Mar 05 17:09:14.590666 osdx OSDxCLI[288385]: User 'admin' executed a new command: 'system coredump delete all'. Mar 05 17:09:14.839862 osdx OSDxCLI[288385]: User 'admin' entered the configuration menu. Mar 05 17:09:14.909121 osdx OSDxCLI[288385]: User 'admin' added a new cfg line: 'set system description DESC1'. Mar 05 17:09:15.016333 osdx OSDxCLI[288385]: User 'admin' added a new cfg line: 'show working'. Mar 05 17:09:15.075653 osdx ubnt-cfgd[436396]: inactive Mar 05 17:09:15.090991 osdx INFO[436402]: FRR daemons did not change Mar 05 17:09:15.098602 osdx cfgd[1863]: [288385]Completed change to active configuration Mar 05 17:09:15.100803 osdx OSDxCLI[288385]: User 'admin' committed the configuration. Mar 05 17:09:15.138509 osdx OSDxCLI[288385]: 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-03-05 15:59
Step 4: Run command system journal show | tail -n 20 at DUT0 and expect this output:
Show output
Mar 05 17:09:14.340385 osdx systemd-journald[2121]: Runtime Journal (/run/log/journal/78445f9299f9414990e66dc8aa510838) is 1.8M, max 13.8M, 11.9M free. Mar 05 17:09:14.341235 osdx systemd-journald[2121]: Received client request to rotate journal, rotating. Mar 05 17:09:14.341279 osdx systemd-journald[2121]: Vacuuming done, freed 0B of archived journals from /run/log/journal/78445f9299f9414990e66dc8aa510838. Mar 05 17:09:14.351644 osdx OSDxCLI[288385]: User 'admin' executed a new command: 'system journal clear'. Mar 05 17:09:14.590666 osdx OSDxCLI[288385]: User 'admin' executed a new command: 'system coredump delete all'. Mar 05 17:09:14.839862 osdx OSDxCLI[288385]: User 'admin' entered the configuration menu. Mar 05 17:09:14.909121 osdx OSDxCLI[288385]: User 'admin' added a new cfg line: 'set system description DESC1'. Mar 05 17:09:15.016333 osdx OSDxCLI[288385]: User 'admin' added a new cfg line: 'show working'. Mar 05 17:09:15.075653 osdx ubnt-cfgd[436396]: inactive Mar 05 17:09:15.090991 osdx INFO[436402]: FRR daemons did not change Mar 05 17:09:15.098602 osdx cfgd[1863]: [288385]Completed change to active configuration Mar 05 17:09:15.100803 osdx OSDxCLI[288385]: User 'admin' committed the configuration. Mar 05 17:09:15.138509 osdx OSDxCLI[288385]: User 'admin' left the configuration menu. Mar 05 17:09:15.282749 osdx OSDxCLI[288385]: User 'admin' executed a new command: 'system journal show | tail -n 20'. Mar 05 17:09:15.348466 osdx OSDxCLI[288385]: 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-03-05 17:09:15.971196 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2026-03-05 17:09:15.998888 auth-notice , OSDxCLI: User 'admin' left the configuration menu. 2026-03-05 17:09:16.111170 auth-notice , OSDxCLI: User 'admin' has logged out. 2026-03-05 17:09:17.739670 auth-notice , OSDxCLI: User 'admin' has logged in. 2026-03-05 17:09:17.872460 auth-notice , OSDxCLI: User 'admin' entered the configuration menu. 2026-03-05 17:09:17.963783 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'set system description DESC2'. 2026-03-05 17:09:18.058072 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'show changes'. 2026-03-05 17:09:18.142820 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2026-03-05 17:09:18.173975 auth-notice , OSDxCLI: User 'admin' left the configuration menu.