Go-based tooling to monitor VMware environments; NOT affiliated with or endorsed by VMware, Inc.
See our GitHub repo for the latest code, to file an issue or submit improvements for review and potential inclusion into the project.
Just to be 100% clear: this project is not affiliated with or endorsed by VMware, Inc.
This repo contains various tools and plugins used to monitor/validate VMware environments. Documentation for the project as a whole is available in this README file while details specific to a plugin are recorded in a dedicated file. See the plugin index for a quick reference.
Plugin or Tool Name | Description |
---|---|
check_vmware_tools |
Nagios plugin used to monitor VMware Tools installations. |
check_vmware_vcpus |
Nagios plugin used to monitor allocation of virtual CPUs (vCPUs). |
check_vmware_vhw |
Nagios plugin used to monitor virtual hardware versions. |
check_vmware_hs2ds2vms |
Nagios plugin used to monitor host/datastore/vm pairings. |
check_vmware_datastore_space |
Nagios plugin used to monitor datastore usage. |
check_vmware_datastore_performance |
Nagios plugin used to monitor datastore performance. |
check_vmware_snapshots_age |
Nagios plugin used to monitor the age of Virtual Machine snapshots. |
check_vmware_snapshots_count |
Nagios plugin used to monitor the count of Virtual Machine snapshots. |
check_vmware_snapshots_size |
Nagios plugin used to monitor the cumulative size of Virtual Machine snapshots. |
check_vmware_rps_memory |
Nagios plugin used to monitor memory usage across Resource Pools. |
check_vmware_host_memory |
Nagios plugin used to monitor memory usage for a specific ESXi host system. |
check_vmware_host_cpu |
Nagios plugin used to monitor CPU usage for a specific ESXi host system. |
check_vmware_vm_power_uptime |
Nagios plugin used to monitor VM power cycle uptime. |
check_vmware_disk_consolidation |
Nagios plugin used to monitor VM disk consolidation status. |
check_vmware_question |
Nagios plugin used to monitor VM interactive question status. |
check_vmware_alarms |
Nagios plugin used to monitor for Triggered Alarms in one or more datacenters. |
check_vmware_vm_backup_via_ca |
Nagios plugin used to monitor last backup date for VMs (via specified custom attribute). |
check_vmware_vm_list |
Nagios plugin used to list Virtual Machines in order to test include/exclude options. |
The output for these plugins is designed to provide the one-line summary needed by Nagios for quick identification of a problem while providing longer, more detailed information for display within the web UI, use in email and Teams notifications (atc0005/send2teams).
By default, output intended for processing by Nagios is sent to stdout
and
output intended for troubleshooting by the sysadmin is sent to stderr
.
For some monitoring systems or addons (e.g., Icinga Web 2), the stderr
output is mixed in with the stdout
output (GH-314) in the web UI for the
service check. This may add visual noise when viewing the service check
output. For those cases, you may wish to explicitly disable the output to
stderr
via the --log-level "disabled"
CLI flag.
If this impacts you, please provide feedback
here. Future
releases of this project may modify plugins to not emit to stderr
by default
or the example command definitions may be updated to specify the --log-level "disabled"
CLI flag.
Initial support has been added for emitting Performance Data / Metrics, but refinement suggestions are welcome.
Consult the list of available metrics for each plugin for details. See the plugin index for a quick reference of available plugins.
Some plugins provide optional support to limit evaluation of VMs to specific
Resource Pools (explicitly including or excluding) and power states (on or
off). Other plugins support similar filtering options (e.g., Acknowledged
state of Triggered Alarms). See the configuration
options, examples and
contrib sections for more information.
Multiple plugins for monitoring VMware vSphere environments (standalone ESXi hosts or vCenter instances) for select (or all) Resource Pools.
Optional, leveled logging using rs/zerolog
package
stderr
)disabled
, panic
, fatal
, error
, warn
, info
(the
default), debug
or trace
.Optional, user-specified timeout value for plugin execution.
See the CHANGELOG.md
file for the changes associated with
each release of this application. Changes that have been merged to master
,
but not yet an official release may also be noted in the file under the
Unreleased
section. A helpful link to the Git commit history since the last
official release is also provided for further review.
The following is a loose guideline. Other combinations of Go and operating systems for building and running tools from this repo may work, but have not been tested.
go.mod
file for preferred versionvmware/govmomi
library for required versionMakefile
does)make
Makefile
$HOME/.profile
cd /tmp
git clone https://github.com/atc0005/check-vmware
cd check-vmware
sudo apt-get install make gcc
sudo yum install make gcc
go build
command in
Windows (see below for use of the -mod=vendor
flag)32127524
link in the
References section for potential options for
installing make
on Windowsgcc
and related packages on Windowsvendor
folder
go build -mod=vendor ./cmd/check_vmware_tools/
go build -mod=vendor ./cmd/check_vmware_vcpus/
go build -mod=vendor ./cmd/check_vmware_vhw/
go build -mod=vendor ./cmd/check_vmware_hs2ds2vms/
go build -mod=vendor ./cmd/check_vmware_datastore_space/
go build -mod=vendor ./cmd/check_vmware_datastore_performance/
go build -mod=vendor ./cmd/check_vmware_snapshots_age/
go build -mod=vendor ./cmd/check_vmware_snapshots_count/
go build -mod=vendor ./cmd/check_vmware_snapshots_size/
go build -mod=vendor ./cmd/check_vmware_rps_memory/
go build -mod=vendor ./cmd/check_vmware_host_memory/
go build -mod=vendor ./cmd/check_vmware_host_cpu/
go build -mod=vendor ./cmd/check_vmware_vm_power_uptime/
go build -mod=vendor ./cmd/check_vmware_disk_consolidation/
go build -mod=vendor ./cmd/check_vmware_question/
go build -mod=vendor ./cmd/check_vmware_alarms/
go build -mod=vendor ./cmd/check_vmware_vm_list/
make
is installed)
make all
make windows
make linux
/tmp
subdirectory path
(based on the clone instructions in this section) below and deploy where
needed.
Makefile
/tmp/check-vmware/release_assets/check_vmware_tools/
/tmp/check-vmware/release_assets/check_vmware_vcpus/
/tmp/check-vmware/release_assets/check_vmware_vhw/
/tmp/check-vmware/release_assets/check_vmware_hs2ds2vms/
/tmp/check-vmware/release_assets/check_vmware_datastore_space/
/tmp/check-vmware/release_assets/check_vmware_datastore_performance/
/tmp/check-vmware/release_assets/check_vmware_snapshots_age/
/tmp/check-vmware/release_assets/check_vmware_snapshots_count/
/tmp/check-vmware/release_assets/check_vmware_snapshots_size/
/tmp/check-vmware/release_assets/check_vmware_rps_memory/
/tmp/check-vmware/release_assets/check_vmware_host_memory/
/tmp/check-vmware/release_assets/check_vmware_host_cpu/
/tmp/check-vmware/release_assets/check_vmware_vm_power_uptime/
/tmp/check-vmware/release_assets/check_vmware_disk_consolidation/
/tmp/check-vmware/release_assets/check_vmware_question/
/tmp/check-vmware/release_assets/check_vmware_alarms/
/tmp/check-vmware/release_assets/check_vmware_vm_list/
go build
/tmp/check-vmware/
examples
and contrib
sections usage details.NOTE: Depending on which Makefile
recipe you use the generated binary
may be compressed and have an xz
extension. If so, you should decompress the
binary first before deploying it (e.g., xz -d check_vmware_tools-linux-amd64.xz
).
xz -d check_vmware_tools-linux-amd64.xz
examples
and contrib
sections usage details.NOTE:
DEB and RPM packages are provided as an alternative to manually deploying binaries.
Note: As of the v0.13.0
release, precompiled Windows binaries are no longer
provided. This change was made primarily due to the lengthy build times
required and the perception that most users of this project would not benefit
from having them. If you do use Windows binaries or would like to (e.g., on
a Windows system within a restricted environment that has access to your
vSphere cluster or hosts), please provide feedback on
GH-178.
As of the v0.13.0
release, only Linux precompiled binaries are provided. If
you would benefit from precompiled binaries for other platforms, please let us
know by opening a new issue or responding to an existing issue with an
up-vote. See https://golang.org/doc/install/source for a list of supported
architectures and operating systems.
See the plugin index for a quick reference to each plugin's documentation.
Example Nagios configuration files are provided in an effort to illustrate usage of plugins provided by this project. See the Contrib README and directory contents for details.
See the plugin index for a quick reference to each plugin's documentation.
From the LICENSE file:
MIT License
Copyright (c) 2021 Adam Chalkley
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Related projects
vSphere
Logging
Nagios