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
Jan 27 16:23:15.319901 osdx systemd-journald[1842]: Runtime Journal (/run/log/journal/7f16b2c6785447ce99316296df636466) is 1.8M, max 13.8M, 11.9M free.
Jan 27 16:23:15.321936 osdx systemd-journald[1842]: Received client request to rotate journal, rotating.
Jan 27 16:23:15.321988 osdx systemd-journald[1842]: Vacuuming done, freed 0B of archived journals from /run/log/journal/7f16b2c6785447ce99316296df636466.
Jan 27 16:23:15.331802 osdx OSDxCLI[7173]: User 'admin' executed a new command: 'system journal clear'.
Jan 27 16:23:15.590026 osdx OSDxCLI[7173]: User 'admin' executed a new command: 'system coredump delete all'.
Jan 27 16:23:15.917910 osdx OSDxCLI[7173]: User 'admin' entered the configuration menu.
Jan 27 16:23:15.985295 osdx OSDxCLI[7173]: User 'admin' added a new cfg line: 'set system description DESC1'.
Jan 27 16:23:16.095390 osdx OSDxCLI[7173]: User 'admin' added a new cfg line: 'show working'.
Jan 27 16:23:16.151755 osdx ubnt-cfgd[7392]: inactive
Jan 27 16:23:16.167017 osdx INFO[7398]: FRR daemons did not change
Jan 27 16:23:16.174168 osdx cfgd[1623]: [7173]Completed change to active configuration
Jan 27 16:23:16.176185 osdx OSDxCLI[7173]: User 'admin' committed the configuration.
Jan 27 16:23:16.213390 osdx OSDxCLI[7173]: 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-01-27 16:23

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

Show output
Jan 27 16:23:15.319901 osdx systemd-journald[1842]: Runtime Journal (/run/log/journal/7f16b2c6785447ce99316296df636466) is 1.8M, max 13.8M, 11.9M free.
Jan 27 16:23:15.321936 osdx systemd-journald[1842]: Received client request to rotate journal, rotating.
Jan 27 16:23:15.321988 osdx systemd-journald[1842]: Vacuuming done, freed 0B of archived journals from /run/log/journal/7f16b2c6785447ce99316296df636466.
Jan 27 16:23:15.331802 osdx OSDxCLI[7173]: User 'admin' executed a new command: 'system journal clear'.
Jan 27 16:23:15.590026 osdx OSDxCLI[7173]: User 'admin' executed a new command: 'system coredump delete all'.
Jan 27 16:23:15.917910 osdx OSDxCLI[7173]: User 'admin' entered the configuration menu.
Jan 27 16:23:15.985295 osdx OSDxCLI[7173]: User 'admin' added a new cfg line: 'set system description DESC1'.
Jan 27 16:23:16.095390 osdx OSDxCLI[7173]: User 'admin' added a new cfg line: 'show working'.
Jan 27 16:23:16.151755 osdx ubnt-cfgd[7392]: inactive
Jan 27 16:23:16.167017 osdx INFO[7398]: FRR daemons did not change
Jan 27 16:23:16.174168 osdx cfgd[1623]: [7173]Completed change to active configuration
Jan 27 16:23:16.176185 osdx OSDxCLI[7173]: User 'admin' committed the configuration.
Jan 27 16:23:16.213390 osdx OSDxCLI[7173]: User 'admin' left the configuration menu.
Jan 27 16:23:16.352088 osdx OSDxCLI[7173]: User 'admin' executed a new command: 'system journal show | tail -n 20'.
Jan 27 16:23:16.428172 osdx OSDxCLI[7173]: 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-01-27 16:23:17.131334 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2026-01-27 16:23:17.147308 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.
2026-01-27 16:23:17.252992 auth-notice , OSDxCLI:  User 'admin' has logged out.
2026-01-27 16:23:18.787260 auth-notice , OSDxCLI:  User 'admin' has logged in.
2026-01-27 16:23:18.918211 auth-notice , OSDxCLI:  User 'admin' entered the configuration menu.
2026-01-27 16:23:18.985900 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'set system description DESC2'.
2026-01-27 16:23:19.087287 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'show changes'.
2026-01-27 16:23:19.229594 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2026-01-27 16:23:19.258072 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.