Configure SNMP receivers on vCenter Server and ESXi Hosts

SNMP can be used to automatically retrieve status information from vSphere and ESXi hosts and provide the ability to push this information into a monitoring and management system.

You can configure a maximum of four SNMP receivers can be configured per vCenter to send SNMP traps to management systems.

To configure SNMP receivers, using the vSphere Web Client, select the vCenter server instance and browse to Manage > General > Edit > SNMP receivers.

You may also configure SNMP on a vCenter server using PowerCLI by invoking the ‘Get-AdvancedSetting’ and ‘Set-AdvancedSetting’ cmdlets, to which the Entity parameter is the vCenter server.

In order to retrieve the configuration for each SNMP receiver and to display the configuration parameter and value, we can invoke the following:

Get-AdvancedSetting -Entity deanvc1.dean.local -Name snmp.receiver.* | fl Description, Value, Description

If you required to target a specific SNMP receiver we can filter the name further, in the below example retrieving the configuration for SNMP receiver 2.

Get-AdvancedSetting -Entity deanvc1.dean.local -Name snmp.receiver.2* | fl Description, Value, Description

For a particular configuration parameter we can filer by the exact match of the name, where the below retrieves the community name for the primary SNMP receiver.

Get-AdvancedSetting -Entity deanvc1.dean.local -Name snmp.receiver.1.community | fl Description, Value, Description

To configure the SNMP receiver using PowerCLI, we first need to retrieve the setting we require to modify and then pass this to the ‘Set-AdvancedSetting’ cmdlet to set the value, in this instance invoke the cmdlet without asking for user confirmation. In this example, we will configured the primary SNMP receiver with the community name ‘vmware’.

Get-AdvancedSetting -Entity deanvc1.dean.local -Name snmp.receiver.1.community | Set-AdvancedSetting -Value vmware -Confirm:$False

A single SNMP receiver can also be configured on each ESXi host using ‘esxcfgcli system snmp’ from the command line interface. If we wish to retrieve the current configuration we can invoke:

esxcli system snmp get

The set of commands also allow for the SNMP receiver to be enabled,  set a community name and specify a target, as below:

esxcli system snmp set -enable true
esxcli system snmp set -communities vmware
esxcli system snmp set -targets deanesxi1.dean.local@161/vmware

Configure monitoring of Watchguard devices with Nagios XI

Firstly, we will need to enable the Firebox  as a SNMP device, as below:

1) From Policy Manager, select Setup > SNMP.

2) Select the SNMP polling type and enter the configuration details. In my configuration I am selecting ‘v1/v2c’ for SNMP polling which requires a community string to be configured.

3) Select the SNMP trap type to be ‘v2Trap’ and add your SNMP management station, in this case the Nagios XI monitoring server IP address.

4) Confirm your SNMP settings and select ‘OK’.

This will create an automatically generated policy named ‘SNMP’ to allow inbound connections to your Firebox on  UDP port 161. I further configured the rule to only allow inbound SNMP from the source address of the Nagios XI monitoring server IP address.

Now that we have SNMP enabled on the Firebox we can now run the monitoring wizard to monitor the devices.

1) Select the ‘Watchguard’ motoring wizard

2) Enter the IP address of the Watchguard management interface, SNMP community name as configured when enabling the Firebox as a SNMP device.

3) Select the services you wish to monitor, notifications and groups and complete the configuration.

I encountered a couple of issues following configuration, the default warning and critical values may not be relevant to your device. For Example, active connections limit was not representative of the Firebox device. By default, the thresholds are set to be 300 (Warning) and 500 (Critical).  The device I have is capable of supporting up to 40,000 concurrent connections, therefore I set  the critical value to be 36,000  and a number of 32,000 to be my warning threshold.

This information is available for the device, by browsing to the datasheet, in my case XTM 5 series details can be found at http://www.watchguard.com/docs/datasheet/wg_xtm5_ds.pdf.

It would also appear that in an active/passive cluster you may only monitor the active node based on the IP address of the device, therefore I configured my monitored host and services to use the clustered management address.