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 24 12:26:18.314735 osdx systemd-journald[1663]: Runtime Journal (/run/log/journal/a9c8f5b24ca148a6b10e0198640df300) is 2.0M, max 15.3M, 13.3M free.
Jun 24 12:26:18.318716 osdx systemd-journald[1663]: Received client request to rotate journal, rotating.
Jun 24 12:26:18.318797 osdx systemd-journald[1663]: Vacuuming done, freed 0B of archived journals from /run/log/journal/a9c8f5b24ca148a6b10e0198640df300.
Jun 24 12:26:18.327226 osdx OSDxCLI[71519]: User 'admin' executed a new command: 'system journal clear'.
Jun 24 12:26:18.654010 osdx OSDxCLI[71519]: User 'admin' executed a new command: 'system coredump delete all'.
Jun 24 12:26:19.059761 osdx OSDxCLI[71519]: User 'admin' entered the configuration menu.
Jun 24 12:26:19.120571 osdx OSDxCLI[71519]: User 'admin' added a new cfg line: 'set system description DESC1'.
Jun 24 12:26:19.238942 osdx OSDxCLI[71519]: User 'admin' added a new cfg line: 'show working'.
Jun 24 12:26:19.340784 osdx ubnt-cfgd[114424]: inactive
Jun 24 12:26:19.359673 osdx INFO[114430]: FRR daemons did not change
Jun 24 12:26:19.371250 osdx cfgd[1460]: [71519]Completed change to active configuration
Jun 24 12:26:19.373420 osdx OSDxCLI[71519]: User 'admin' committed the configuration.
Jun 24 12:26:19.391147 osdx OSDxCLI[71519]: 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-06-24 12:04

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

Show output
Jun 24 12:26:18.314735 osdx systemd-journald[1663]: Runtime Journal (/run/log/journal/a9c8f5b24ca148a6b10e0198640df300) is 2.0M, max 15.3M, 13.3M free.
Jun 24 12:26:18.318716 osdx systemd-journald[1663]: Received client request to rotate journal, rotating.
Jun 24 12:26:18.318797 osdx systemd-journald[1663]: Vacuuming done, freed 0B of archived journals from /run/log/journal/a9c8f5b24ca148a6b10e0198640df300.
Jun 24 12:26:18.327226 osdx OSDxCLI[71519]: User 'admin' executed a new command: 'system journal clear'.
Jun 24 12:26:18.654010 osdx OSDxCLI[71519]: User 'admin' executed a new command: 'system coredump delete all'.
Jun 24 12:26:19.059761 osdx OSDxCLI[71519]: User 'admin' entered the configuration menu.
Jun 24 12:26:19.120571 osdx OSDxCLI[71519]: User 'admin' added a new cfg line: 'set system description DESC1'.
Jun 24 12:26:19.238942 osdx OSDxCLI[71519]: User 'admin' added a new cfg line: 'show working'.
Jun 24 12:26:19.340784 osdx ubnt-cfgd[114424]: inactive
Jun 24 12:26:19.359673 osdx INFO[114430]: FRR daemons did not change
Jun 24 12:26:19.371250 osdx cfgd[1460]: [71519]Completed change to active configuration
Jun 24 12:26:19.373420 osdx OSDxCLI[71519]: User 'admin' committed the configuration.
Jun 24 12:26:19.391147 osdx OSDxCLI[71519]: User 'admin' left the configuration menu.
Jun 24 12:26:19.537153 osdx OSDxCLI[71519]: User 'admin' executed a new command: 'system journal show | tail -n 20'.
Jun 24 12:26:19.618038 osdx OSDxCLI[71519]: 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-06-24 12:26:20.267717 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-06-24 12:26:20.299104 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.
2025-06-24 12:26:20.383595 auth-notice , OSDxCLI:  User 'admin' has logged out.
2025-06-24 12:26:22.085445 auth-notice , OSDxCLI:  User 'admin' has logged in.
2025-06-24 12:26:22.246103 auth-notice , OSDxCLI:  User 'admin' entered the configuration menu.
2025-06-24 12:26:22.325839 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'set system description DESC2'.
2025-06-24 12:26:22.453376 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'show changes'.
2025-06-24 12:26:22.602431 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-06-24 12:26:22.620038 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.