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
Oct 10 19:05:32.284381 osdx systemd-journald[1670]: Runtime Journal (/run/log/journal/d6792964fe7547c9a60a3d774aa97dac) is 1.8M, max 13.8M, 11.9M free.
Oct 10 19:05:32.285089 osdx systemd-journald[1670]: Received client request to rotate journal, rotating.
Oct 10 19:05:32.285138 osdx systemd-journald[1670]: Vacuuming done, freed 0B of archived journals from /run/log/journal/d6792964fe7547c9a60a3d774aa97dac.
Oct 10 19:05:32.294084 osdx OSDxCLI[121253]: User 'admin' executed a new command: 'system journal clear'.
Oct 10 19:05:32.506697 osdx OSDxCLI[121253]: User 'admin' executed a new command: 'system coredump delete all'.
Oct 10 19:05:32.751315 osdx OSDxCLI[121253]: User 'admin' entered the configuration menu.
Oct 10 19:05:32.805997 osdx OSDxCLI[121253]: User 'admin' added a new cfg line: 'set system description DESC1'.
Oct 10 19:05:32.912369 osdx OSDxCLI[121253]: User 'admin' added a new cfg line: 'show working'.
Oct 10 19:05:32.968602 osdx ubnt-cfgd[179182]: inactive
Oct 10 19:05:32.985745 osdx INFO[179188]: FRR daemons did not change
Oct 10 19:05:32.995945 osdx cfgd[1464]: [121253]Completed change to active configuration
Oct 10 19:05:32.998547 osdx OSDxCLI[121253]: User 'admin' committed the configuration.
Oct 10 19:05:33.032761 osdx OSDxCLI[121253]: 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-10-10 18:36

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

Show output
Oct 10 19:05:32.284381 osdx systemd-journald[1670]: Runtime Journal (/run/log/journal/d6792964fe7547c9a60a3d774aa97dac) is 1.8M, max 13.8M, 11.9M free.
Oct 10 19:05:32.285089 osdx systemd-journald[1670]: Received client request to rotate journal, rotating.
Oct 10 19:05:32.285138 osdx systemd-journald[1670]: Vacuuming done, freed 0B of archived journals from /run/log/journal/d6792964fe7547c9a60a3d774aa97dac.
Oct 10 19:05:32.294084 osdx OSDxCLI[121253]: User 'admin' executed a new command: 'system journal clear'.
Oct 10 19:05:32.506697 osdx OSDxCLI[121253]: User 'admin' executed a new command: 'system coredump delete all'.
Oct 10 19:05:32.751315 osdx OSDxCLI[121253]: User 'admin' entered the configuration menu.
Oct 10 19:05:32.805997 osdx OSDxCLI[121253]: User 'admin' added a new cfg line: 'set system description DESC1'.
Oct 10 19:05:32.912369 osdx OSDxCLI[121253]: User 'admin' added a new cfg line: 'show working'.
Oct 10 19:05:32.968602 osdx ubnt-cfgd[179182]: inactive
Oct 10 19:05:32.985745 osdx INFO[179188]: FRR daemons did not change
Oct 10 19:05:32.995945 osdx cfgd[1464]: [121253]Completed change to active configuration
Oct 10 19:05:32.998547 osdx OSDxCLI[121253]: User 'admin' committed the configuration.
Oct 10 19:05:33.032761 osdx OSDxCLI[121253]: User 'admin' left the configuration menu.
Oct 10 19:05:33.166601 osdx OSDxCLI[121253]: User 'admin' executed a new command: 'system journal show | tail -n 20'.
Oct 10 19:05:33.233024 osdx OSDxCLI[121253]: 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-10-10 19:05:34.058737 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-10-10 19:05:34.075649 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.
2025-10-10 19:05:34.159029 auth-notice , OSDxCLI:  User 'admin' has logged out.
2025-10-10 19:05:35.729142 auth-notice , OSDxCLI:  User 'admin' has logged in.
2025-10-10 19:05:35.855352 auth-notice , OSDxCLI:  User 'admin' entered the configuration menu.
2025-10-10 19:05:35.922434 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'set system description DESC2'.
2025-10-10 19:05:36.018190 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'show changes'.
2025-10-10 19:05:36.097450 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-10-10 19:05:36.639819 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.