How to configure VMWare monitoring on Centreon


Userlevel 3
Badge +1

Part 1

In this article we will see how to configure VMWare monitoring on Centreon.

First of all the following prerequisites have to be set in order to make the plugin work :

Go to configuration > plugin-pack, and search for VmWare. Download the following packs :

  • VMware VM
  • VMware ESX
  • VMware Vcenter v6


Centreon VMWare Connector

For the VMWare monitoring, Centreon use daemon to connect and request the Vcenter.

Install this daemon on each needed poller:

yum install centreon-plugin-Virtualization-VMWare-daemon

Then, we have to configure the access to your infrastructure, edit the "/etc/centreon/centreon_vmware.pm" configuration file:

%centreon_vmware_config = (
    vsphere_server => {
        default => {
            url => 'https://<ip_hostname>/sdk',
            username => '<username>',
            password => '<password>'
        }
    }
);
1;

Make sure to replace variables with needed information:

  • ip_hostname: IP address or hostname of the vCenter or ESX (if standalone),
  • username: username with at least "read only" access to the vCenter or ESX (you can use domain user),
  • password: password of the username.

You can configure multiple vCenter or ESXi connections using this structure:

%centreon_vmware_config = (
    vsphere_server => {
        'my_first_vcenter' => {
            url => 'https://<ip_hostname>/sdk',
            username => '<username>',
            password => '<password>'
        },
        'my_other_vcenter' => {
            url => 'https://<ip_hostname>/sdk',
            username => '<DOMAIN>\<username>',
            password => '<password>'
        },
    },
    port => 5700
);
1;

Each entry is called a container.

You can also define the "port" attribute to change listening port.

 

Then we can start the daemon and make sure it is configured to start at server boot:

systemctl start centreon_vmware
systemctl enable centreon_vmware

Make sure that the daemon configuration works fine by looking for errors in "/var/log/centreon/centreon_vmware.log".

To test the configuration we can execute the following command:

/usr/lib/centreon/plugins/centreon_vmware_connector_client.pl --plugin=apps::vmware::connector::plugin --container=default --connector-port=5700 --connector-hostname=localhost --mode=discovery --resource-type='esx' --prettify

The list of available ESX servers must be present. Use ‘vm’ in --ressource-type to se VMs list.
 

Part 2

Once the configuration is over, we can add VMware object to the supervision like :

Configure the Macros with the right settings:

Here ‘default’ is the container name

Once the form saved, Centreon created automatically several indicators to monitor to this ESX server.

After adding the object to our supervision we can export the poller configuration as usual.

 

Part 3 : Autodiscovery

Prerequisites :

  1. Part 1
  2. In this part lets admit that you did configure a user that have access to Api configuration, in this file (in the Central) : /etc/centreon-gorgone/config.d/31-centreon-api.yaml

To create a host discovery rule go to Configuration > Hosts > Discovery and click add.

Select either if you want to discover VM or ESX and click next.

Then you are invited to select from which poller the discovered items will be monitored.
 

Here, make sure you put the good container name :

We are not going to set mappers here. They allows you to customize your discovery rules (discover only started VM etc...). Click next.

Now you can choose a manual analysis, it means that once the items are discovered you will be able to add manually what you want to th supervision.

Or you can choose Automatic analysis, it means that items will be automatically added to the supersvion once they are discovered for the first time :

Finally you have to choose between an immediate execution or a scheduled one. I will chose a immediate execution so the autodiscovery will start asap.


Here is the result 45 vm were discovered in my vcenter :

 We can display the result by clicking on the arrow and select which VMs we want to import then click save :

There we go ! we can now export the poller’s configuration as usual


19 replies

Badge +2
Hello,Thanks for your tutorial. I try to install the Deamon but impossible for my part.Error: No match for argument: centreon-plugin-Virtualization-VMWare-daemon.Do you have an idea ?Thanks
Userlevel 5
Badge +16

Hello @BARBIER ,

What is your OS ?
What is the return of:

yum repolist

 

Badge +2
Hello,I am under AlmaLinux 8 view that Centreon now recommends to leave CentOS 7. Here are the results of the command:

