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
Dec 17 16:56:51.284994 osdx systemd-journald[1666]: Runtime Journal (/run/log/journal/a189e667ab9f46898dbfc92a68a94f73) is 1.8M, max 13.8M, 11.9M free.
Dec 17 16:56:51.285464 osdx systemd-journald[1666]: Received client request to rotate journal, rotating.
Dec 17 16:56:51.285524 osdx systemd-journald[1666]: Vacuuming done, freed 0B of archived journals from /run/log/journal/a189e667ab9f46898dbfc92a68a94f73.
Dec 17 16:56:51.294816 osdx OSDxCLI[84617]: User 'admin' executed a new command: 'system journal clear'.
Dec 17 16:56:51.522035 osdx OSDxCLI[84617]: User 'admin' executed a new command: 'system coredump delete all'.
Dec 17 16:56:51.839070 osdx OSDxCLI[84617]: User 'admin' entered the configuration menu.
Dec 17 16:56:51.892572 osdx OSDxCLI[84617]: User 'admin' added a new cfg line: 'set system description DESC1'.
Dec 17 16:56:52.005465 osdx OSDxCLI[84617]: User 'admin' added a new cfg line: 'show working'.
Dec 17 16:56:52.093714 osdx ubnt-cfgd[89240]: inactive
Dec 17 16:56:52.107665 osdx INFO[89246]: FRR daemons did not change
Dec 17 16:56:52.114404 osdx cfgd[1460]: [84617]Completed change to active configuration
Dec 17 16:56:52.116494 osdx OSDxCLI[84617]: User 'admin' committed the configuration.
Dec 17 16:56:52.131536 osdx OSDxCLI[84617]: 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-12-17 16:54

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

Show output
Dec 17 16:56:51.284994 osdx systemd-journald[1666]: Runtime Journal (/run/log/journal/a189e667ab9f46898dbfc92a68a94f73) is 1.8M, max 13.8M, 11.9M free.
Dec 17 16:56:51.285464 osdx systemd-journald[1666]: Received client request to rotate journal, rotating.
Dec 17 16:56:51.285524 osdx systemd-journald[1666]: Vacuuming done, freed 0B of archived journals from /run/log/journal/a189e667ab9f46898dbfc92a68a94f73.
Dec 17 16:56:51.294816 osdx OSDxCLI[84617]: User 'admin' executed a new command: 'system journal clear'.
Dec 17 16:56:51.522035 osdx OSDxCLI[84617]: User 'admin' executed a new command: 'system coredump delete all'.
Dec 17 16:56:51.839070 osdx OSDxCLI[84617]: User 'admin' entered the configuration menu.
Dec 17 16:56:51.892572 osdx OSDxCLI[84617]: User 'admin' added a new cfg line: 'set system description DESC1'.
Dec 17 16:56:52.005465 osdx OSDxCLI[84617]: User 'admin' added a new cfg line: 'show working'.
Dec 17 16:56:52.093714 osdx ubnt-cfgd[89240]: inactive
Dec 17 16:56:52.107665 osdx INFO[89246]: FRR daemons did not change
Dec 17 16:56:52.114404 osdx cfgd[1460]: [84617]Completed change to active configuration
Dec 17 16:56:52.116494 osdx OSDxCLI[84617]: User 'admin' committed the configuration.
Dec 17 16:56:52.131536 osdx OSDxCLI[84617]: User 'admin' left the configuration menu.
Dec 17 16:56:52.262869 osdx OSDxCLI[84617]: User 'admin' executed a new command: 'system journal show | tail -n 20'.
Dec 17 16:56:52.323824 osdx OSDxCLI[84617]: 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-12-17 16:56:52.915116 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-12-17 16:56:52.931525 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.
2025-12-17 16:56:53.021588 auth-notice , OSDxCLI:  User 'admin' has logged out.
2025-12-17 16:56:54.656435 auth-notice , OSDxCLI:  User 'admin' has logged in.
2025-12-17 16:56:54.816071 auth-notice , OSDxCLI:  User 'admin' entered the configuration menu.
2025-12-17 16:56:54.901828 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'set system description DESC2'.
2025-12-17 16:56:55.014435 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'show changes'.
2025-12-17 16:56:55.111446 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-12-17 16:56:55.145391 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.