Export Probe Stats

This scenario shows how to configure Network Service Monitor (NSM) operations to share probe statistics through syslog messages.

../../../_images/common1.svg

Test Export Probe Statistics

Description

NSM operations are configured to export probe statistics through syslog messages and sent to a local file. The UDP NSM responder service is configured in DUT1.

Scenario

Step 1: Set the following configuration in DUT1 :

set interfaces ethernet eth1 address 192.168.1.100/24
set service nsm responder type udp port 60000
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT0 :

set interfaces ethernet eth1 address 192.168.1.50/24
set service nsm operation A destination-address 192.168.1.100
set service nsm operation A destination-port 60000
set service nsm operation A interval 0.05
set service nsm operation A local-address 192.168.1.50
set service nsm operation A local-interface eth1
set service nsm operation A logging log-interval 0.5
set service nsm operation A logging log-level info
set service nsm operation A type udp
set service nsm operation A window 100
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system syslog file TEST filter FILTER app nsmd
set system syslog file TEST filter FILTER level all

Step 3: Run the command file show running://log/user/TEST/TEST on DUT0 and check whether the output matches the following regular expressions:

(?m)^.+nsmd.+Jitter.+PacketLoss.+RTT.+$
Show output
2026-09-17 00:12:23.106062 user-notice , nsmd:  Notice: Starting NSM daemon
2026-09-17 00:12:23.107861 user-warning , nsmd:  Warning: "A": Buffer size (0) is less than minimum buffer size (16)
2026-09-17 00:12:23.108322 user-info , nsmd:  {"DstIP":"192.168.1.100","Jitter":0.0,"PacketLoss":0.0,"RTT":0.0,"SrcIP":"192.168.1.50","SrcIface":"eth1","Timestamp":1789603943}
2026-09-17 00:12:23.608373 user-info , nsmd:  {"DstIP":"192.168.1.100","Jitter":0.0069755400000000014,"PacketLoss":0.0,"RTT":0.036471730000000001,"SrcIP":"192.168.1.50","SrcIface":"eth1","Timestamp":1789603943}
2026-09-17 00:12:24.108593 user-info , nsmd:  {"DstIP":"192.168.1.100","Jitter":0.012027180000000002,"PacketLoss":0.0,"RTT":0.069889180000000009,"SrcIP":"192.168.1.50","SrcIface":"eth1","Timestamp":1789603944}

Note

The previous command output should show that probe statistics are being exported through syslog messages.


Test Export Probe Statistics FQDN

Description

As same as the previous scenario, but the FQDN of DUT1 is used instead of its IP address.

Scenario

Step 1: Set the following configuration in DUT1 :

set interfaces ethernet eth1 address 192.168.1.100/24
set service nsm responder type udp port 60000
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT0 :

set interfaces ethernet eth1 address 192.168.1.50/24
set service dns static host-name testnsm alias test.nsm.fqdn
set service dns static host-name testnsm inet 192.168.1.100
set service nsm operation A destination-address test.nsm.fqdn
set service nsm operation A destination-port 60000
set service nsm operation A interval 0.05
set service nsm operation A local-address 192.168.1.50
set service nsm operation A local-interface eth1
set service nsm operation A logging log-interval 0.5
set service nsm operation A logging log-level info
set service nsm operation A type udp
set service nsm operation A window 100
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system syslog file TEST filter FILTER app nsmd
set system syslog file TEST filter FILTER level all

Step 3: Run the command file show running://log/user/TEST/TEST on DUT0 and check whether the output matches the following regular expressions:

(?m)^.+nsmd.+test.nsm.fqdn.+Jitter.+PacketLoss.+RTT.+$
Show output
2026-09-17 00:12:33.505096 user-notice , nsmd:  Notice: Starting NSM daemon
2026-09-17 00:12:33.506657 user-warning , nsmd:  Warning: "A": Buffer size (0) is less than minimum buffer size (16)
2026-09-17 00:12:33.507049 user-info , nsmd:  {"DstHostName":"test.nsm.fqdn","Jitter":0.0,"PacketLoss":0.0,"RTT":0.0,"SrcIP":"192.168.1.50","SrcIface":"eth1","Timestamp":1789603953}
2026-09-17 00:12:34.007082 user-info , nsmd:  {"DstHostName":"test.nsm.fqdn","Jitter":0.0059016900000000011,"PacketLoss":0.0,"RTT":0.040191459999999991,"SrcIP":"192.168.1.50","SrcIface":"eth1","Timestamp":1789603954}
2026-09-17 00:12:34.507352 user-info , nsmd:  {"DstHostName":"test.nsm.fqdn","Jitter":0.0094754599999999981,"PacketLoss":0.0,"RTT":0.073565189999999989,"SrcIP":"192.168.1.50","SrcIface":"eth1","Timestamp":1789603954}
2026-09-17 00:12:35.007231 user-info , nsmd:  {"DstHostName":"test.nsm.fqdn","Jitter":0.016117290000000003,"PacketLoss":0.0,"RTT":0.11383335999999999,"SrcIP":"192.168.1.50","SrcIface":"eth1","Timestamp":1789603955}

