VMWare Alarm Sender For Nagios

**DEVELOPMENT OF THIS PLUGIN HAS CEASED AS OF 14/6/2014, IF YOU WOULD LIKE TO TAKE OVER THIS PROJECT PLEASE SEE THE CONTACT US PAGE**

Description:

A simple Powershell script for sending VMWare alarm information back to Nagios via the NRDP interface. Compatible with vCenter 3.5, 4.x, 5.x.

Download:

https://github.com/jsmroshamboot/vasfn/archive/master.zip

Known Issues:

  • vCenter seems to randomly fail when trying to execute commands, after testing, testing and more testing it seems that the issue is caused by vCenter but I can’t ascertain exactly why and I no longer have acquaintances at VMWare to get the problem looked into further. The script is still more than reliable enough but you will probably want to set Critical and Warning triggers to repeat every x hours and ensure that the service in Nagios has a freshness value so that it resets to OK, just in case the OK trigger doesn’t happen.

Patch Notes:

v2.0:

  • Plugin ported to Powershell v2.0

  • Improved logging, including better output and log rotation.

  • More options for configuring the Nagios output and how the alarm maps back to Nagios.

  • Significant improvements to the robustness of the script execution, no more failures to execute by vCenter.

  • For those crazy enough to try to use it for gathering performance data it now attempts to learn about more kinds of metrics.

v1.0:

  • First release

Usage:

1. Extract the vmware_sender directory onto your vCenter servers. Ensure there are NO SPACES to the extracted path.

NOTE As of the the time of writing, I’ve been unable to get vCenter to execute a Powershell script if there is a space in the path. If you have a workaround please contact me.

  1. Create an alarm in vCenter and configure something to monitor, i.e. Virtual Machine CPU usage.

  2. ¬†Under the actions tab of alarm settings click add then select “Run a command” as the action.

  3. In the configuration section put the following:

“cmd.exe” “/c echo.|powershell -NonInteractive -File C:PathTovmware_sendervmware_sender.ps1”

  1. Save the alarm.

Read the README file in the zip file for full instructions.

-nrdpurl

The URL used to access the remote NRDP agent. i.e. http://nagiosip/nrdp/

-nrdptoken

The authentication token used to access the remote NRDP agent.

-hostname

The name of the host associated with the passive host/service check result.

-service

The name of the service associated with this check result.

-state

The state of the service. Valid values are: OK, Green, WARNING, Yellow, CRITICAL, Red, UNKNOWN

-output

Text output to be sent as the passive check result.

-activecheck

Used to specify active or passive check, 0 = active, 1 = passive. Defaults to passive.

-map

Name of the output map to use in the vmware_sender.ini file, for more information read the README

-help

Display this help text.