[root@SRV-CENTREON ~]# yum repolist
repo id                             repo name
appstream                           AlmaLinux 8 - AppStream
baseos                              AlmaLinux 8 - BaseOS
centreon-plugin-packs-stable        Centreon Plugin Packs repository
centreon-plugin-packs-stable-noarch Centreon Plugin Packs repository
centreon-stable                     Centreon open source software repository.
centreon-stable-noarch              Centreon open source software repository.
epel                                Extra Packages for Enterprise Linux 8 - x86_64
epel-modular                        Extra Packages for Enterprise Linux Modular 8 - x86_64
extras                              AlmaLinux 8 - Extras
powertools                          AlmaLinux 8 - PowerTools
remi-modular                        Remi's Modular repository for Enterprise Linux 8 - x86_64
remi-safe                           Safe Remi's RPM repository for Enterprise Linux 8 - x86_64

 

I specify that I use the IT100 license.
Userlevel 5
Badge +16

You’re on 22.04 or 21.10 ?

Badge +2
I'm currently on 22.04.
Userlevel 5
Badge +16

Ok. We have currently an issue with the CI/CD to merge the package on the stable repo for the 22.04.

You can install it using the following command:

dnf install https://yum.centreon.com/standard/22.04/el8/unstable/noarch/vmware/centreon-vmware-3.2.4-20220517103908/centreon-plugin-Virtualization-VMWare-daemon-3.2.4-20220517103908.el8.noarch.rpm

 

Badge +2
Many thanks. The installation of the package has passed.I move on to the rest of the configuration :).
Badge +3

Bonjour,

 

Merci pour se tuto qui ma vraiment bien aider, j’ai juste quelque erreur, sur tous mes ESX la mémoire ne remonte pas et j’ai configuré manuellement un ESXI et il y a que le Ping qui remonte. Avez vous une idée ?

 


 

Hello,

Thank you for this tutorial which really helped me, I just have some error, on all my ESX the memory does not go up and I manually configured an ESXI and only the Ping goes up. Do you have an idea ?

Userlevel 5
Badge +16

--sampling-period=’20’  in the extra options ?

Badge +3

C’est ou les options supplémentaire dans le services mémoire de ESXI

 


 

 

This is where the additional options in the ESXI memory services

Userlevel 5
Badge +16

in the template ESX-Memory into the macro EXTRAOPTIONS.

Badge +3

 

ça ne fonctionne pas non plus 

 

ça marche pas non plus

 

UNKNOWN: Cannot get value for counters (Maybe, object(s) cannot be reached: disconnected, not running, time not synced (see time-host mode),...)

Badge +2
Me on my side I managed to correctly set up the control of the ESXi but I have an unknown status. If anyone has an idea, I'm a taker.

UNKNOWN: Host 'SRV-VIRT1.lescroisettes.local' : overall status is gray

Host 'SRV-VIRT1.lescroisettes.local' : status connected, overall status is gray

 

Badge

deleted

Badge

Hi all, is it possible to have some help on mappers ? please

Userlevel 1
Badge +3

Time offset 0 second(s) ok, but some services were unknown 

UNKNOWN: Cannot get value for counters (Maybe, object(s) cannot be reached: disconnected, not running, time not synced (see time-host mode),...)

 

 My case needed to adjust the time in vCenter Server Appliance:

 

In some case I need to add --time-shift=’’

Userlevel 1
Badge +8

Hi @cesinhaleal ,

I encounter the same UNKNOWN error for one of my vCenter. How did you use the --time-shift option ?

Userlevel 1
Badge +3

Hi @cesinhaleal ,

I encounter the same UNKNOWN error for one of my vCenter. How did you use the --time-shift option ?

 

When the time is late or early.

Example: use --mode=time-host to know the time, if the time is 9 seconds ahead.

You can use --time-shift=10
 

--mode=cpu-host --custommode=connector --connector-hostname='xxxx' --connector-port='xxxx' --container='xxxx'  --esx-hostname='xxxx' --time-shift=100

Userlevel 1
Badge +5

Hello,

my centreon environment is not connected to the internet. I downloaded the plugins zip folder and copied it. I cannot find the vmware plugin mentioned above. I have only the below vmware plugins. 

centreon_vmware_vcsa_restapi.pl

centreon_vmware_connector_client.pl

centreon_vmware_esx_wsman.pl

 

I am at version 23.10 

 

Could you please help? 

 

Reply