Note

The previous command output should show that probe statistics are being exported through syslog messages.


Test Export Probe Statistics Towards Syslog Server

Description

NSM operations are configured to export probe statistics through syslog messages and sent to a remote syslog server.

Scenario

Step 1: Set the following configuration in DUT1 :

set interfaces ethernet eth0 address 10.215.168.65/24
set service nsm responder type udp port 60000
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'

Step 2: Set the following configuration in DUT0 :

set interfaces ethernet eth0 address 10.215.168.64/24
set service nsm operation A destination-address 10.215.168.65
set service nsm operation A destination-port 60000
set service nsm operation A interval 0.05
set service nsm operation A local-address 10.215.168.64
set service nsm operation A local-interface eth0
set service nsm operation A logging log-interval 0.5
set service nsm operation A logging log-level info
set service nsm operation A type udp
set service nsm operation A window 100
set system login user admin authentication encrypted-password '$6$GSjsCj8gHLv$/VcqU6FLi6CT2Oxn0MJQ2C2tqnRDrYKNF8HIYWJp68nvXvPdFccDsT04.WtigUONbKYrgKg8d6rEs8PjljMkH0'
set system syslog host 10.215.168.1 filter def app nsmd
set system syslog host 10.215.168.1 filter def level all
set system syslog host 10.215.168.1 port 10514
set system syslog host 10.215.168.1 protocol tcp
set system syslog host 10.215.168.1 x509 ca-certificate 'running://ca.crt'
set system syslog host 10.215.168.1 x509 permitted-peer rsyslog.server.com

Note

Check the server /var/log/10.215.168.64/.log file and search for the (?m)^.+nsmd.+Jitter.+PacketLoss.+RTT.+$ log message:

Show output
2026-09-16T20:29:55.764875+00:00 10.215.168.64  2026-09-16T20:29:55.001428+00:00 auth-notice osdx OSDxCLI:  User 'admin' executed a new command: 'show version'.
2026-09-16T20:29:56.017048+00:00 10.215.168.64  2026-09-16T20:29:55.253562+00:00 user-warning osdx OSDxCLI:  Signal 10 received
2026-09-16T20:29:56.033919+00:00 10.215.168.64  2026-09-16T20:29:55.270445+00:00 auth-notice osdx OSDxCLI:  User 'admin' executed a new command: 'set system mode user'.
2026-09-16T20:29:57.063438+00:00 10.215.168.64  2026-09-16T20:29:56.299784+00:00 auth-notice osdx OSDxCLI:  User 'admin' entered the configuration menu.
2026-09-16T20:29:57.136940+00:00 10.215.168.64  2026-09-16T20:29:56.373347+00:00 auth-notice osdx OSDxCLI:  User 'admin' added a new cfg line: 'delete '.
2026-09-16T20:29:57.270231+00:00 10.215.168.64  2026-09-16T20:29:56.506704+00:00 auth-notice osdx OSDxCLI:  User 'admin' added a new cfg line: 'set system login user admin authentication plaintext-password ******'.
2026-09-16T20:29:57.351047+00:00 10.215.168.64  2026-09-16T20:29:56.587486+00:00 auth-notice osdx OSDxCLI:  User 'admin' added a new cfg line: 'show working'.
2026-09-16T20:29:57.468720+00:00 10.215.168.64  2026-09-16T20:29:56.705204+00:00 daemon-info osdx ubnt-cfgd[202940]:  inactive
2026-09-17T00:12:47.644338+00:00 10.215.168.64  2026-09-17T00:12:46.523782+00:00 user-notice osdx nsmd:  Notice: Starting NSM daemon
2026-09-17T00:12:47.691459+00:00 10.215.168.64  2026-09-17T00:12:46.529288+00:00 user-warning osdx nsmd:  Warning: "A": Buffer size (0) is less than minimum buffer size (16)
2026-09-17T00:12:47.691459+00:00 10.215.168.64  2026-09-17T00:12:46.529738+00:00 user-info osdx nsmd:  {"DstIP":"10.215.168.65","Jitter":0.0,"PacketLoss":0.0,"RTT":0.0,"SrcIP":"10.215.168.64","SrcIface":"eth0","Timestamp":1789603966}