Lay of the land

Just a quick one today. It is possible to set a syslog server for each NSX controller. This will allow for reporting of events to a syslog server. In my case, I have LogInsight (LI)clustered behind the VIP of This is the IP of the FQDN representing my LI master and three workers. NSX manager is installed and three controllers have been deployed.

Web API access

I am going to use the Mozilla firefox REST API client against the NSX manager. I need to ensure the following

  • content-type application/xml
  • basic-authentication

Checking controller settings

Time to check existing settings on the controllers. By issuing the following GET command you will see nothing configured.

GET https://nsxmgr-l-01a/api/2.0/vdn/controller/controller-1/syslog

<?xml version="1.0" encoding="UTF-8"?>
<details>404 Not Found</details>

Here we can see nothing is configured for our Syslog servers for the NSX controllers. Where controller-1 is the name of the controller you can substitute the name of other controllers.

Posting our desired settings

Okay. Time to issue a POST against the NSX manager to configure the settings. This will need to be repeated against all controllers.

POST https://nsxmgr-l-01a/api/2.0/vdn/controller/controller-1/syslog



Where controller-1 is the name of the controller, substitute for other controllers.
* controller-1
* controller-2
* controller-3

Now what is a change without a validation of the work performed.

Time for an API Validation

Time to issue the command we used earlier to check our change was successful.

GET https://nsxmgr-l-01a/api/2.0/vdn/controller/controller-1/syslog

<?xml version="1.0" encoding="UTF-8"?>

There is some XML output stating our change has been committed correctly. Check all controllers to ensure this has been changed.

API all the things

Whilst this was done with a REST API and browser client it would be possible to this with python, powershell, or programming language of choice. The key thing here is a rather clicky clicky UI change can be done very simply and efficiently. ALL HAIL API.

One thought on “NSX Controller Syslog via API

Leave a Reply

Your email address will not be published. Required fields are marked *