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
Apr 10 17:07:39.001044 osdx systemd-journald[1983]: Time jumped backwards, rotating.
Apr 10 17:07:39.001724 osdx OSDxCLI[164021]: User 'admin' executed a new command: 'set date 2025-04-10 17:07:39'.
Apr 10 17:07:39.313819 osdx sudo[164263]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Apr 10 17:07:39.316806 osdx systemd-journald[1983]: Runtime Journal (/run/log/journal/1b38a2acfb83465bb2abfbc9ee1b5d42) is 2.2M, max 15.3M, 13.1M free.
Apr 10 17:07:39.317243 osdx systemd-journald[1983]: Received client request to rotate journal, rotating.
Apr 10 17:07:39.317274 osdx systemd-journald[1983]: Vacuuming done, freed 0B of archived journals from /run/log/journal/1b38a2acfb83465bb2abfbc9ee1b5d42.
Apr 10 17:07:39.322168 osdx sudo[164262]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Apr 10 17:07:39.329735 osdx OSDxCLI[164021]: User 'admin' executed a new command: 'system journal clear'.
Apr 10 17:07:39.544441 osdx sudo[164270]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Apr 10 17:07:39.630957 osdx sudo[164275]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Apr 10 17:07:39.678179 osdx osdx-coredump[164277]: Deleting all coredumps in /opt/vyatta/etc/config/coredump...
Apr 10 17:07:39.686141 osdx OSDxCLI[164021]: User 'admin' executed a new command: 'system coredump delete all'.
Apr 10 17:07:40.229005 osdx OSDxCLI[164021]: User 'admin' entered the configuration menu.
Apr 10 17:07:40.324908 osdx OSDxCLI[164021]: User 'admin' added a new cfg line: 'set system description DESC1'.
Apr 10 17:07:40.392447 osdx OSDxCLI[164021]: User 'admin' added a new cfg line: 'show working'.
Apr 10 17:07:40.491215 osdx ubnt-cfgd[164292]: inactive
Apr 10 17:07:40.535922 osdx INFO[164298]: FRR daemons did not change
Apr 10 17:07:40.547712 osdx cfgd[1673]: [164021]Completed change to active configuration
Apr 10 17:07:40.549556 osdx OSDxCLI[164021]: User 'admin' committed the configuration.
Apr 10 17:07:40.566205 osdx OSDxCLI[164021]: 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-04-10 17:07

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

Show output
Apr 10 17:07:39.313819 osdx sudo[164263]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Apr 10 17:07:39.316806 osdx systemd-journald[1983]: Runtime Journal (/run/log/journal/1b38a2acfb83465bb2abfbc9ee1b5d42) is 2.2M, max 15.3M, 13.1M free.
Apr 10 17:07:39.317243 osdx systemd-journald[1983]: Received client request to rotate journal, rotating.
Apr 10 17:07:39.317274 osdx systemd-journald[1983]: Vacuuming done, freed 0B of archived journals from /run/log/journal/1b38a2acfb83465bb2abfbc9ee1b5d42.
Apr 10 17:07:39.322168 osdx sudo[164262]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Apr 10 17:07:39.329735 osdx OSDxCLI[164021]: User 'admin' executed a new command: 'system journal clear'.
Apr 10 17:07:39.544441 osdx sudo[164270]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Apr 10 17:07:39.630957 osdx sudo[164275]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Apr 10 17:07:39.678179 osdx osdx-coredump[164277]: Deleting all coredumps in /opt/vyatta/etc/config/coredump...
Apr 10 17:07:39.686141 osdx OSDxCLI[164021]: User 'admin' executed a new command: 'system coredump delete all'.
Apr 10 17:07:40.229005 osdx OSDxCLI[164021]: User 'admin' entered the configuration menu.
Apr 10 17:07:40.324908 osdx OSDxCLI[164021]: User 'admin' added a new cfg line: 'set system description DESC1'.
Apr 10 17:07:40.392447 osdx OSDxCLI[164021]: User 'admin' added a new cfg line: 'show working'.
Apr 10 17:07:40.491215 osdx ubnt-cfgd[164292]: inactive
Apr 10 17:07:40.535922 osdx INFO[164298]: FRR daemons did not change
Apr 10 17:07:40.547712 osdx cfgd[1673]: [164021]Completed change to active configuration
Apr 10 17:07:40.549556 osdx OSDxCLI[164021]: User 'admin' committed the configuration.
Apr 10 17:07:40.566205 osdx OSDxCLI[164021]: User 'admin' left the configuration menu.
Apr 10 17:07:40.712567 osdx OSDxCLI[164021]: User 'admin' executed a new command: 'system journal show | tail -n 20'.
Apr 10 17:07:40.777682 osdx OSDxCLI[164021]: 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-04-10 17:07:41.497626 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-04-10 17:07:41.526499 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.
2025-04-10 17:07:41.603611 auth-notice , OSDxCLI:  User 'admin' has logged out.
2025-04-10 17:07:43.108696 auth-notice , OSDxCLI:  User 'admin' has logged in.
2025-04-10 17:07:43.256538 auth-notice , OSDxCLI:  User 'admin' entered the configuration menu.
2025-04-10 17:07:43.318698 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'set system description DESC2'.
2025-04-10 17:07:43.411977 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'show changes'.
2025-04-10 17:07:43.557548 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-04-10 17:07:43.575259 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.