NSX API and CLI commands to monitor statistics for Distributed Load Balancer instances.

CLI Commands for Distributed Load Balancer

Action Command

Display all load balancers.

get load-balancers

Display a specific load balancer.

get load-balancer <UUID_LoadBalancer>

Show statistics of all pools of the specified load balancer

get load-balancer <UUID_LoadBalancer> pools stats

Show load balancer virtual-server configuration.

get load-balancer <UUID_LoadBalancer> virtual-servers

Show statistics of the specified load balancer and pool

get load-balancer <UUID_LoadBalancer> pool <UUID_Pool> stats

Show persistence-tables entry

get load-balancer <UUID_LoadBalancer> persistence-tables
Show load balancer pools configuration get load-balancer <UUID_LoadBalancer> pools
Show statistics of all virtual servers of the specified load balancer get load-balancer <UUID_LoadBalancer> virtual-servers stats
Show statistics of the specified load balancer and virtual server get load-balancer <UUID_LoadBalancer> virtual-server <UUID_VirtualSerever> stat
Clear statistics of the specified load balancer and pool clear load-balancer <UUID_LoadBalancer> pool <UUID_Pool> stats
Clear statistics of all pools of the specified load balancer clear load-balancer <UUID_LoadBalancer> pools stats
Clear statistics of the specified load balancer clear load-balancer <UUID_LoadBalancer> stats
Clear statistics of the specified load balancer and virtual server clear load-balancer <UUID_LoadBalancer> virtual-server <UUID_VirtualServer> stats
Clear statistics of all virtual servers of the specified load balancer clear load-balancer <UUID_LoadBalancer> virtual-servers stats
View L4 session table details

get load-balancer <UUID_LoadBalancer> sessions

Display distributed load balancer statistics get load-balancer <UUID_LoadBalancer> stats

CLI Diagnostic Commands for Distributed Load Balancer

Action Command
Show load balancer diagnosis information get load-balancer <UUID_LoadBalancer> diagnosis
This command runs a diagnosis report on the following:
  • Checking System:
    • Edge memory usage. If edge memory usage is higher than 90%, memory usage is shown in the result.
    • Disk usage. Only "/", "/var/log" and "/config" folders are checked. If disk usage for any folder is higher than 90%, disk usage of this folder is shown in the result.
  • Checking Crash - if a core file is generated by datapathd, LB nginx, lb-dispatcher, lb_conf, nsx-edge-exporter, nsd or lbconf_gen, the core file name is listed in the result.
  • Checking Daemon Status - process dispatcher, datapathd, nsxa, nsd, nestdb, and LB nginx are checked. If any of these processes are not running, it is listed in the result.
  • Checking Configuration:
    • Whether this LB object has been in nestdb.
    • Whether there is FATAL cfg information related this LB instance in syslog.
    • Whether there is configuration build failure in lbconf_gen.log.
    • Whether there is LbCurrentMsg object in nestdb.
    • Whether the generation_id in nginx.conf is equal with the value in LbCurrentMsg.
    • Whether LB firewall rules have been written into nestdb.
    • Whether LB firewall rules are working in datapathd.
  • Checking runtime - health check status of pool member is checked. If the status of the health check is down, it is reported in the result.
  • Checking Stats - datapath status, kni stats, and LB nginx stats are checked.
    • If there is an error in the LB cache from datapathd, it is reported in the result.
    • If there is an rx_drop or tx_drop in the LB kni interface, it is listed in the result.
    • If there is an error in the LB nginx statistics, it is reported in the result.

API commands for Distributed Load Balancer

Action Command
Get Distributed Load Balancer statistics
Note: If you do not specify an enforcement point path, API fetches information from all enforcement paths and displays aggregated information. If you specify an enforcement point path, only information for that path is retrieved and displayed in the response body of the API call.
GET /policy/api/v1/infra/lb-services/LB_Service/statistics?source=realtime&enforcement_point_path=/infra/sites/default/enforcement-points/default
Get Distributed Load Balancer virtual server statistics GET /infra/lb-services/<lb-service-id>/lb-virtual-servers/<lb-virtual-server-id>/statistics?source=realtime&enforcement_point_path=/infra/sites/default/enforcement-points/default

Get Distributed Load Balancer pool statistics GET /infra/lb-services/<lb-service-id>/lb-pools/<lb-pool-id>/statistics?source=realtime&enforcement_point_path=/infra/sites/default/enforcement-points/default