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
Sep 05 14:10:56.294920 osdx systemd-journald[132215]: Runtime Journal (/run/log/journal/277fa7f754984f629482974adff2eda9) is 1.9M, max 13.8M, 11.8M free.
Sep 05 14:10:56.298153 osdx systemd-journald[132215]: Received client request to rotate journal, rotating.
Sep 05 14:10:56.298204 osdx systemd-journald[132215]: Vacuuming done, freed 0B of archived journals from /run/log/journal/277fa7f754984f629482974adff2eda9.
Sep 05 14:10:56.299125 osdx sudo[142105]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Sep 05 14:10:56.305714 osdx OSDxCLI[141921]: User 'admin' executed a new command: 'system journal clear'.
Sep 05 14:10:56.525537 osdx OSDxCLI[141921]: User 'admin' executed a new command: 'system coredump delete all'.
Sep 05 14:10:56.814499 osdx OSDxCLI[141921]: User 'admin' entered the configuration menu.
Sep 05 14:10:56.891497 osdx OSDxCLI[141921]: User 'admin' added a new cfg line: 'set system description DESC1'.
Sep 05 14:10:56.998879 osdx OSDxCLI[141921]: User 'admin' added a new cfg line: 'show working'.
Sep 05 14:10:57.066596 osdx ubnt-cfgd[142125]: inactive
Sep 05 14:10:57.084185 osdx INFO[142131]: FRR daemons did not change
Sep 05 14:10:57.095815 osdx cfgd[1463]: [141921]Completed change to active configuration
Sep 05 14:10:57.098143 osdx OSDxCLI[141921]: User 'admin' committed the configuration.
Sep 05 14:10:57.145453 osdx OSDxCLI[141921]: 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-09-05 14:10

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

Show output
Sep 05 14:10:56.294920 osdx systemd-journald[132215]: Runtime Journal (/run/log/journal/277fa7f754984f629482974adff2eda9) is 1.9M, max 13.8M, 11.8M free.
Sep 05 14:10:56.298153 osdx systemd-journald[132215]: Received client request to rotate journal, rotating.
Sep 05 14:10:56.298204 osdx systemd-journald[132215]: Vacuuming done, freed 0B of archived journals from /run/log/journal/277fa7f754984f629482974adff2eda9.
Sep 05 14:10:56.299125 osdx sudo[142105]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Sep 05 14:10:56.305714 osdx OSDxCLI[141921]: User 'admin' executed a new command: 'system journal clear'.
Sep 05 14:10:56.525537 osdx OSDxCLI[141921]: User 'admin' executed a new command: 'system coredump delete all'.
Sep 05 14:10:56.814499 osdx OSDxCLI[141921]: User 'admin' entered the configuration menu.
Sep 05 14:10:56.891497 osdx OSDxCLI[141921]: User 'admin' added a new cfg line: 'set system description DESC1'.
Sep 05 14:10:56.998879 osdx OSDxCLI[141921]: User 'admin' added a new cfg line: 'show working'.
Sep 05 14:10:57.066596 osdx ubnt-cfgd[142125]: inactive
Sep 05 14:10:57.084185 osdx INFO[142131]: FRR daemons did not change
Sep 05 14:10:57.095815 osdx cfgd[1463]: [141921]Completed change to active configuration
Sep 05 14:10:57.098143 osdx OSDxCLI[141921]: User 'admin' committed the configuration.
Sep 05 14:10:57.145453 osdx OSDxCLI[141921]: User 'admin' left the configuration menu.
Sep 05 14:10:57.332097 osdx OSDxCLI[141921]: User 'admin' executed a new command: 'system journal show | tail -n 20'.
Sep 05 14:10:57.426318 osdx OSDxCLI[141921]: 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-09-05 14:10:58.187181 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-09-05 14:10:58.215396 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.
2025-09-05 14:10:58.302498 auth-notice , OSDxCLI:  User 'admin' has logged out.
2025-09-05 14:10:59.849308 auth-notice , OSDxCLI:  User 'admin' has logged in.
2025-09-05 14:10:59.999422 auth-notice , OSDxCLI:  User 'admin' entered the configuration menu.
2025-09-05 14:11:00.078312 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'set system description DESC2'.
2025-09-05 14:11:00.179712 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'show changes'.
2025-09-05 14:11:00.317573 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-09-05 14:11:00.366232 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.