Retrieving NSX Manager System Info Using Rest API

By | 27/06/2017

In this post we will explore how NSX manager system info can be retrieved via Rest API. NSX manager appliance home page is itself very descriptive and provides all system info. 

In this post we will learn how the same system info can be explored via API calls. Let’s get started.

Query NSX Manager Information

Below API query will provide you info like what is the major and minor version of NSX appliance you are running along with patch number and build number

Example: curl -k -u “vcadmin@corp.local” -X GET https://nsxmgr-01a.corp.local/api/1.0/appliance-management/global/info | tidy -xml -indent -quiet

Query NSX Manager Summary Information

This API query will present you with all info which you used to see from the NSX manager homepage. This call can be used to obtain all system related info in one shot. 

Example: curl -k -u “admin” -X GET https://nsxmgr-01a.corp.local/api/1.0/appliance-management/summary/system | tidy -xml -indent -quiet

You can also get details about individual components like CPU/Memory and Storage using below queries

Memory Info:

Example: curl -k -u “admin:Password” -X GET https://nsxmgr-01a.corp.local/api/1.0/appliance-management/system/meminfo | tidy -xml -indent -quiet

CPU Info

Example: curl -k -u “admin:Password” -X GET https://nsxmgr-01a.corp.local/api/1.0/appliance-management/system/cpuinfo | tidy -xml -indent -quiet

Storage Info

Example: curl -k -u “admin:Password” -X GET https://nsxmgr-01a.corp.local/api/1.0/appliance-management/system/storageinfo | tidy -xml -indent -quiet

Get vCenter Configuration Details

This API query will provide you details about vCenter to which this NSX manager is registered. 

Example: curl -k -u “admin” -X GET https://nsxmgr-01a.corp.local/api/2.0/services/vcconfig | tidy -xml -indent -quiet

Get vCenter Server connection status

Example: curl -k -u “admin” -X GET https://nsxmgr-01a.corp.local/api/2.0/services/vcconfig/status | tidy -xml -indent -quiet

Thats it. This is how you can generate system related info for your nsx manager. Above API calls can be used in scripting for doing a daily health check on your NSX manager. 

I hope you enjoyed reading this post. Feel free to share this on social media if it is worth sharing. Be sociable

Category: NSX