NAT Rules statistics not visible under edge node NAT statistics
search cancel

NAT Rules statistics not visible under edge node NAT statistics

book

Article ID: 370358

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • You can not see the NAT statistics under the Fabric > Nodes > Edge > Monitor > NAT sessions on NSX version 4.1.0 and above
  • In older versions these statistics are present

Environment

VMware NSX 4.1.x

Resolution

This issue is resolved in VMware NSX 4.2.0

Additional Information

>>Step to verify: 

NSX version - 4.1.1

Per transport node-wise NAT statistics: (not seeing any data)

GET https://nsx-mngr-01.example.com/api/v1/transport-nodes/<transport node-id>/statistics/nat-rules

{
 "transport_node_id": "transport node-id",
 "active_sessions": 0,
 "total_packets": 0,
 "total_bytes": 0    >>>>>>>>..did not see data
}


> Per NAT Rule wise: (seeing details)


GET https://nsx-mngr-01.example.com/policy/api/v1/infra/tier-0s/T0-Gateway-01/nat/USER/nat-rules/test/statistics

{
 "results": [
  {
   "enforcement_point_path": "/infra/sites/default/enforcement-points/default",
   "rule_path": "/infra/tier-0s/T0-Gateway-01/nat/USER/nat-rules/test",
   "rule_statistics": [
    {
     "last_update_timestamp": ,
     "total_bytes": 5276820,
     "total_packets": 72648,
     "active_sessions": 0
    }
   ]
  }
 ]
}

> Overall NAT statistics for a GW:


GET https://nsx-mngr-01.example.com/policy/api/v1/infra/tier-0s/T0-Gateway-01/nat/statistics

{
 "results": [
  {
   "enforcement_point_path": "/infra/sites/default/enforcement-points/default",
   "router_path": "/infra/tier-0s/T0-Gateway-01",
   "last_update_timestamp": 170193,
   "statistics": {
    "total_bytes": 5315948,
    "total_packets": 73186,
    "active_sessions": 0
   },
   "per_node_statistics": [
    {
     "transport_node_path": "0",
     "last_update_timestamp": 17019,
     "total_bytes": 5315948,
     "total_packets": 73186,
     "active_sessions": 0
    },
    {
     "transport_node_path": "0",
     "last_update_timestamp": 17019,
     "total_bytes": 0,
     "total_packets": 0,
     "active_sessions": 0
    }
   ]
  }
 ]
}

-------------------------------------------------------------------------------------------------------------------------------------


NSX Version - 3.1.3 

> Per Rule wise


GET https://nsx-mngr-01.corp.local/policy/api/v1/infra/tier-0s/T0-Gateway-01/nat/USER/nat-rules/test_/statistics

{
  "results" : [ {
    "enforcement_point_path" : "/infra/sites/default/enforcement-points/default",
    "rule_path" : "/infra/tier-0s/T0-Gateway-01/nat/USER/nat-rules/test_",
    "rule_statistics" : [ {
      "last_update_timestamp" : 1701939892105,
      "total_bytes" : 99813652, >>we can see total bytes
      "total_packets" : 1619505,
      "active_sessions" : 0
    } ]
  } ]
}

> Overall gateway wise 

GET https://nsx-mngr-01.example.com/policy/api/v1/infra/tier-0s/T0-Gateway-01/nat/statistics

{
  "results" : [ {
    "enforcement_point_path" : "/infra/sites/default/enforcement-points/default",
    "router_path" : "/infra/tier-0s/T0-Gateway-01",
    "last_update_timestamp" : 1701940027274,
    "statistics" : {
      "total_bytes" : 99825060,
      "total_packets" : 1619709,
      "active_sessions" : 0
    },
    "per_node_statistics" : [ {
      "transport_node_path" : "1",
      "last_update_timestamp" : 17019400,
      "total_bytes" : 9432188,
      "total_packets" : 113539,
      "active_sessions" : 0
    }, {
      "transport_node_path" : "1",
      "last_update_timestamp" : 17019399,
      "total_bytes" : 90392872,
      "total_packets" : 1506170,
      "active_sessions" : 0
    } ]
  } ]
}

From edge node:

> Here we can see counters for transport node but not in NSX version 4.1

https://nsx-mngr-01.example.com/api/v1/transport-nodes/<transport node-id>/statistics/nat-rules
{
    "transport_node_id": "transport node-id",
    "last_update_timestamp": 1702,
    "active_sessions": 0,
    "total_packets": 2301009,     
    "total_bytes": 134846020