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
Aug 20 14:19:55.000160 osdx systemd-timedated[195318]: Changed local time to Wed 2025-08-20 14:19:55 UTC
Aug 20 14:19:55.000835 osdx systemd-journald[82189]: Time jumped backwards, rotating.
Aug 20 14:19:55.001527 osdx OSDxCLI[198255]: User 'admin' executed a new command: 'set date 2025-08-20 14:19:55'.
Aug 20 14:19:55.294412 osdx sudo[198359]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Aug 20 14:19:55.297798 osdx systemd-journald[82189]: Runtime Journal (/run/log/journal/c36516c5c29741ae91520d0cd389ea90) is 2.0M, max 15.3M, 13.2M free.
Aug 20 14:19:55.300389 osdx systemd-journald[82189]: Received client request to rotate journal, rotating.
Aug 20 14:19:55.300435 osdx systemd-journald[82189]: Vacuuming done, freed 0B of archived journals from /run/log/journal/c36516c5c29741ae91520d0cd389ea90.
Aug 20 14:19:55.302875 osdx sudo[198358]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Aug 20 14:19:55.310342 osdx OSDxCLI[198255]: User 'admin' executed a new command: 'system journal clear'.
Aug 20 14:19:55.523503 osdx OSDxCLI[198255]: User 'admin' executed a new command: 'system coredump delete all'.
Aug 20 14:19:55.741853 osdx OSDxCLI[198255]: User 'admin' entered the configuration menu.
Aug 20 14:19:55.809878 osdx OSDxCLI[198255]: User 'admin' added a new cfg line: 'set system description DESC1'.
Aug 20 14:19:55.922576 osdx OSDxCLI[198255]: User 'admin' added a new cfg line: 'show working'.
Aug 20 14:19:56.015742 osdx ubnt-cfgd[198378]: inactive
Aug 20 14:19:56.033374 osdx INFO[198384]: FRR daemons did not change
Aug 20 14:19:56.042407 osdx cfgd[1656]: [198255]Completed change to active configuration
Aug 20 14:19:56.044363 osdx OSDxCLI[198255]: User 'admin' committed the configuration.
Aug 20 14:19:56.060899 osdx OSDxCLI[198255]: 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-08-20 14:19

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

Show output
Aug 20 14:19:55.000160 osdx systemd-timedated[195318]: Changed local time to Wed 2025-08-20 14:19:55 UTC
Aug 20 14:19:55.000835 osdx systemd-journald[82189]: Time jumped backwards, rotating.
Aug 20 14:19:55.001527 osdx OSDxCLI[198255]: User 'admin' executed a new command: 'set date 2025-08-20 14:19:55'.
Aug 20 14:19:55.294412 osdx sudo[198359]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Aug 20 14:19:55.297798 osdx systemd-journald[82189]: Runtime Journal (/run/log/journal/c36516c5c29741ae91520d0cd389ea90) is 2.0M, max 15.3M, 13.2M free.
Aug 20 14:19:55.300389 osdx systemd-journald[82189]: Received client request to rotate journal, rotating.
Aug 20 14:19:55.300435 osdx systemd-journald[82189]: Vacuuming done, freed 0B of archived journals from /run/log/journal/c36516c5c29741ae91520d0cd389ea90.
Aug 20 14:19:55.302875 osdx sudo[198358]: pam_limits(sudo:session): invalid line '@200:215        hard        maxlogins        ' - skipped
Aug 20 14:19:55.310342 osdx OSDxCLI[198255]: User 'admin' executed a new command: 'system journal clear'.
Aug 20 14:19:55.523503 osdx OSDxCLI[198255]: User 'admin' executed a new command: 'system coredump delete all'.
Aug 20 14:19:55.741853 osdx OSDxCLI[198255]: User 'admin' entered the configuration menu.
Aug 20 14:19:55.809878 osdx OSDxCLI[198255]: User 'admin' added a new cfg line: 'set system description DESC1'.
Aug 20 14:19:55.922576 osdx OSDxCLI[198255]: User 'admin' added a new cfg line: 'show working'.
Aug 20 14:19:56.015742 osdx ubnt-cfgd[198378]: inactive
Aug 20 14:19:56.033374 osdx INFO[198384]: FRR daemons did not change
Aug 20 14:19:56.042407 osdx cfgd[1656]: [198255]Completed change to active configuration
Aug 20 14:19:56.044363 osdx OSDxCLI[198255]: User 'admin' committed the configuration.
Aug 20 14:19:56.060899 osdx OSDxCLI[198255]: User 'admin' left the configuration menu.
Aug 20 14:19:56.190604 osdx OSDxCLI[198255]: User 'admin' executed a new command: 'system journal show | tail -n 20'.
Aug 20 14:19:56.254336 osdx OSDxCLI[198255]: 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-08-20 14:19:56.917418 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-08-20 14:19:56.934666 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.
2025-08-20 14:19:57.032874 auth-notice , OSDxCLI:  User 'admin' has logged out.
2025-08-20 14:19:58.606068 auth-notice , OSDxCLI:  User 'admin' has logged in.
2025-08-20 14:19:58.756626 auth-notice , OSDxCLI:  User 'admin' entered the configuration menu.
2025-08-20 14:19:58.839711 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'set system description DESC2'.
2025-08-20 14:19:58.953032 auth-notice , OSDxCLI:  User 'admin' added a new cfg line: 'show changes'.
2025-08-20 14:19:59.109828 auth-notice , OSDxCLI:  User 'admin' committed the configuration.
2025-08-20 14:19:59.126386 auth-notice , OSDxCLI:  User 'admin' left the configuration menu.