please find below a way how you can send an alert with GL to a MS Teams Channel.

The code below is just a simple shell script which you can call by GL with a Linux Shell Script Action


###############################
#!/bin/bash
##
## make sure you add a # at the end of the lines for the variable declarations and the curl command,
## so you don't accidentally get embedded carriage returns
##
## instructions for setting up a webhook in Teams:
## https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook
## TODO: add your webhook url below; you could also set this up to pass the URL as a parameter, like GL_MESSAGE below
WEBHOOK_URL="https://your.webhook.url" #
##
## parameter $1 is the message severity type (like "INFORMATION" or "ERROR"), parameter $2 is the first parameter in the action;
## parameters in GreenLight need to be surrounded by single quotes, e.g. 'Connection to ${config.nodeDefinition.name} failed'
GL_MESSAGE="$1: $2" #
##
jsonPayload=$(cat << _EOM_
{
"text": "<pre>$GL_MESSAGE</pre>"
}
_EOM_
)
##
curl -H "Content-Type: application/json" -d "$jsonPayload" $WEBHOOK_URL #


  • Upload the script to your GreenLight server using WinSCP or similar, to: /opt/panagenda/appdata/volumes/gl/scripts/gl_action
  • Create a Linux Shell Script action to an existing sensor (the Parameter is the message that will be sent, be sure to remember to enclose it in 'single quotes'):