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
May 13 15:59:43.312595 osdx systemd-journald[1688]: Runtime Journal (/run/log/journal/78d6c860b8a549a191d002c20b18506e) is 2.1M, max 15.3M, 13.2M free.
May 13 15:59:43.315869 osdx systemd-journald[1688]: Received client request to rotate journal, rotating.
May 13 15:59:43.315920 osdx systemd-journald[1688]: Vacuuming done, freed 0B of archived journals from /run/log/journal/78d6c860b8a549a191d002c20b18506e.
May 13 15:59:43.316746 osdx sudo[260393]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
May 13 15:59:43.324492 osdx OSDxCLI[247528]: User 'admin' executed a new command: 'system journal clear'.
May 13 15:59:43.586152 osdx sudo[260401]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
May 13 15:59:43.690264 osdx sudo[260406]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
May 13 15:59:43.739887 osdx osdx-coredump[260408]: Deleting all coredumps in /opt/vyatta/etc/config/coredump...
May 13 15:59:43.748838 osdx OSDxCLI[247528]: User 'admin' executed a new command: 'system coredump delete all'.
May 13 15:59:44.260876 osdx OSDxCLI[247528]: User 'admin' entered the configuration menu.
May 13 15:59:44.333545 osdx OSDxCLI[247528]: User 'admin' added a new cfg line: 'set system description DESC1'.
May 13 15:59:44.468469 osdx OSDxCLI[247528]: User 'admin' added a new cfg line: 'show working'.
May 13 15:59:44.596949 osdx ubnt-cfgd[260421]: inactive
May 13 15:59:44.614737 osdx INFO[260427]: FRR daemons did not change
May 13 15:59:44.624436 osdx cfgd[1466]: [247528]Completed change to active configuration
May 13 15:59:44.626629 osdx OSDxCLI[247528]: User 'admin' committed the configuration.
May 13 15:59:44.657802 osdx OSDxCLI[247528]: 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-05-13 15:51

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

Show output
May 13 15:59:43.312595 osdx systemd-journald[1688]: Runtime Journal (/run/log/journal/78d6c860b8a549a191d002c20b18506e) is 2.1M, max 15.3M, 13.2M free.
May 13 15:59:43.315869 osdx systemd-journald[1688]: Received client request to rotate journal, rotating.
May 13 15:59:43.315920 osdx systemd-journald[1688]: Vacuuming done, freed 0B of archived journals from /run/log/journal/78d6c860b8a549a191d002c20b18506e.
May 13 15:59:43.316746 osdx sudo[260393]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
May 13 15:59:43.324492 osdx OSDxCLI[247528]: User 'admin' executed a new command: 'system journal clear'.
May 13 15:59:43.586152 osdx sudo[260401]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
May 13 15:59:43.690264 osdx sudo[260406]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
May 13 15:59:43.739887 osdx osdx-coredump[260408]: Deleting all coredumps in /opt/vyatta/etc/config/coredump...
May 13 15:59:43.748838 osdx OSDxCLI[247528]: User 'admin' executed a new command: 'system coredump delete all'.
May 13 15:59:44.260876 osdx OSDxCLI[247528]: User 'admin' entered the configuration menu.
May 13 15:59:44.333545 osdx OSDxCLI[247528]: User 'admin' added a new cfg line: 'set system description DESC1'.
May 13 15:59:44.468469 osdx OSDxCLI[247528]: User 'admin' added a new cfg line: 'show working'.
May 13 15:59:44.596949 osdx ubnt-cfgd[260421]: inactive
May 13 15:59:44.614737 osdx INFO[260427]: FRR daemons did not change
May 13 15:59:44.624436 osdx cfgd[1466]: [247528]Completed change to active configuration
May 13 15:59:44.626629 osdx OSDxCLI[247528]: User 'admin' committed the configuration.
May 13 15:59:44.657802 osdx OSDxCLI[247528]: User 'admin' left the configuration menu.
May 13 15:59:44.793561 osdx OSDxCLI[247528]: User 'admin' executed a new command: 'system journal show | tail -n 20'.
May 13 15:59:44.859758 osdx OSDxCLI[247528]: 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-05-13 15:59:45.637248 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-05-13 15:59:45.654231 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.
2025-05-13 15:59:45.741705 auth-notice , OSDxCLI:  User 'admin' has logged out.
2025-05-13 15:59:47.387160 auth-notice , OSDxCLI:  User 'admin' has logged in.
2025-05-13 15:59:47.536970 auth-notice , OSDxCLI:  User 'admin' entered the configuration menu.
2025-05-13 15:59:47.605004 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'set system description DESC2'.
2025-05-13 15:59:47.708696 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'show changes'.
2025-05-13 15:59:47.821940 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-05-13 15:59:47.853150 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.