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.

It collects the following data on the Edge 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 3.x
VMware NSX 4.0.x, 4.1.x

Resolution

This script is strictly only for versions NSX 3.x and 4.0 and 4.1 releases.

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.


1. As root user SCP the attached script, dp_stats.py to the NSX Edge.
    ssh as root user and place the script in following location

$ 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