Visitors

HOW TO: Configure syslog server for VMware NSX for vSphere Controllers using REST API

After installing Management Pack for NSX for VMware vRealize Operations Manager, I got a warning that “There is no syslog server configured on the NSX Controller

There is no syslog server configured on the NSX Controller

The only “supported” method of configuring syslog server for VMware NSX for vSphere 6.x Controllers is using the REST API.

Before you begin configuring the Syslog service using the REST API, there are a couple of things you need to have in place:

  1. REST API Client. For example, RESTClient Add-On for Mozilla Firefox browser.
  2. Authentication header.

The request body to configure this is fairly straight forward, as there are only a few elements that can be configured.

<controllerSyslogServer>
<syslogServer>10.160.20.1</syslogServer>
<port>514</port>
<protocol>TCP</protocol>
<level>INFO</level>
</controllerSyslogServer>

Before we begin configuring the Syslog service using the REST API, let us take a brief look at what REST client(s) are available to enable us to quickly perform this configuration programatically.

Once you are done with enabling either of these plug-ins, you need to know couple of other pieces of information before you send the REST request body to the NSX for vSphere Manager to setup the Syslog for NSX for vSphere Controller.

First of all REST API Requests require Authentication header (REST Client will Base 64 Encode the Credentials for NSX for vSphere Manager. Also PUT or POST (If sending HTTP Body) will require you to set an additional Header. There are as below:

  • Name = Content-Type
  • Value = application/xml

Confirm Authorization & Content-Type headers are properly setup.

  • If you want to retrieve details about the configured syslog exporter on the specified controller node, you need to send this HTTP request.
    Method: GET
    Request: https://<nsxmgr-ip>/api/2.0/vdn/controller/{controller-id}/syslog

    No Syslog configured:
    VMware NSX Configuring Syslog for NSX for vSphere Controller - GET

  • To configure syslog server(s) paste the request in the Request Body and change the method to POST:
    Method: POST
    Request: https://<nsxmgr-ip>/api/2.0/vdn/controller/{controller-id}/syslog
    VMware NSX Configuring Syslog for NSX for vSphere Controller - PUT
  • If you want to delete the syslog exporter on the specified controller node then use this HTTP request.
    Method: DELETE
    Request: https://<nsxmgr-ip>/api/2.0/vdn/controller/{controller-id}/syslog

Please refer to VMware KB Article “Configuring syslog server for VMware NSX for vSphere 6.x controllers (2092228)” for more details.

1 comment to HOW TO: Configure syslog server for VMware NSX for vSphere Controllers using REST API

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

This site uses Akismet to reduce spam. Learn how your comment data is processed.