Configuring Syslog server for VMware NSX components

Page content

Configuring Syslog server for VMware NSX components - Logo

Syslog server is a must in all environments. It doesn’t matter if you have 5 or 100 ESXi host or you use NSX or not. Today, we configure Syslog server for VMware NSX components. In my case it will be VMware vRealize Log Insight.

Configuring Syslog server for VMware NSX components

Unfortunately it is not possible to configure Syslog for all components in NSX GUI so in some cases API calls must be used.

API preparation

In my lab I use Google Chrome with application Postman to initiate API calls. Any API client can be used - in my case Postman simply works. I had one issue in Firefox with API calls where self signed certificate had to first added to exceptions and then API calls worked.

To fix issue with self-signed SSL Certificates in Google Chrome follow this excellent link: http://blog.getpostman.com/2014/01/28/using-self-signed-certificates-with-postman/.

NSX Manager

API

Request:

PUT https://<nsxmgr-ip</api/1.0/appliance-management/system/syslogserver

Request Body:

<syslogserver
  <syslogServer192.168.1.15<syslogServer</>
  <port>514</port>
  <protocol>UDP</protocol>
</syslogserver>

To check if Syslog is configured correctly initiate API call.

Request:

GET https://<nsxmgr-ip</api/1.0/appliance-management/system/syslogserver

Configuring Syslog server for VMware NSX components - 1

GUI

  1. In main GUI click Manage Appliance Settings.

    Configuring Syslog server for VMware NSX components - 2

  2. Click Edit in section Syslog Server.

    Configuring Syslog server for VMware NSX components - 3

  3. Enter Syslog server IP or DNS, port and protocol.

    Configuring Syslog server for VMware NSX components - 4

Syslog check

After few minutes logs are visible in Syslog server - in my case in vRealize Log Insight.

Configuring Syslog server for VMware NSX components - 5

NSX Controller

NSX Controller Syslog server can be configured only using API call. To configure Syslog server for controllers you need controller IDs. You can find them in GUI.

Configuring Syslog server for VMware NSX components - 6

API

Request:

POST https://<nsxmgr-ip</api/2.0/vdn/controller/{controller-id}/syslog

Request Body:

<controllerSyslogServer>
  <syslogServer>192.168.1.15</syslogServer>
  <port>514</port>
  <protocol>UDP</protocol>
  <level>INFO</level>
</controllerSyslogServer>

Once pushed you can check if settings are applied.

Request:

GET https://<nsxmgr-ip</api/2.0/vdn/controller/{controller-id}/syslog

Configuring Syslog server for VMware NSX components - 7

Proceed with configuration on remaining controllers.

Syslog check

Configuring Syslog server for VMware NSX components - 8

NSX EDGE

In order to configure NSX Edge Services Gateway it is required to know its ID. It can be found in NSX Edges page.

Configuring Syslog server for VMware NSX components - 9

API

Request:

PUT https://<nsx-mgr-ip</api/4.0/edges/edgeId/syslog/config

Request Body:

<syslog>
   <protocol>udp</protocol>
   <serverAddresses>
      <ipAddress>192.168.1.15</ipAddress>
   </serverAddresses>
</syslog>

GUI

  1. Click on NSX Edges and select EDGE to configure Syslog.

    Configuring Syslog server for VMware NSX components - 10

  2. In Configuration section click Change to enable Syslog.

    Configuring Syslog server for VMware NSX components - 11

  3. Enter Syslog IP address or FQND, protocol and click OK.

    Configuring Syslog server for VMware NSX components - 12

Syslog check

I had to manually initiate an event in my lab.

Configuring Syslog server for VMware NSX components - 13

NSX DLR

Let’s finish configuring Syslog server for VMware NSX components with Distributed Logical Router.

API

NSX Distributed Logical Router

Request:

PUT https://<nsx-mgr-ip</api/4.0/edges/edgeId/syslog/config

Request Body:

<syslog>
   <protocol>udp</protocol>
   <serverAddresses>
      <ipAddress>192.168.1.15</ipAddress>
   </serverAddresses>
</syslog>

GUI

  1. Choose desired DLR to configure and click Change.

    Configuring Syslog server for VMware NSX components - 14

  2. Enter Syslog IP or FQDN and protocol.

    Configuring Syslog server for VMware NSX components - 15

Syslog check

Configuring Syslog server for VMware NSX components - 16

Summary

Enabling logging on your critical infrastructure might save you time when you need to quickly troubleshoot issues. It is always good recommendation to use Syslog server.

For other NSX API call please view NSX 6.2 for vSphere API Guide.