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
Mar 20 13:55:02.329422 osdx systemd-journald[2054]: Runtime Journal (/run/log/journal/ba147585e3944580985006d3d45a280a) is 2.3M, max 17.2M, 14.9M free.
Mar 20 13:55:02.331093 osdx systemd-journald[2054]: Received client request to rotate journal, rotating.
Mar 20 13:55:02.331149 osdx systemd-journald[2054]: Vacuuming done, freed 0B of archived journals from /run/log/journal/ba147585e3944580985006d3d45a280a.
Mar 20 13:55:02.340378 osdx OSDxCLI[649579]: User 'admin' executed a new command: 'system journal clear'.
Mar 20 13:55:02.615411 osdx OSDxCLI[649579]: User 'admin' executed a new command: 'system coredump delete all'.
Mar 20 13:55:02.878697 osdx OSDxCLI[649579]: User 'admin' entered the configuration menu.
Mar 20 13:55:02.934580 osdx OSDxCLI[649579]: User 'admin' added a new cfg line: 'set system description DESC1'.
Mar 20 13:55:03.056217 osdx OSDxCLI[649579]: User 'admin' added a new cfg line: 'show working'.
Mar 20 13:55:03.140114 osdx ubnt-cfgd[649811]: inactive
Mar 20 13:55:03.156213 osdx INFO[649817]: FRR daemons did not change
Mar 20 13:55:03.162737 osdx cfgd[1833]: [649579]Completed change to active configuration
Mar 20 13:55:03.164527 osdx OSDxCLI[649579]: User 'admin' committed the configuration.
Mar 20 13:55:03.179789 osdx OSDxCLI[649579]: 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-03-20 13:54

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

Show output
Mar 20 13:55:02.329422 osdx systemd-journald[2054]: Runtime Journal (/run/log/journal/ba147585e3944580985006d3d45a280a) is 2.3M, max 17.2M, 14.9M free.
Mar 20 13:55:02.331093 osdx systemd-journald[2054]: Received client request to rotate journal, rotating.
Mar 20 13:55:02.331149 osdx systemd-journald[2054]: Vacuuming done, freed 0B of archived journals from /run/log/journal/ba147585e3944580985006d3d45a280a.
Mar 20 13:55:02.340378 osdx OSDxCLI[649579]: User 'admin' executed a new command: 'system journal clear'.
Mar 20 13:55:02.615411 osdx OSDxCLI[649579]: User 'admin' executed a new command: 'system coredump delete all'.
Mar 20 13:55:02.878697 osdx OSDxCLI[649579]: User 'admin' entered the configuration menu.
Mar 20 13:55:02.934580 osdx OSDxCLI[649579]: User 'admin' added a new cfg line: 'set system description DESC1'.
Mar 20 13:55:03.056217 osdx OSDxCLI[649579]: User 'admin' added a new cfg line: 'show working'.
Mar 20 13:55:03.140114 osdx ubnt-cfgd[649811]: inactive
Mar 20 13:55:03.156213 osdx INFO[649817]: FRR daemons did not change
Mar 20 13:55:03.162737 osdx cfgd[1833]: [649579]Completed change to active configuration
Mar 20 13:55:03.164527 osdx OSDxCLI[649579]: User 'admin' committed the configuration.
Mar 20 13:55:03.179789 osdx OSDxCLI[649579]: User 'admin' left the configuration menu.
Mar 20 13:55:03.309205 osdx OSDxCLI[649579]: User 'admin' executed a new command: 'system journal show | tail -n 20'.
Mar 20 13:55:03.367883 osdx OSDxCLI[649579]: 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-03-20 13:55:04.008133 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2026-03-20 13:55:04.027111 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.
2026-03-20 13:55:04.128604 auth-notice , OSDxCLI:  User 'admin' has logged out.
2026-03-20 13:55:05.626365 auth-notice , OSDxCLI:  User 'admin' has logged in.
2026-03-20 13:55:05.774815 auth-notice , OSDxCLI:  User 'admin' entered the configuration menu.
2026-03-20 13:55:05.836170 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'set system description DESC2'.
2026-03-20 13:55:05.930902 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'show changes'.
2026-03-20 13:55:06.018376 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2026-03-20 13:55:06.059329 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.