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
Jan 10 13:56:53.284705 osdx systemd-journald[1663]: Runtime Journal (/run/log/journal/b02b6f729b7f4d8fa7abd9f8efa86558) is 2.0M, max 15.3M, 13.2M free. Jan 10 13:56:53.288149 osdx systemd-journald[1663]: Received client request to rotate journal, rotating. Jan 10 13:56:53.288206 osdx systemd-journald[1663]: Vacuuming done, freed 0B of archived journals from /run/log/journal/b02b6f729b7f4d8fa7abd9f8efa86558. Jan 10 13:56:53.294963 osdx OSDxCLI[2582]: User 'admin' executed a new command: 'system journal clear'. Jan 10 13:56:53.612980 osdx osdx-coredump[5267]: Deleting all coredumps in /opt/vyatta/etc/config/coredump... Jan 10 13:56:53.620157 osdx OSDxCLI[2582]: User 'admin' executed a new command: 'system coredump delete all'. Jan 10 13:56:54.091765 osdx OSDxCLI[2582]: User 'admin' entered the configuration menu. Jan 10 13:56:54.149516 osdx OSDxCLI[2582]: User 'admin' added a new cfg line: 'set system description DESC1'. Jan 10 13:56:54.260702 osdx OSDxCLI[2582]: User 'admin' added a new cfg line: 'show working'. Jan 10 13:56:54.354402 osdx INFO[5284]: FRR daemons did not change Jan 10 13:56:54.362273 osdx cfgd[1450]: [2582]Completed change to active configuration Jan 10 13:56:54.363856 osdx OSDxCLI[2582]: User 'admin' committed the configuration. Jan 10 13:56:54.379458 osdx OSDxCLI[2582]: 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-01-10 13:55
Step 4: Run command system journal show | tail -n 20
at DUT0
and expect this output:
Show output
Jan 10 13:56:53.284705 osdx systemd-journald[1663]: Runtime Journal (/run/log/journal/b02b6f729b7f4d8fa7abd9f8efa86558) is 2.0M, max 15.3M, 13.2M free. Jan 10 13:56:53.288149 osdx systemd-journald[1663]: Received client request to rotate journal, rotating. Jan 10 13:56:53.288206 osdx systemd-journald[1663]: Vacuuming done, freed 0B of archived journals from /run/log/journal/b02b6f729b7f4d8fa7abd9f8efa86558. Jan 10 13:56:53.294963 osdx OSDxCLI[2582]: User 'admin' executed a new command: 'system journal clear'. Jan 10 13:56:53.612980 osdx osdx-coredump[5267]: Deleting all coredumps in /opt/vyatta/etc/config/coredump... Jan 10 13:56:53.620157 osdx OSDxCLI[2582]: User 'admin' executed a new command: 'system coredump delete all'. Jan 10 13:56:54.091765 osdx OSDxCLI[2582]: User 'admin' entered the configuration menu. Jan 10 13:56:54.149516 osdx OSDxCLI[2582]: User 'admin' added a new cfg line: 'set system description DESC1'. Jan 10 13:56:54.260702 osdx OSDxCLI[2582]: User 'admin' added a new cfg line: 'show working'. Jan 10 13:56:54.354402 osdx INFO[5284]: FRR daemons did not change Jan 10 13:56:54.362273 osdx cfgd[1450]: [2582]Completed change to active configuration Jan 10 13:56:54.363856 osdx OSDxCLI[2582]: User 'admin' committed the configuration. Jan 10 13:56:54.379458 osdx OSDxCLI[2582]: User 'admin' left the configuration menu. Jan 10 13:56:54.511602 osdx OSDxCLI[2582]: User 'admin' executed a new command: 'system journal show | tail -n 20'. Jan 10 13:56:54.570277 osdx OSDxCLI[2582]: 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-01-10 13:56:55.185367 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2025-01-10 13:56:55.214829 auth-notice , OSDxCLI: User 'admin' left the configuration menu. 2025-01-10 13:56:55.304794 auth-notice , OSDxCLI: User 'admin' has logged out. 2025-01-10 13:56:56.770459 auth-notice , OSDxCLI: User 'admin' has logged in. 2025-01-10 13:56:56.918153 auth-notice , OSDxCLI: User 'admin' entered the configuration menu. 2025-01-10 13:56:56.977932 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'set system description DESC2'. 2025-01-10 13:56:57.076401 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'show changes'. 2025-01-10 13:56:57.147920 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2025-01-10 13:56:57.190554 auth-notice , OSDxCLI: User 'admin' left the configuration menu.