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
Jun 23 10:22:00.000207 osdx systemd-timedated[373628]: Changed local time to Mon 2025-06-23 10:22:00 UTC Jun 23 10:22:00.001927 osdx OSDxCLI[391997]: User 'admin' executed a new command: 'set date 2025-06-23 10:22:00'. Jun 23 10:22:00.002240 osdx systemd-journald[391062]: Time jumped backwards, rotating. Jun 23 10:22:00.314032 osdx systemd-journald[391062]: Runtime Journal (/run/log/journal/76ff399027db4a3db160ed8651bac52f) is 2.0M, max 15.3M, 13.3M free. Jun 23 10:22:00.314460 osdx systemd-journald[391062]: Received client request to rotate journal, rotating. Jun 23 10:22:00.314490 osdx systemd-journald[391062]: Vacuuming done, freed 0B of archived journals from /run/log/journal/76ff399027db4a3db160ed8651bac52f. Jun 23 10:22:00.325685 osdx OSDxCLI[391997]: User 'admin' executed a new command: 'system journal clear'. Jun 23 10:22:00.540398 osdx OSDxCLI[391997]: User 'admin' executed a new command: 'system coredump delete all'. Jun 23 10:22:00.766927 osdx OSDxCLI[391997]: User 'admin' entered the configuration menu. Jun 23 10:22:00.836900 osdx OSDxCLI[391997]: User 'admin' added a new cfg line: 'set system description DESC1'. Jun 23 10:22:00.939481 osdx OSDxCLI[391997]: User 'admin' added a new cfg line: 'show working'. Jun 23 10:22:01.020326 osdx INFO[392507]: FRR daemons did not change Jun 23 10:22:01.029963 osdx cfgd[1453]: [391997]Completed change to active configuration Jun 23 10:22:01.031799 osdx OSDxCLI[391997]: User 'admin' committed the configuration. Jun 23 10:22:01.062445 osdx OSDxCLI[391997]: 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-06-23 10:21
Step 4: Run command system journal show | tail -n 20
at DUT0
and expect this output:
Show output
Jun 23 10:22:00.000207 osdx systemd-timedated[373628]: Changed local time to Mon 2025-06-23 10:22:00 UTC Jun 23 10:22:00.001927 osdx OSDxCLI[391997]: User 'admin' executed a new command: 'set date 2025-06-23 10:22:00'. Jun 23 10:22:00.002240 osdx systemd-journald[391062]: Time jumped backwards, rotating. Jun 23 10:22:00.314032 osdx systemd-journald[391062]: Runtime Journal (/run/log/journal/76ff399027db4a3db160ed8651bac52f) is 2.0M, max 15.3M, 13.3M free. Jun 23 10:22:00.314460 osdx systemd-journald[391062]: Received client request to rotate journal, rotating. Jun 23 10:22:00.314490 osdx systemd-journald[391062]: Vacuuming done, freed 0B of archived journals from /run/log/journal/76ff399027db4a3db160ed8651bac52f. Jun 23 10:22:00.325685 osdx OSDxCLI[391997]: User 'admin' executed a new command: 'system journal clear'. Jun 23 10:22:00.540398 osdx OSDxCLI[391997]: User 'admin' executed a new command: 'system coredump delete all'. Jun 23 10:22:00.766927 osdx OSDxCLI[391997]: User 'admin' entered the configuration menu. Jun 23 10:22:00.836900 osdx OSDxCLI[391997]: User 'admin' added a new cfg line: 'set system description DESC1'. Jun 23 10:22:00.939481 osdx OSDxCLI[391997]: User 'admin' added a new cfg line: 'show working'. Jun 23 10:22:01.020326 osdx INFO[392507]: FRR daemons did not change Jun 23 10:22:01.029963 osdx cfgd[1453]: [391997]Completed change to active configuration Jun 23 10:22:01.031799 osdx OSDxCLI[391997]: User 'admin' committed the configuration. Jun 23 10:22:01.062445 osdx OSDxCLI[391997]: User 'admin' left the configuration menu. Jun 23 10:22:01.225887 osdx OSDxCLI[391997]: User 'admin' executed a new command: 'system journal show | tail -n 20'. Jun 23 10:22:01.315493 osdx OSDxCLI[391997]: 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-06-23 10:22:02.016251 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2025-06-23 10:22:02.032446 auth-notice , OSDxCLI: User 'admin' left the configuration menu. 2025-06-23 10:22:02.120324 auth-notice , OSDxCLI: User 'admin' has logged out. 2025-06-23 10:22:03.729120 auth-notice , OSDxCLI: User 'admin' has logged in. 2025-06-23 10:22:03.867529 auth-notice , OSDxCLI: User 'admin' entered the configuration menu. 2025-06-23 10:22:03.954709 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'set system description DESC2'. 2025-06-23 10:22:04.046997 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'show changes'. 2025-06-23 10:22:04.123448 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2025-06-23 10:22:04.163034 auth-notice , OSDxCLI: User 'admin' left the configuration menu.