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 25 12:18:54.000201 osdx systemd-timedated[58312]: Changed local time to Wed 2025-06-25 12:18:54 UTC Jun 25 12:18:54.000961 osdx systemd-journald[56122]: Time jumped backwards, rotating. Jun 25 12:18:54.001592 osdx OSDxCLI[58868]: User 'admin' executed a new command: 'set date 2025-06-25 12:18:54'. Jun 25 12:18:54.357168 osdx sudo[59052]: pam_limits(sudo:session): invalid line '@200:215 hard maxlogins ' - skipped Jun 25 12:18:54.360097 osdx systemd-journald[56122]: Runtime Journal (/run/log/journal/af01d4ed6eb1488ea817da6aeebe5df1) is 2.3M, max 15.3M, 12.9M free. Jun 25 12:18:54.360745 osdx systemd-journald[56122]: Received client request to rotate journal, rotating. Jun 25 12:18:54.360781 osdx systemd-journald[56122]: Vacuuming done, freed 0B of archived journals from /run/log/journal/af01d4ed6eb1488ea817da6aeebe5df1. Jun 25 12:18:54.364114 osdx sudo[59051]: pam_limits(sudo:session): invalid line '@200:215 hard maxlogins ' - skipped Jun 25 12:18:54.369832 osdx OSDxCLI[58868]: User 'admin' executed a new command: 'system journal clear'. Jun 25 12:18:54.600153 osdx OSDxCLI[58868]: User 'admin' executed a new command: 'system coredump delete all'. Jun 25 12:18:54.886127 osdx OSDxCLI[58868]: User 'admin' entered the configuration menu. Jun 25 12:18:54.956302 osdx OSDxCLI[58868]: User 'admin' added a new cfg line: 'set system description DESC1'. Jun 25 12:18:55.084333 osdx OSDxCLI[58868]: User 'admin' added a new cfg line: 'show working'. Jun 25 12:18:55.184195 osdx ubnt-cfgd[59071]: inactive Jun 25 12:18:55.198445 osdx INFO[59077]: FRR daemons did not change Jun 25 12:18:55.206813 osdx cfgd[1464]: [58868]Completed change to active configuration Jun 25 12:18:55.208514 osdx OSDxCLI[58868]: User 'admin' committed the configuration. Jun 25 12:18:55.224875 osdx OSDxCLI[58868]: 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-25 12:18
Step 4: Run command system journal show | tail -n 20
at DUT0
and expect this output:
Show output
Jun 25 12:18:54.000201 osdx systemd-timedated[58312]: Changed local time to Wed 2025-06-25 12:18:54 UTC Jun 25 12:18:54.000961 osdx systemd-journald[56122]: Time jumped backwards, rotating. Jun 25 12:18:54.001592 osdx OSDxCLI[58868]: User 'admin' executed a new command: 'set date 2025-06-25 12:18:54'. Jun 25 12:18:54.357168 osdx sudo[59052]: pam_limits(sudo:session): invalid line '@200:215 hard maxlogins ' - skipped Jun 25 12:18:54.360097 osdx systemd-journald[56122]: Runtime Journal (/run/log/journal/af01d4ed6eb1488ea817da6aeebe5df1) is 2.3M, max 15.3M, 12.9M free. Jun 25 12:18:54.360745 osdx systemd-journald[56122]: Received client request to rotate journal, rotating. Jun 25 12:18:54.360781 osdx systemd-journald[56122]: Vacuuming done, freed 0B of archived journals from /run/log/journal/af01d4ed6eb1488ea817da6aeebe5df1. Jun 25 12:18:54.364114 osdx sudo[59051]: pam_limits(sudo:session): invalid line '@200:215 hard maxlogins ' - skipped Jun 25 12:18:54.369832 osdx OSDxCLI[58868]: User 'admin' executed a new command: 'system journal clear'. Jun 25 12:18:54.600153 osdx OSDxCLI[58868]: User 'admin' executed a new command: 'system coredump delete all'. Jun 25 12:18:54.886127 osdx OSDxCLI[58868]: User 'admin' entered the configuration menu. Jun 25 12:18:54.956302 osdx OSDxCLI[58868]: User 'admin' added a new cfg line: 'set system description DESC1'. Jun 25 12:18:55.084333 osdx OSDxCLI[58868]: User 'admin' added a new cfg line: 'show working'. Jun 25 12:18:55.184195 osdx ubnt-cfgd[59071]: inactive Jun 25 12:18:55.198445 osdx INFO[59077]: FRR daemons did not change Jun 25 12:18:55.206813 osdx cfgd[1464]: [58868]Completed change to active configuration Jun 25 12:18:55.208514 osdx OSDxCLI[58868]: User 'admin' committed the configuration. Jun 25 12:18:55.224875 osdx OSDxCLI[58868]: User 'admin' left the configuration menu. Jun 25 12:18:55.361992 osdx OSDxCLI[58868]: User 'admin' executed a new command: 'system journal show | tail -n 20'. Jun 25 12:18:55.427502 osdx OSDxCLI[58868]: 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-25 12:18:56.054402 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2025-06-25 12:18:56.086339 auth-notice , OSDxCLI: User 'admin' left the configuration menu. 2025-06-25 12:18:56.165122 auth-notice , OSDxCLI: User 'admin' has logged out. 2025-06-25 12:18:57.636391 auth-notice , OSDxCLI: User 'admin' has logged in. 2025-06-25 12:18:57.772944 auth-notice , OSDxCLI: User 'admin' entered the configuration menu. 2025-06-25 12:18:57.832459 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'set system description DESC2'. 2025-06-25 12:18:57.936351 auth-notice , OSDxCLI: User 'admin' added a new cfg line: 'show changes'. 2025-06-25 12:18:58.022284 auth-notice , OSDxCLI: User 'admin' committed the configuration. 2025-06-25 12:18:58.056443 auth-notice , OSDxCLI: User 'admin' left the configuration menu.