Icinga module for vsphere and alerts

Just installed and configured the official vcenterdb module for icinga2.


It is great! However, it seems this is relatively new, and there is not much documentation.

I have a few vcenters plugged in and it is gathering info as expected. Great. But now how can I create service alerts for this data? ie. If datastore fails, or datastore approaches certain threshold, critical alert.

Anybody have any documentation or information to point me in the right direction?

Hi,

the module is waiting for its 1.2.0 release, but already has a CLI command … try something like icingacli vspheredb --help. Upon this you can construct specific checks, if I read the code correctly.

Cheers,
Michael

You have 6 options for service checks with this module:

# icingacli vspheredb check
datastore   datastores  host        hosts       vm          vms

The ones ending with an s are overall checks.
The others, datastore, host, vm require a specific object with the parameter --name,
icingacli vspheredb check host --name hostname

1 Like

Thanks guys. Definitely moves me in the right direction. I see these are direct checks from the CLI. So to create checks for icingaweb2 I would bash script this? Or is there a better way?

Additionally, what can we expect in the 1.2.0 release? Is upgrading the module as simple as replacing the files?

Is there a way to get all the output, as opposed to listing a few followed by ‘and X more’

icingacli vspheredb check datastores

[WARNING] Overall status is “yellow” for EQL1-vds18-ds, EQL1-xxx-ds18, EQL1-xxx-ds23, EQL1-xxx-ds25, EQL1-xxx-ds26 and 25 more

*EDIT: Nevermind. I edited /usr/share/icingaweb2/modules/vspheredb/application/clicommands and increased line 151 to 50 from 5 $showMax = 50;

cd /usr/share/icingaweb2/modules/vspheredb
git fetch -t
git checkout <version tag>

Same goes for any other icingaweb2 module (that is installed via git)

This might stop the above procedure from working, as you changed a file and git wants you to commit it first.

1 Like

Such things will be overridden on upgrade, please create a feature request/pull request so that this can be incorporated upstream :slight_smile:

In terms of a CheckCommand - it doesn’t exist yet, but you can create one following the other examples with icingacli already inside the ITL. Please name the command icingacli-vspheredb and maybe create an upstream PR for integrating it.

Here’s an updated guide for creating check commands.

Cheers,
Michael

Thanks guys. Will check this out. I created a bash script and a check command within icinga. Not 100% what im looking for but will suffice for now