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
Nov 25 13:20:13.302747 osdx systemd-journald[542263]: Runtime Journal (/run/log/journal/3dabd6c33b8e497d9fdbc41689ab0c32) is 1.9M, max 13.8M, 11.8M free.
Nov 25 13:20:13.305977 osdx systemd-journald[542263]: Received client request to rotate journal, rotating.
Nov 25 13:20:13.306032 osdx systemd-journald[542263]: Vacuuming done, freed 0B of archived journals from /run/log/journal/3dabd6c33b8e497d9fdbc41689ab0c32.
Nov 25 13:20:13.306701 osdx sudo[546844]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Nov 25 13:20:13.316342 osdx OSDxCLI[546662]: User 'admin' executed a new command: 'system journal clear'.
Nov 25 13:20:13.536434 osdx OSDxCLI[546662]: User 'admin' executed a new command: 'system coredump delete all'.
Nov 25 13:20:13.761328 osdx OSDxCLI[546662]: User 'admin' entered the configuration menu.
Nov 25 13:20:13.828401 osdx OSDxCLI[546662]: User 'admin' added a new cfg line: 'set system description DESC1'.
Nov 25 13:20:13.933819 osdx OSDxCLI[546662]: User 'admin' added a new cfg line: 'show working'.
Nov 25 13:20:13.990764 osdx ubnt-cfgd[546864]: inactive
Nov 25 13:20:14.003921 osdx INFO[546870]: FRR daemons did not change
Nov 25 13:20:14.056939 osdx cfgd[1655]: [546662]Completed change to active configuration
Nov 25 13:20:14.059009 osdx OSDxCLI[546662]: User 'admin' committed the configuration.
Nov 25 13:20:14.075700 osdx OSDxCLI[546662]: 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-11-25 13:20

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

Show output
Nov 25 13:20:13.302747 osdx systemd-journald[542263]: Runtime Journal (/run/log/journal/3dabd6c33b8e497d9fdbc41689ab0c32) is 1.9M, max 13.8M, 11.8M free.
Nov 25 13:20:13.305977 osdx systemd-journald[542263]: Received client request to rotate journal, rotating.
Nov 25 13:20:13.306032 osdx systemd-journald[542263]: Vacuuming done, freed 0B of archived journals from /run/log/journal/3dabd6c33b8e497d9fdbc41689ab0c32.
Nov 25 13:20:13.306701 osdx sudo[546844]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Nov 25 13:20:13.316342 osdx OSDxCLI[546662]: User 'admin' executed a new command: 'system journal clear'.
Nov 25 13:20:13.536434 osdx OSDxCLI[546662]: User 'admin' executed a new command: 'system coredump delete all'.
Nov 25 13:20:13.761328 osdx OSDxCLI[546662]: User 'admin' entered the configuration menu.
Nov 25 13:20:13.828401 osdx OSDxCLI[546662]: User 'admin' added a new cfg line: 'set system description DESC1'.
Nov 25 13:20:13.933819 osdx OSDxCLI[546662]: User 'admin' added a new cfg line: 'show working'.
Nov 25 13:20:13.990764 osdx ubnt-cfgd[546864]: inactive
Nov 25 13:20:14.003921 osdx INFO[546870]: FRR daemons did not change
Nov 25 13:20:14.056939 osdx cfgd[1655]: [546662]Completed change to active configuration
Nov 25 13:20:14.059009 osdx OSDxCLI[546662]: User 'admin' committed the configuration.
Nov 25 13:20:14.075700 osdx OSDxCLI[546662]: User 'admin' left the configuration menu.
Nov 25 13:20:14.213161 osdx OSDxCLI[546662]: User 'admin' executed a new command: 'system journal show | tail -n 20'.
Nov 25 13:20:14.277725 osdx OSDxCLI[546662]: 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-11-25 13:20:14.949065 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-11-25 13:20:14.975186 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.
2025-11-25 13:20:15.056508 auth-notice , OSDxCLI:  User 'admin' has logged out.
2025-11-25 13:20:16.743072 auth-notice , OSDxCLI:  User 'admin' has logged in.
2025-11-25 13:20:16.889389 auth-notice , OSDxCLI:  User 'admin' entered the configuration menu.
2025-11-25 13:20:16.950344 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'set system description DESC2'.
2025-11-25 13:20:17.051939 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'show changes'.
2025-11-25 13:20:17.144012 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-11-25 13:20:17.176517 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.