Created
July 28, 2016 20:22
-
-
Save gcanales75/04a163afb35b2a1a54a23ce8be20e3a9 to your computer and use it in GitHub Desktop.
Envia notificaciones de Alarmas de vCenter a Slack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/sh | |
| curl -X POST -H 'Content-type: application/json' \ | |
| --data '{ "text":"'$1' '$2'" }' \ | |
| https://hooks.slack.com/services/T0xxxxxxx/xxxxxxxxx/1pRj3eXqJtFy74WHK4xxxxxx |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Es necesario pasar las variables que deseas ver en la notificacion a Slack. La linea 4 define que 2 variables pueden se pasadas al script. La lista completa de variables que se pueden utilizar esta en:
https://pubs.vmware.com/vsphere-60/topic/com.vmware.vsphere.monitoring.doc/GUID-B8DF4E10-89E3-409D-9111-AE405B7E5D2E_copy.html
En los settings de la alarma, pestaña "Actions", debes agregar la ruta del script y los parametros (ej. "/scripts/notificaciones.sh {alarmName} {targetName}". "Action" debe ser "Run command".