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
Jun 02 08:50:30.000155 osdx systemd-timedated[150720]: Changed local time to Tue 2026-06-02 08:50:30 UTC
Jun 02 08:50:30.001207 osdx OSDxCLI[151281]: User 'admin' executed a new command: 'set date 2026-06-02 08:50:30'.
Jun 02 08:50:30.002073 osdx systemd-journald[148515]: Time jumped backwards, rotating.
Jun 02 08:50:30.284416 osdx sudo[151468]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Jun 02 08:50:30.288147 osdx systemd-journald[148515]: Runtime Journal (/run/log/journal/a0363f0a73514b24b35c4ba7ae73dc6e) is 2.0M, max 13.8M, 11.7M free.
Jun 02 08:50:30.290068 osdx systemd-journald[148515]: Received client request to rotate journal, rotating.
Jun 02 08:50:30.290118 osdx systemd-journald[148515]: Vacuuming done, freed 0B of archived journals from /run/log/journal/a0363f0a73514b24b35c4ba7ae73dc6e.
Jun 02 08:50:30.292235 osdx sudo[151467]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Jun 02 08:50:30.298729 osdx OSDxCLI[151281]: User 'admin' executed a new command: 'system journal clear'.
Jun 02 08:50:30.557596 osdx OSDxCLI[151281]: User 'admin' executed a new command: 'system coredump delete all'.
Jun 02 08:50:30.907631 osdx OSDxCLI[151281]: User 'admin' entered the configuration menu.
Jun 02 08:50:31.029529 osdx OSDxCLI[151281]: User 'admin' added a new cfg line: 'set system description DESC1'.
Jun 02 08:50:31.160399 osdx OSDxCLI[151281]: User 'admin' added a new cfg line: 'show working'.
Jun 02 08:50:31.269642 osdx ubnt-cfgd[151487]: inactive
Jun 02 08:50:31.284994 osdx INFO[151493]: FRR daemons did not change
Jun 02 08:50:31.294338 osdx cfgd[1665]: [151281]Completed change to active configuration
Jun 02 08:50:31.296588 osdx OSDxCLI[151281]: User 'admin' committed the configuration.
Jun 02 08:50:31.320882 osdx OSDxCLI[151281]: 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-06-02 08:50

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

Show output
Jun 02 08:50:30.000155 osdx systemd-timedated[150720]: Changed local time to Tue 2026-06-02 08:50:30 UTC
Jun 02 08:50:30.001207 osdx OSDxCLI[151281]: User 'admin' executed a new command: 'set date 2026-06-02 08:50:30'.
Jun 02 08:50:30.002073 osdx systemd-journald[148515]: Time jumped backwards, rotating.
Jun 02 08:50:30.284416 osdx sudo[151468]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Jun 02 08:50:30.288147 osdx systemd-journald[148515]: Runtime Journal (/run/log/journal/a0363f0a73514b24b35c4ba7ae73dc6e) is 2.0M, max 13.8M, 11.7M free.
Jun 02 08:50:30.290068 osdx systemd-journald[148515]: Received client request to rotate journal, rotating.
Jun 02 08:50:30.290118 osdx systemd-journald[148515]: Vacuuming done, freed 0B of archived journals from /run/log/journal/a0363f0a73514b24b35c4ba7ae73dc6e.
Jun 02 08:50:30.292235 osdx sudo[151467]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Jun 02 08:50:30.298729 osdx OSDxCLI[151281]: User 'admin' executed a new command: 'system journal clear'.
Jun 02 08:50:30.557596 osdx OSDxCLI[151281]: User 'admin' executed a new command: 'system coredump delete all'.
Jun 02 08:50:30.907631 osdx OSDxCLI[151281]: User 'admin' entered the configuration menu.
Jun 02 08:50:31.029529 osdx OSDxCLI[151281]: User 'admin' added a new cfg line: 'set system description DESC1'.
Jun 02 08:50:31.160399 osdx OSDxCLI[151281]: User 'admin' added a new cfg line: 'show working'.
Jun 02 08:50:31.269642 osdx ubnt-cfgd[151487]: inactive
Jun 02 08:50:31.284994 osdx INFO[151493]: FRR daemons did not change
Jun 02 08:50:31.294338 osdx cfgd[1665]: [151281]Completed change to active configuration
Jun 02 08:50:31.296588 osdx OSDxCLI[151281]: User 'admin' committed the configuration.
Jun 02 08:50:31.320882 osdx OSDxCLI[151281]: User 'admin' left the configuration menu.
Jun 02 08:50:31.461731 osdx OSDxCLI[151281]: User 'admin' executed a new command: 'system journal show | tail -n 20'.
Jun 02 08:50:31.533158 osdx OSDxCLI[151281]: 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-06-02 08:50:32.276086 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2026-06-02 08:50:32.360860 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.
2026-06-02 08:50:32.394267 auth-notice , OSDxCLI:  User 'admin' has logged out.
2026-06-02 08:50:34.078517 auth-notice , OSDxCLI:  User 'admin' has logged in.
2026-06-02 08:50:34.222911 auth-notice , OSDxCLI:  User 'admin' entered the configuration menu.
2026-06-02 08:50:34.281311 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'set system description DESC2'.
2026-06-02 08:50:34.379131 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'show changes'.
2026-06-02 08:50:34.474100 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2026-06-02 08:50:34.518146 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.