Export Probe Stats
This scenario shows how to configure Network Service Monitor (NSM) operations to share probe statistics through syslog messages.
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 eth0 address 10.215.200.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 eth0 address 10.215.200.50/24 set service nsm operation A destination-address 10.215.200.100 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.200.50 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 file TEST filter FILTER app nsmd set system syslog file TEST filter FILTER level all
Step 3: Run command file show running://log/user/TEST/TEST
at DUT0
and check if output matches the following regular expressions:
(?m)^.+nsmd.+Jitter.+PacketLoss.+RTT.+$Show output
2025-02-19 20:11:03.492424 user-notice , nsmd: Notice: Starting NSM daemon 2025-02-19 20:11:03.494210 user-warning , nsmd: Warning: "A": Buffer size (0) is less than minimum buffer size (16) 2025-02-19 20:11:03.496600 user-info , nsmd: {"DstIP":"10.215.200.100","Jitter":0.0,"PacketLoss":0.0,"RTT":0.0,"SrcIP":"10.215.200.50","SrcIface":"eth0","Timestamp":1739995863} 2025-02-19 20:11:03.996594 user-info , nsmd: {"DstIP":"10.215.200.100","Jitter":0.30366847999999996,"PacketLoss":0.0,"RTT":0.22808020000000001,"SrcIP":"10.215.200.50","SrcIface":"eth0","Timestamp":1739995863} 2025-02-19 20:11:04.497154 user-info , nsmd: {"DstIP":"10.215.200.100","Jitter":0.30908952999999989,"PacketLoss":0.0,"RTT":0.27050702999999998,"SrcIP":"10.215.200.50","SrcIface":"eth0","Timestamp":1739995864} 2025-02-19 20:11:04.997160 user-info , nsmd: {"DstIP":"10.215.200.100","Jitter":0.31427736999999983,"PacketLoss":0.0,"RTT":0.31747769000000003,"SrcIP":"10.215.200.50","SrcIface":"eth0","Timestamp":1739995864}
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 eth0 address 10.215.200.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 eth0 address 10.215.200.50/24 set service dns static host-name testnsm alias test.nsm.fqdn set service dns static host-name testnsm inet 10.215.200.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 10.215.200.50 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 file TEST filter FILTER app nsmd set system syslog file TEST filter FILTER level all
Step 3: Run command file show running://log/user/TEST/TEST
at DUT0
and check if output matches the following regular expressions:
(?m)^.+nsmd.+test.nsm.fqdn.+Jitter.+PacketLoss.+RTT.+$Show output
2025-02-19 20:11:21.400916 user-notice , nsmd: Notice: Starting NSM daemon 2025-02-19 20:11:21.407735 user-warning , nsmd: Warning: "A": Buffer size (0) is less than minimum buffer size (16) 2025-02-19 20:11:21.408947 user-info , nsmd: {"DstHostName":"test.nsm.fqdn","Jitter":0.0,"PacketLoss":0.0,"RTT":0.0,"SrcIP":"10.215.200.50","SrcIface":"eth0","Timestamp":1739995881} 2025-02-19 20:11:21.908559 user-info , nsmd: {"DstHostName":"test.nsm.fqdn","Jitter":0.018295930000000002,"PacketLoss":0.0,"RTT":0.055851749999999999,"SrcIP":"10.215.200.50","SrcIface":"eth0","Timestamp":1739995881} 2025-02-19 20:11:22.408756 user-info , nsmd: {"DstHostName":"test.nsm.fqdn","Jitter":0.024982430000000003,"PacketLoss":0.0,"RTT":0.093941559999999966,"SrcIP":"10.215.200.50","SrcIface":"eth0","Timestamp":1739995882} 2025-02-19 20:11:22.908672 user-info , nsmd: {"DstHostName":"test.nsm.fqdn","Jitter":0.029080180000000001,"PacketLoss":0.0,"RTT":0.13457996999999997,"SrcIP":"10.215.200.50","SrcIface":"eth0","Timestamp":1739995882}
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.128/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.128 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 tls ca 'running://ca.crt' set system syslog host 10.215.168.1 tls 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
2025-02-19T17:47:50.815506+00:00 10.215.168.64 2025-02-19T17:47:50.696112+00:00 auth-notice osdx OSDxCLI: User 'admin' executed a new command: 'file delete running://ca.crt'. 2025-02-19T17:47:51.119324+00:00 10.215.168.64 2025-02-19T17:47:50.999929+00:00 auth-notice osdx OSDxCLI: User 'admin' entered the configuration menu. 2025-02-19T17:47:51.236725+00:00 10.215.168.64 2025-02-19T17:47:51.117262+00:00 auth-notice osdx OSDxCLI: User 'admin' added a new cfg line: 'delete system security medium'. 2025-02-19T17:47:51.363995+00:00 10.215.168.64 2025-02-19T17:47:51.244642+00:00 auth-notice osdx OSDxCLI: User 'admin' added a new cfg line: 'show changes'. 2025-02-19T20:11:44.768852+00:00 10.215.168.64 2025-02-19T20:11:44.153168+00:00 user-notice osdx nsmd: Notice: Starting NSM daemon 2025-02-19T20:11:44.809301+00:00 10.215.168.64 2025-02-19T20:11:44.155296+00:00 user-warning osdx nsmd: Warning: "A": Buffer size (0) is less than minimum buffer size (16) 2025-02-19T20:11:44.809301+00:00 10.215.168.64 2025-02-19T20:11:44.156524+00:00 user-info osdx nsmd: {"DstIP":"10.215.168.128","Jitter":0.0,"PacketLoss":0.0,"RTT":0.0,"SrcIP":"10.215.168.64","SrcIface":"eth0","Timestamp":1739995904}