VMware vSphere is a centralized management application that lets you manage virtual machines and ESXi hosts centrally. You can set up an integration with Netcool® Operations Insight® to receive notifications created by VMware vSphere.
Before you begin
- You must have permission to run Python 3 on vCenter Server Appliance (VCSA) or PowerShell on Windows.
- There is no mechanism in VMware to apply the script in this procedure to multiple alarm
definitions at a time. The path to the script must be entered manually in the alarms.
The following event types are supported for this integration:
- All VMware alarms via the webhook connection.
Procedure
-
Click
.
-
Click New integration.
-
Go to the VMware vSphere tile and click
Configure.
-
Enter a name for the integration.
-
Click Download file to download and decompress the
vmware-alarm-action-scripts-for-cem.zip file.
- Create the following directory:
- On Linux®/Photon OS: /root/cem
- On Windows: C:\cem
- Transfer and unzip the package to /root/cem or
C:\cem.
Note:
To transfer the package to VCenter Server installed on Linux/Photon you must first run the
chsh
command to set bash for the login shell before transferring the package.
Example:
root@9 [ ~ ]# chsh
Changing the login shell for root
Enter the new value, or press ENTER for the default
Login Shell [/bin/appliancesh]: /usr/bin/bash
- For information about creating an alarm in the vSphere client, see https://docs.vmware.com/en/VMware-vSphere/6.7/com.vmware.vsphere.monitoring.doc/GUID-E30ED662-D851-4230-9AFE-1BBBC55C98D6.html.
- For information about running a script or a command as an alarm action, see https://docs.vmware.com/en/VMware-vSphere/6.7/com.vmware.vsphere.monitoring.doc/GUID-AB74502C-5F01-478D-AF66-672AB5B8065C.html.
Note:
You must identify the path to run Python 3 or cmd.exe in vCenter Server.
If the vCenter Server is running on Linux/Photon OS, you can run 'which python' to get the path to Python 3. For example, /usr/bin/python. Run /usr/bin/python
--version
to verify it is Python 3.
If the vCenter Server is running on Windows, then you must identify the path to cmd.exe. For example, C:\Windows\System32\cmd.exe.
- To send an alarm to event management,
you must specify the following as an alarm action:
- Linux/Photon OS: /usr/bin/python
/root/cem/vmware-alarm-action-scripts-for-cem/sendEventToCEM.py
- Windows: C:\Windows\System32\cmd.exe "/c echo.|powershell -NonInteractive -File
c:\cem\vmware-alarm-action-scripts-for-cem\sendEventToCEM.ps1
Note:
You can specify /usr/bin/python
/root/cem/vmware-alarm-action-scripts-for-cem/sendEventToCEM.py --expirytime <time in
seconds> or C:\Windows\System32\cmd.exe "/c echo.|powershell -NonInteractive
-File c:\cem\vmware-alarm-action-scripts-for-cem\sendEventToCEM.ps1 --expirytime <time in
seconds> as an alarm action to send an alarm to CEM and the CEM event will be cleared
after the --expirytime <time in seconds> if there is no further event. This is required if you
cannot define the reset rule or reset the alarms.
You must repeat the alarm action as an interval under the alarm rule in vCenter Server and the
value should be less than --expirytime
. For example, repeat action every 60 minutes
until acknowledged or reset to green. Then, the expirytime should be set to 14400 (14400 seconds is
equivalent to 4 hours). This implementation is a workaround to a current VMware limitation.
-
Save the integration in event management. To start receiving notifications from VMware vSphere, ensure that Enable event management from this
source is set to On..
What to do next
The same script can be used to clear the alarm. In VMware, go to
and specify the path from step 10 in
the Run this field. Note: due to VMware limitations this does not always get
executed.