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
Dec 11 15:03:22.320027 osdx systemd-journald[1970]: Runtime Journal (/run/log/journal/ff8de1b7feed4cd0a923a6e53f75b1b9) is 1.8M, max 13.8M, 11.9M free.
Dec 11 15:03:22.320735 osdx systemd-journald[1970]: Received client request to rotate journal, rotating.
Dec 11 15:03:22.320801 osdx systemd-journald[1970]: Vacuuming done, freed 0B of archived journals from /run/log/journal/ff8de1b7feed4cd0a923a6e53f75b1b9.
Dec 11 15:03:22.331289 osdx OSDxCLI[124044]: User 'admin' executed a new command: 'system journal clear'.
Dec 11 15:03:22.584495 osdx OSDxCLI[124044]: User 'admin' executed a new command: 'system coredump delete all'.
Dec 11 15:03:22.813701 osdx OSDxCLI[124044]: User 'admin' entered the configuration menu.
Dec 11 15:03:22.873823 osdx OSDxCLI[124044]: User 'admin' added a new cfg line: 'set system description DESC1'.
Dec 11 15:03:22.985017 osdx OSDxCLI[124044]: User 'admin' added a new cfg line: 'show working'.
Dec 11 15:03:23.052961 osdx ubnt-cfgd[124263]: inactive
Dec 11 15:03:23.067934 osdx INFO[124269]: FRR daemons did not change
Dec 11 15:03:23.075781 osdx cfgd[1647]: [124044]Completed change to active configuration
Dec 11 15:03:23.077923 osdx OSDxCLI[124044]: User 'admin' committed the configuration.
Dec 11 15:03:23.121632 osdx OSDxCLI[124044]: 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-12-11 15:03

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

Show output
Dec 11 15:03:22.320027 osdx systemd-journald[1970]: Runtime Journal (/run/log/journal/ff8de1b7feed4cd0a923a6e53f75b1b9) is 1.8M, max 13.8M, 11.9M free.
Dec 11 15:03:22.320735 osdx systemd-journald[1970]: Received client request to rotate journal, rotating.
Dec 11 15:03:22.320801 osdx systemd-journald[1970]: Vacuuming done, freed 0B of archived journals from /run/log/journal/ff8de1b7feed4cd0a923a6e53f75b1b9.
Dec 11 15:03:22.331289 osdx OSDxCLI[124044]: User 'admin' executed a new command: 'system journal clear'.
Dec 11 15:03:22.584495 osdx OSDxCLI[124044]: User 'admin' executed a new command: 'system coredump delete all'.
Dec 11 15:03:22.813701 osdx OSDxCLI[124044]: User 'admin' entered the configuration menu.
Dec 11 15:03:22.873823 osdx OSDxCLI[124044]: User 'admin' added a new cfg line: 'set system description DESC1'.
Dec 11 15:03:22.985017 osdx OSDxCLI[124044]: User 'admin' added a new cfg line: 'show working'.
Dec 11 15:03:23.052961 osdx ubnt-cfgd[124263]: inactive
Dec 11 15:03:23.067934 osdx INFO[124269]: FRR daemons did not change
Dec 11 15:03:23.075781 osdx cfgd[1647]: [124044]Completed change to active configuration
Dec 11 15:03:23.077923 osdx OSDxCLI[124044]: User 'admin' committed the configuration.
Dec 11 15:03:23.121632 osdx OSDxCLI[124044]: User 'admin' left the configuration menu.
Dec 11 15:03:23.224176 osdx OSDxCLI[124044]: User 'admin' executed a new command: 'system journal show | tail -n 20'.
Dec 11 15:03:23.289355 osdx OSDxCLI[124044]: 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-12-11 15:03:23.973870 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-12-11 15:03:23.989429 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.
2025-12-11 15:03:24.074880 auth-notice , OSDxCLI:  User 'admin' has logged out.
2025-12-11 15:03:25.700795 auth-notice , OSDxCLI:  User 'admin' has logged in.
2025-12-11 15:03:25.866829 auth-notice , OSDxCLI:  User 'admin' entered the configuration menu.
2025-12-11 15:03:25.931228 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'set system description DESC2'.
2025-12-11 15:03:26.025909 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'show changes'.
2025-12-11 15:03:26.109679 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-12-11 15:03:26.152017 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.