SysSet – A Syslog Configuration Tool for NSX Edges

I had a colleague the other week ask about changing a few hundred NSX Edges Syslog address. There was some configuration drift in the environment where the edges fell into a few different categories. The Edges either didn’t have configuration, had incorrect configuration (such as an old syslog entry), or they needed to be changed.

SysSet – A Syslog Configuration tool for NSX Edges

The goal was instead of clickety clicking all the way through the UI to use PowerNSX. This can be done quite easily which is great. Whilst there is not explcitly a command that does Set-NsxEdgeSyslogcurrently, the XML object can be modified and placed back onto the given edge with Set-NsxEdge.

The order of operations are as follows:

  • Collect all Edges
  • For each collected Edge:
  • Check Syslog Status
  • If enabled: Configure properties
  • Publish
  • If not enabled : Enable Syslog
  • Publish
  • Update properties
  • Publish

The reason for the double Set-NsxEdge operation is the fact that Log Level and Syslog protocol cannot be set before Syslog itself is enabled. This tool can handle most changes. It can also handle the ability to change only one property if desired.

Running SysSet.

I ran SysSet against my recently blogged about ECMP topology. This is 9 different nodes. Based on the content in the paramter block my Syslog was configured.

PowerCLI C:\> C:\Users\Administrator\Desktop\sysset.ps1
Enabling Syslog for upstream-edge
Configuring Syslog values for upstream-edge
Enabling Syslog for ecmp-edge1
Configuring Syslog values for ecmp-edge1
Enabling Syslog for ecmp-edge2
Configuring Syslog values for ecmp-edge2
Enabling Syslog for ecmp-edge3
Configuring Syslog values for ecmp-edge3
Enabling Syslog for ecmp-edge4
Configuring Syslog values for ecmp-edge4
Enabling Syslog for ecmp-edge5
Configuring Syslog values for ecmp-edge5
Enabling Syslog for ecmp-edge6
Configuring Syslog values for ecmp-edge6
Enabling Syslog for ecmp-edge7
Configuring Syslog values for ecmp-edge7
Enabling Syslog for ecmp-edge8
Configuring Syslog values for ecmp-edge8

Superb! We can see that the 9 edges have had their syslog configuration create. Now to validate.

PowerCLI C:\> $edge = get-nsxedge ecmp-edge8
PowerCLI C:\> $edge.features.syslog

version enabled protocol serverAddresses
------- ------- -------- ---------------
3       true    udp      serverAddresses

Here we can see that Syslog is enabled, the protocol is udp and the serverAddresses property has content.

PowerCLI C:\> $edge.features.syslog.serverAddresses

ipAddress
---------
{192.168.100.189, 192.168.100.190}

Hopefully this helps bring your environment in line with a configuration standard. I should crack the DLR code shortly too. I think I might look at doing some DSC and remediation tests with this. Something along the lines of “if an Edge has incorrect Syslog settings, modify them”.

Grab the script

PowerNSX
SysSet Script

Leave a Reply

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

*