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
Jul 28 10:22:02.008712 osdx systemd-timedated[325724]: Changed local time to Mon 2025-07-28 10:22:02 UTC Jul 28 10:22:02.027548 osdx systemd-journald[1773]: Time jumped backwards, rotating. Jul 28 10:22:02.020040 osdx OSDxCLI[196423]: User 'admin' executed a new command: 'set date 2025-07-28 10:22:02'. Jul 28 10:22:02.696484 osdx systemd-journald[1773]: Runtime Journal (/run/log/journal/a46937b51a3a4c469575696f63c9d620) is 3.9M, max 15.3M, 11.4M free. Jul 28 10:22:02.698674 osdx systemd-journald[1773]: Received client request to rotate journal, rotating. Jul 28 10:22:02.698791 osdx systemd-journald[1773]: Vacuuming done, freed 0B of archived journals from /run/log/journal/a46937b51a3a4c469575696f63c9d620. Jul 28 10:22:02.715454 osdx OSDxCLI[196423]: User 'admin' executed a new command: 'system journal clear'. Jul 28 10:22:03.209172 osdx OSDxCLI[196423]: User 'admin' executed a new command: 'system coredump delete all'. Jul 28 10:22:03.899529 osdx OSDxCLI[196423]: User 'admin' entered the configuration menu. Jul 28 10:22:04.066600 osdx OSDxCLI[196423]: User 'admin' added a new cfg line: 'set system description DESC1'. Jul 28 10:22:04.257651 osdx OSDxCLI[196423]: User 'admin' added a new cfg line: 'show working'. Jul 28 10:22:04.391458 osdx ubnt-cfgd[325747]: inactive Jul 28 10:22:04.442089 osdx INFO[325753]: FRR daemons did not change Jul 28 10:22:04.483299 osdx cfgd[1473]: [196423]Completed change to active configuration Jul 28 10:22:04.486524 osdx OSDxCLI[196423]: User 'admin' committed the configuration. Jul 28 10:22:04.530175 osdx OSDxCLI[196423]: 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-07-28 08:49
Step 4: Run command system journal show | tail -n 20
at DUT0
and expect this output:
Show output
Jul 28 10:22:02.008712 osdx systemd-timedated[325724]: Changed local time to Mon 2025-07-28 10:22:02 UTC Jul 28 10:22:02.027548 osdx systemd-journald[1773]: Time jumped backwards, rotating. Jul 28 10:22:02.020040 osdx OSDxCLI[196423]: User 'admin' executed a new command: 'set date 2025-07-28 10:22:02'. Jul 28 10:22:02.696484 osdx systemd-journald[1773]: Runtime Journal (/run/log/journal/a46937b51a3a4c469575696f63c9d620) is 3.9M, max 15.3M, 11.4M free. Jul 28 10:22:02.698674 osdx systemd-journald[1773]: Received client request to rotate journal, rotating. Jul 28 10:22:02.698791 osdx systemd-journald[1773]: Vacuuming done, freed 0B of archived journals from /run/log/journal/a46937b51a3a4c469575696f63c9d620. Jul 28 10:22:02.715454 osdx OSDxCLI[196423]: User 'admin' executed a new command: 'system journal clear'. Jul 28 10:22:03.209172 osdx OSDxCLI[196423]: User 'admin' executed a new command: 'system coredump delete all'. Jul 28 10:22:03.899529 osdx OSDxCLI[196423]: User 'admin' entered the configuration menu. Jul 28 10:22:04.066600 osdx OSDxCLI[196423]: User 'admin' added a new cfg line: 'set system description DESC1'. Jul 28 10:22:04.257651 osdx OSDxCLI[196423]: User 'admin' added a new cfg line: 'show working'. Jul 28 10:22:04.391458 osdx ubnt-cfgd[325747]: inactive Jul 28 10:22:04.442089 osdx INFO[325753]: FRR daemons did not change Jul 28 10:22:04.483299 osdx cfgd[1473]: [196423]Completed change to active configuration Jul 28 10:22:04.486524 osdx OSDxCLI[196423]: User 'admin' committed the configuration. Jul 28 10:22:04.530175 osdx OSDxCLI[196423]: User 'admin' left the configuration menu. Jul 28 10:22:04.782564 osdx OSDxCLI[196423]: User 'admin' executed a new command: 'system journal show | tail -n 20'. Jul 28 10:22:04.908583 osdx OSDxCLI[196423]: 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-07-28 10:22:06.196830 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2025-07-28 10:22:06.271731 auth-notice , OSDxCLI: User 'admin' left the configuration menu. 2025-07-28 10:22:06.406898 auth-notice , OSDxCLI: User 'admin' has logged out. 2025-07-28 10:22:08.433620 auth-notice , OSDxCLI: User 'admin' has logged in. 2025-07-28 10:22:08.712213 auth-notice , OSDxCLI: User 'admin' entered the configuration menu. 2025-07-28 10:22:08.856815 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'set system description DESC2'. 2025-07-28 10:22:09.041647 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'show changes'. 2025-07-28 10:22:09.300495 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2025-07-28 10:22:09.358440 auth-notice , OSDxCLI: User 'admin' left the configuration menu.