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 24 09:34:50.000513 osdx systemd-timedated[48488]: Changed local time to Tue 2026-03-24 09:34:50 UTC
Mar 24 09:34:50.002219 osdx OSDxCLI[32276]: User 'admin' executed a new command: 'set date 2026-03-24 09:34:50'.
Mar 24 09:34:50.002671 osdx systemd-journald[1775]: Time jumped backwards, rotating.
Mar 24 09:34:50.334573 osdx sudo[48492]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Mar 24 09:34:50.338828 osdx systemd-journald[1775]: Runtime Journal (/run/log/journal/7e3c4dd6c8d74b1c9c9747e610a7f242) is 1.9M, max 13.8M, 11.8M free.
Mar 24 09:34:50.342679 osdx systemd-journald[1775]: Received client request to rotate journal, rotating.
Mar 24 09:34:50.342753 osdx systemd-journald[1775]: Vacuuming done, freed 0B of archived journals from /run/log/journal/7e3c4dd6c8d74b1c9c9747e610a7f242.
Mar 24 09:34:50.342878 osdx sudo[48491]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Mar 24 09:34:50.349703 osdx OSDxCLI[32276]: User 'admin' executed a new command: 'system journal clear'.
Mar 24 09:34:50.570884 osdx OSDxCLI[32276]: User 'admin' executed a new command: 'system coredump delete all'.
Mar 24 09:34:50.799241 osdx OSDxCLI[32276]: User 'admin' entered the configuration menu.
Mar 24 09:34:50.858437 osdx OSDxCLI[32276]: User 'admin' added a new cfg line: 'set system description DESC1'.
Mar 24 09:34:50.967731 osdx OSDxCLI[32276]: User 'admin' added a new cfg line: 'show working'.
Mar 24 09:34:51.068206 osdx ubnt-cfgd[48511]: inactive
Mar 24 09:34:51.081858 osdx INFO[48517]: FRR daemons did not change
Mar 24 09:34:51.090478 osdx cfgd[1474]: [32276]Completed change to active configuration
Mar 24 09:34:51.092228 osdx OSDxCLI[32276]: User 'admin' committed the configuration.
Mar 24 09:34:51.107917 osdx OSDxCLI[32276]: 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-24 09:27

Step 4: Run command system journal show | tail -n 20 at DUT0 and expect this output:

Show output
Mar 24 09:34:50.000513 osdx systemd-timedated[48488]: Changed local time to Tue 2026-03-24 09:34:50 UTC
Mar 24 09:34:50.002219 osdx OSDxCLI[32276]: User 'admin' executed a new command: 'set date 2026-03-24 09:34:50'.
Mar 24 09:34:50.002671 osdx systemd-journald[1775]: Time jumped backwards, rotating.
Mar 24 09:34:50.334573 osdx sudo[48492]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Mar 24 09:34:50.338828 osdx systemd-journald[1775]: Runtime Journal (/run/log/journal/7e3c4dd6c8d74b1c9c9747e610a7f242) is 1.9M, max 13.8M, 11.8M free.
Mar 24 09:34:50.342679 osdx systemd-journald[1775]: Received client request to rotate journal, rotating.
Mar 24 09:34:50.342753 osdx systemd-journald[1775]: Vacuuming done, freed 0B of archived journals from /run/log/journal/7e3c4dd6c8d74b1c9c9747e610a7f242.
Mar 24 09:34:50.342878 osdx sudo[48491]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Mar 24 09:34:50.349703 osdx OSDxCLI[32276]: User 'admin' executed a new command: 'system journal clear'.
Mar 24 09:34:50.570884 osdx OSDxCLI[32276]: User 'admin' executed a new command: 'system coredump delete all'.
Mar 24 09:34:50.799241 osdx OSDxCLI[32276]: User 'admin' entered the configuration menu.
Mar 24 09:34:50.858437 osdx OSDxCLI[32276]: User 'admin' added a new cfg line: 'set system description DESC1'.
Mar 24 09:34:50.967731 osdx OSDxCLI[32276]: User 'admin' added a new cfg line: 'show working'.
Mar 24 09:34:51.068206 osdx ubnt-cfgd[48511]: inactive
Mar 24 09:34:51.081858 osdx INFO[48517]: FRR daemons did not change
Mar 24 09:34:51.090478 osdx cfgd[1474]: [32276]Completed change to active configuration
Mar 24 09:34:51.092228 osdx OSDxCLI[32276]: User 'admin' committed the configuration.
Mar 24 09:34:51.107917 osdx OSDxCLI[32276]: User 'admin' left the configuration menu.
Mar 24 09:34:51.267295 osdx OSDxCLI[32276]: User 'admin' executed a new command: 'system journal show | tail -n 20'.
Mar 24 09:34:51.333838 osdx OSDxCLI[32276]: 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-24 09:34:51.968681 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2026-03-24 09:34:52.001516 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.
2026-03-24 09:34:52.061410 auth-notice , OSDxCLI:  User 'admin' has logged out.
2026-03-24 09:34:53.745838 auth-notice , OSDxCLI:  User 'admin' has logged in.
2026-03-24 09:34:53.882012 auth-notice , OSDxCLI:  User 'admin' entered the configuration menu.
2026-03-24 09:34:53.942236 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'set system description DESC2'.
2026-03-24 09:34:54.041935 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'show changes'.
2026-03-24 09:34:54.128365 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2026-03-24 09:34:54.178709 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.