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
Apr 16 16:20:38.304944 osdx systemd-journald[126917]: Runtime Journal (/run/log/journal/a3fecc5be5e949c7a083b0adeea4bb21) is 1.8M, max 13.8M, 11.9M free.
Apr 16 16:20:38.308181 osdx systemd-journald[126917]: Received client request to rotate journal, rotating.
Apr 16 16:20:38.308236 osdx systemd-journald[126917]: Vacuuming done, freed 0B of archived journals from /run/log/journal/a3fecc5be5e949c7a083b0adeea4bb21.
Apr 16 16:20:38.316465 osdx OSDxCLI[165502]: User 'admin' executed a new command: 'system journal clear'.
Apr 16 16:20:38.531950 osdx OSDxCLI[165502]: User 'admin' executed a new command: 'system coredump delete all'.
Apr 16 16:20:38.775879 osdx OSDxCLI[165502]: User 'admin' entered the configuration menu.
Apr 16 16:20:38.841058 osdx OSDxCLI[165502]: User 'admin' added a new cfg line: 'set system description DESC1'.
Apr 16 16:20:38.941259 osdx OSDxCLI[165502]: User 'admin' added a new cfg line: 'show working'.
Apr 16 16:20:39.007681 osdx ubnt-cfgd[187462]: inactive
Apr 16 16:20:39.025131 osdx INFO[187468]: FRR daemons did not change
Apr 16 16:20:39.034148 osdx cfgd[1833]: [165502]Completed change to active configuration
Apr 16 16:20:39.036611 osdx OSDxCLI[165502]: User 'admin' committed the configuration.
Apr 16 16:20:39.074972 osdx OSDxCLI[165502]: 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-03-23 00:01

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

Show output
Apr 16 16:20:38.304944 osdx systemd-journald[126917]: Runtime Journal (/run/log/journal/a3fecc5be5e949c7a083b0adeea4bb21) is 1.8M, max 13.8M, 11.9M free.
Apr 16 16:20:38.308181 osdx systemd-journald[126917]: Received client request to rotate journal, rotating.
Apr 16 16:20:38.308236 osdx systemd-journald[126917]: Vacuuming done, freed 0B of archived journals from /run/log/journal/a3fecc5be5e949c7a083b0adeea4bb21.
Apr 16 16:20:38.316465 osdx OSDxCLI[165502]: User 'admin' executed a new command: 'system journal clear'.
Apr 16 16:20:38.531950 osdx OSDxCLI[165502]: User 'admin' executed a new command: 'system coredump delete all'.
Apr 16 16:20:38.775879 osdx OSDxCLI[165502]: User 'admin' entered the configuration menu.
Apr 16 16:20:38.841058 osdx OSDxCLI[165502]: User 'admin' added a new cfg line: 'set system description DESC1'.
Apr 16 16:20:38.941259 osdx OSDxCLI[165502]: User 'admin' added a new cfg line: 'show working'.
Apr 16 16:20:39.007681 osdx ubnt-cfgd[187462]: inactive
Apr 16 16:20:39.025131 osdx INFO[187468]: FRR daemons did not change
Apr 16 16:20:39.034148 osdx cfgd[1833]: [165502]Completed change to active configuration
Apr 16 16:20:39.036611 osdx OSDxCLI[165502]: User 'admin' committed the configuration.
Apr 16 16:20:39.074972 osdx OSDxCLI[165502]: User 'admin' left the configuration menu.
Apr 16 16:20:39.231137 osdx OSDxCLI[165502]: User 'admin' executed a new command: 'system journal show | tail -n 20'.
Apr 16 16:20:39.290289 osdx OSDxCLI[165502]: 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-04-16 16:20:39.917361 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2026-04-16 16:20:39.944189 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.
2026-04-16 16:20:40.018411 auth-notice , OSDxCLI:  User 'admin' has logged out.
2026-04-16 16:20:41.663619 auth-notice , OSDxCLI:  User 'admin' has logged in.
2026-04-16 16:20:41.805652 auth-notice , OSDxCLI:  User 'admin' entered the configuration menu.
2026-04-16 16:20:41.877376 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'set system description DESC2'.
2026-04-16 16:20:41.986392 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'show changes'.
2026-04-16 16:20:42.129728 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2026-04-16 16:20:42.145795 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.