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
Feb 03 14:37:35.402707 osdx systemd-journald[1936]: Runtime Journal (/run/log/journal/0b455e05fd8849079cae205af04c9e16) is 2.0M, max 15.3M, 13.2M free.
Feb 03 14:37:35.405505 osdx systemd-journald[1936]: Received client request to rotate journal, rotating.
Feb 03 14:37:35.405587 osdx systemd-journald[1936]: Vacuuming done, freed 0B of archived journals from /run/log/journal/0b455e05fd8849079cae205af04c9e16.
Feb 03 14:37:35.421377 osdx OSDxCLI[399790]: User 'admin' executed a new command: 'system journal clear'.
Feb 03 14:37:35.935679 osdx osdx-coredump[400331]: Deleting all coredumps in /opt/vyatta/etc/config/coredump...
Feb 03 14:37:35.946787 osdx OSDxCLI[399790]: User 'admin' executed a new command: 'system coredump delete all'.
Feb 03 14:37:36.620281 osdx OSDxCLI[399790]: User 'admin' entered the configuration menu.
Feb 03 14:37:36.746736 osdx OSDxCLI[399790]: User 'admin' added a new cfg line: 'set system description DESC1'.
Feb 03 14:37:36.870960 osdx OSDxCLI[399790]: User 'admin' added a new cfg line: 'show working'.
Feb 03 14:37:36.993996 osdx INFO[400348]: FRR daemons did not change
Feb 03 14:37:37.017820 osdx cfgd[1636]: [399790]Completed change to active configuration
Feb 03 14:37:37.021106 osdx OSDxCLI[399790]: User 'admin' committed the configuration.
Feb 03 14:37:37.085393 osdx OSDxCLI[399790]: 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-02-03 14:37

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

Show output
Feb 03 14:37:35.402707 osdx systemd-journald[1936]: Runtime Journal (/run/log/journal/0b455e05fd8849079cae205af04c9e16) is 2.0M, max 15.3M, 13.2M free.
Feb 03 14:37:35.405505 osdx systemd-journald[1936]: Received client request to rotate journal, rotating.
Feb 03 14:37:35.405587 osdx systemd-journald[1936]: Vacuuming done, freed 0B of archived journals from /run/log/journal/0b455e05fd8849079cae205af04c9e16.
Feb 03 14:37:35.421377 osdx OSDxCLI[399790]: User 'admin' executed a new command: 'system journal clear'.
Feb 03 14:37:35.935679 osdx osdx-coredump[400331]: Deleting all coredumps in /opt/vyatta/etc/config/coredump...
Feb 03 14:37:35.946787 osdx OSDxCLI[399790]: User 'admin' executed a new command: 'system coredump delete all'.
Feb 03 14:37:36.620281 osdx OSDxCLI[399790]: User 'admin' entered the configuration menu.
Feb 03 14:37:36.746736 osdx OSDxCLI[399790]: User 'admin' added a new cfg line: 'set system description DESC1'.
Feb 03 14:37:36.870960 osdx OSDxCLI[399790]: User 'admin' added a new cfg line: 'show working'.
Feb 03 14:37:36.993996 osdx INFO[400348]: FRR daemons did not change
Feb 03 14:37:37.017820 osdx cfgd[1636]: [399790]Completed change to active configuration
Feb 03 14:37:37.021106 osdx OSDxCLI[399790]: User 'admin' committed the configuration.
Feb 03 14:37:37.085393 osdx OSDxCLI[399790]: User 'admin' left the configuration menu.
Feb 03 14:37:37.261945 osdx OSDxCLI[399790]: User 'admin' executed a new command: 'system journal show | tail -n 20'.
Feb 03 14:37:37.371651 osdx OSDxCLI[399790]: 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-02-03 14:37:38.260379 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-02-03 14:37:38.301684 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.
2025-02-03 14:37:38.403812 auth-notice , OSDxCLI:  User 'admin' has logged out.
2025-02-03 14:37:40.047199 auth-notice , OSDxCLI:  User 'admin' has logged in.
2025-02-03 14:37:40.242366 auth-notice , OSDxCLI:  User 'admin' entered the configuration menu.
2025-02-03 14:37:40.344490 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'set system description DESC2'.
2025-02-03 14:37:40.458539 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'show changes'.
2025-02-03 14:37:40.628783 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-02-03 14:37:40.660908 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.