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
Oct 07 11:28:27.293276 osdx systemd-journald[115269]: Runtime Journal (/run/log/journal/ea320b11e8924984abe0660bdd8d3fcc) is 2.0M, max 15.3M, 13.3M free.
Oct 07 11:28:27.294200 osdx systemd-journald[115269]: Received client request to rotate journal, rotating.
Oct 07 11:28:27.294235 osdx systemd-journald[115269]: Vacuuming done, freed 0B of archived journals from /run/log/journal/ea320b11e8924984abe0660bdd8d3fcc.
Oct 07 11:28:27.303159 osdx OSDxCLI[173468]: User 'admin' executed a new command: 'system journal clear'.
Oct 07 11:28:27.651781 osdx osdx-coredump[200251]: Deleting all coredumps in /opt/vyatta/etc/config/coredump...
Oct 07 11:28:27.659565 osdx OSDxCLI[173468]: User 'admin' executed a new command: 'system coredump delete all'.
Oct 07 11:28:28.136921 osdx OSDxCLI[173468]: User 'admin' entered the configuration menu.
Oct 07 11:28:28.195913 osdx OSDxCLI[173468]: User 'admin' added a new cfg line: 'set system description DESC1'.
Oct 07 11:28:28.307662 osdx OSDxCLI[173468]: User 'admin' added a new cfg line: 'show working'.
Oct 07 11:28:28.376574 osdx cfgd[1439]: [173468]Completed change to active configuration
Oct 07 11:28:28.378516 osdx OSDxCLI[173468]: User 'admin' committed the configuration.
Oct 07 11:28:28.417276 osdx OSDxCLI[173468]: 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        2024-10-07 11:08

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

Show output
Oct 07 11:28:27.293276 osdx systemd-journald[115269]: Runtime Journal (/run/log/journal/ea320b11e8924984abe0660bdd8d3fcc) is 2.0M, max 15.3M, 13.3M free.
Oct 07 11:28:27.294200 osdx systemd-journald[115269]: Received client request to rotate journal, rotating.
Oct 07 11:28:27.294235 osdx systemd-journald[115269]: Vacuuming done, freed 0B of archived journals from /run/log/journal/ea320b11e8924984abe0660bdd8d3fcc.
Oct 07 11:28:27.303159 osdx OSDxCLI[173468]: User 'admin' executed a new command: 'system journal clear'.
Oct 07 11:28:27.651781 osdx osdx-coredump[200251]: Deleting all coredumps in /opt/vyatta/etc/config/coredump...
Oct 07 11:28:27.659565 osdx OSDxCLI[173468]: User 'admin' executed a new command: 'system coredump delete all'.
Oct 07 11:28:28.136921 osdx OSDxCLI[173468]: User 'admin' entered the configuration menu.
Oct 07 11:28:28.195913 osdx OSDxCLI[173468]: User 'admin' added a new cfg line: 'set system description DESC1'.
Oct 07 11:28:28.307662 osdx OSDxCLI[173468]: User 'admin' added a new cfg line: 'show working'.
Oct 07 11:28:28.376574 osdx cfgd[1439]: [173468]Completed change to active configuration
Oct 07 11:28:28.378516 osdx OSDxCLI[173468]: User 'admin' committed the configuration.
Oct 07 11:28:28.417276 osdx OSDxCLI[173468]: User 'admin' left the configuration menu.
Oct 07 11:28:28.550794 osdx OSDxCLI[173468]: User 'admin' executed a new command: 'system journal show | tail -n 20'.
Oct 07 11:28:28.616414 osdx OSDxCLI[173468]: 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
2024-10-07 11:28:29.223927 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2024-10-07 11:28:29.247147 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.
2024-10-07 11:28:29.321574 auth-notice , OSDxCLI:  User 'admin' has logged out.
2024-10-07 11:28:30.850766 auth-notice , OSDxCLI:  User 'admin' has logged in.
2024-10-07 11:28:30.989031 auth-notice , OSDxCLI:  User 'admin' entered the configuration menu.
2024-10-07 11:28:31.048548 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'set system description DESC2'.
2024-10-07 11:28:31.186003 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'show changes'.
2024-10-07 11:28:31.256164 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2024-10-07 11:28:31.301811 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.