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 21 22:01:09.782682 osdx systemd-journald[135576]: Runtime Journal (/run/log/journal/4aed3ffce77740a989e5dd98f632940c) is 1.9M, max 15.3M, 13.3M free. Mar 21 22:01:09.785826 osdx systemd-journald[135576]: Received client request to rotate journal, rotating. Mar 21 22:01:09.785916 osdx systemd-journald[135576]: Vacuuming done, freed 0B of archived journals from /run/log/journal/4aed3ffce77740a989e5dd98f632940c. Mar 21 22:01:09.810078 osdx OSDxCLI[138548]: User 'admin' executed a new command: 'system journal clear'. Mar 21 22:01:10.589995 osdx osdx-coredump[138915]: Deleting all coredumps in /opt/vyatta/etc/config/coredump... Mar 21 22:01:10.613000 osdx OSDxCLI[138548]: User 'admin' executed a new command: 'system coredump delete all'. Mar 21 22:01:11.524828 osdx OSDxCLI[138548]: User 'admin' entered the configuration menu. Mar 21 22:01:11.639456 osdx OSDxCLI[138548]: User 'admin' added a new cfg line: 'set system description DESC1'. Mar 21 22:01:11.806359 osdx OSDxCLI[138548]: User 'admin' added a new cfg line: 'show working'. Mar 21 22:01:11.942173 osdx ubnt-cfgd[138932]: inactive Mar 21 22:01:12.411338 osdx INFO[138942]: FRR daemons did not change Mar 21 22:01:12.447948 osdx cfgd[1728]: [138548]Completed change to active configuration Mar 21 22:01:12.451390 osdx OSDxCLI[138548]: User 'admin' committed the configuration. Mar 21 22:01:12.494873 osdx OSDxCLI[138548]: 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-03-21 22:00
Step 4: Run command system journal show | tail -n 20
at DUT0
and expect this output:
Show output
Mar 21 22:01:09.782682 osdx systemd-journald[135576]: Runtime Journal (/run/log/journal/4aed3ffce77740a989e5dd98f632940c) is 1.9M, max 15.3M, 13.3M free. Mar 21 22:01:09.785826 osdx systemd-journald[135576]: Received client request to rotate journal, rotating. Mar 21 22:01:09.785916 osdx systemd-journald[135576]: Vacuuming done, freed 0B of archived journals from /run/log/journal/4aed3ffce77740a989e5dd98f632940c. Mar 21 22:01:09.810078 osdx OSDxCLI[138548]: User 'admin' executed a new command: 'system journal clear'. Mar 21 22:01:10.589995 osdx osdx-coredump[138915]: Deleting all coredumps in /opt/vyatta/etc/config/coredump... Mar 21 22:01:10.613000 osdx OSDxCLI[138548]: User 'admin' executed a new command: 'system coredump delete all'. Mar 21 22:01:11.524828 osdx OSDxCLI[138548]: User 'admin' entered the configuration menu. Mar 21 22:01:11.639456 osdx OSDxCLI[138548]: User 'admin' added a new cfg line: 'set system description DESC1'. Mar 21 22:01:11.806359 osdx OSDxCLI[138548]: User 'admin' added a new cfg line: 'show working'. Mar 21 22:01:11.942173 osdx ubnt-cfgd[138932]: inactive Mar 21 22:01:12.411338 osdx INFO[138942]: FRR daemons did not change Mar 21 22:01:12.447948 osdx cfgd[1728]: [138548]Completed change to active configuration Mar 21 22:01:12.451390 osdx OSDxCLI[138548]: User 'admin' committed the configuration. Mar 21 22:01:12.494873 osdx OSDxCLI[138548]: User 'admin' left the configuration menu. Mar 21 22:01:12.767664 osdx OSDxCLI[138548]: User 'admin' executed a new command: 'system journal show | tail -n 20'. Mar 21 22:01:12.972365 osdx OSDxCLI[138548]: 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-03-21 22:01:14.369367 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2025-03-21 22:01:14.434002 auth-notice , OSDxCLI: User 'admin' left the configuration menu. 2025-03-21 22:01:14.541726 auth-notice , OSDxCLI: User 'admin' has logged out. 2025-03-21 22:01:16.480156 auth-notice , OSDxCLI: User 'admin' has logged in. 2025-03-21 22:01:16.790810 auth-notice , OSDxCLI: User 'admin' entered the configuration menu. 2025-03-21 22:01:16.998053 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'set system description DESC2'. 2025-03-21 22:01:17.170281 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'show changes'. 2025-03-21 22:01:17.552974 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2025-03-21 22:01:17.610212 auth-notice , OSDxCLI: User 'admin' left the configuration menu.