Edge Datapath Stats Collection script for 3.x, 4.0 and 4.1
search cancel

Edge Datapath Stats Collection script for 3.x, 4.0 and 4.1

book

Article ID: 393772

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

This is a monitoring script for the Edge to be used when directed by Broadcom Support for troubleshooting Edge perfomance issues.   This script can also be used to determine if edge node form factor sizing is appropriate.

The script collects the following data on the Edge node every 60 seconds:

  • DPDK core usage (current, max, avg)
  • Non-DPDK linux core usage (current, max, avg)
  • DP flowcache mega hit rate
  • DP flowcache micro hit rate
  • DP per core pps
  • DP physical port stats

Environment

VMware NSX-T Datacenter 3.x
VMware NSX 

Resolution

The installation of this script is strictly only for versions NSX 3.x and 4.0 and 4.1 releases.   For NSX version 4.2 and later the script is built-in so go directly to Step 3.


Warning: The script will continue collecting with no log rotation until stopped. Over time this could result in the exhaustion of free space on /var/log. It is important after the investigation completes to stop the script.


As root user SCP the attached script, dp_stats.py to the NSX Edge.    

1.  ssh as root user and place the script in following location /opt/vmware/nsx-edge/bin/

$ ls /opt/vmware/nsx-edge/bin/dp_stats.py
/opt/vmware/nsx-edge/bin/dp_stats.py


2. Give appropriate permissions to the script,

$ chmod 0750 /opt/vmware/nsx-edge/bin/dp_stats.py
$ chgrp nsx /opt/vmware/nsx-edge/bin/dp_stats.py


3. Add the script to cronjob to run every 20s using the following command,

$ (crontab -l 2>/dev/null; echo -e "* * * * * /opt/vmware/nsx-edge/bin/dp_stats.py --enable-log\n* * * * * sleep 20; /opt/vmware/nsx-edge/bin/dp_stats.py --enable-log\n* * * * * sleep 40; /opt/vmware/nsx-edge/bin/dp_stats.py --enable-log") | crontab -


4. Confirm that following entries are installed in crontab,

$ crontab -l
 
* * * * * /opt/vmware/nsx-edge/bin/dp_stats.py --enable-log
* * * * * sleep 20; /opt/vmware/nsx-edge/bin/dp_stats.py --enable-log
* * * * * sleep 40; /opt/vmware/nsx-edge/bin/dp_stats.py --enable-log


5. The data will be collected periodically and dumped to /var/log/vmware/dp-stats.log.

6. To stop and remove the script

$ crontab -l 2>/dev/null | grep -v 'dp_stats.py' | crontab -
$ rm /opt/vmware/nsx-edge/bin/dp_stats.py

 

Additional Information

Note: Once this script is enabled it will run until stopped. Monitor disk usage for /var/log/vmware/

Attachments

dp_stats.py get_app