Using the OmniVista 2500 Trap Responder to send Webhook messages to Microsoft Teams Channel

At Linköping University, we wanted to get some of the Trap Notifications to be sent to a Microsoft Teams Channel […]

Post on 04.04.2023 by pst

At Linköping University, we wanted to get some of the Trap Notifications to be sent to a Microsoft Teams Channel to be able to monitor certain events that we need to pay extra attention to, such as Switches becoming unreachable, dyingGasp Traps (power failures), etc.



I had seen in OmniVista 2500 the “Trap Responder” functionality “Run an application on the server”.

I also had noticed while playing around in OmniVista  “The Virtual Appliance Menu” CLI that the curl binary was accessible via the “Advanced Mode”. Then I thought it must be possible to combine them to create a webhook. With the help of Sales Engineer at Alcatel-Lucent Enterprise, I got an example on how to execute curl via a shell script.


How to make it happen:


Create a Webhook in the Teams Channel that should receive your message:

In the Teams Channel, choose Connectors.



Configure Incoming Webhook.



Give the Webhook an appropriate name and Image and create the Webhook.

Save the URL to be used in the shell script executed by OmniVista 2500.



Configuration in OmniVista 2500


The Script:

First of all, we need a shell script to take care of the output from OmniVista 2500 Trap Responder.

Transfer the script via SFTP to OmniVista 2500 server using the user cliadmin (I used WinSCP for this step).

As OmniVista will have to execute the script from the server we have to give it proper executable rights. I set write on every user as we don’t have users logging in to OmniVista part from the cliadmin.




We also need to transfer/create the two logfiles in advance in the same folder.

When connecting to OmniVista with SFTP we end up in the folder /opt/OmniVista_2500_NMS/data/file_server/cliadmin/ and this is the folder we later refer to in the Trap Responder.

# Send trap responses from OmniVista2500 via Teams Webhook
# Pär Stolpe,, 2023-03-29 
# Copy this file to OmniVista2500 via cliadmin and sftp and set execute bits.
# The file will end up in the directory:
# /opt/OmniVista_2500_NMS/data/file_server/cliadmin/
# In OV configure Trap Responder as follows:
# Action: Run an application on the server
# Command: ./
# Arguments: $TrapName$ $TrapSeverity$ $TrapSource$ $TrapAgent$ $TrapAgentName$
# Start directory: /opt/OmniVista_2500_NMS/data/file_server/cliadmin/
# Standard input: $TrapSynopsis$
# Any file refered by the script must be created first before it may be used.
# ie error.txt and output.txt in the same catalog as this script.

read -r -d '' OV_STDIN

# Webhook URL for Teams Channel

# If you ever want a timestamp from the script use this variable
# now=$(TZ=Europe/Stockholm date +"%Y-%m-%d/%T")

# Color the messages accordingly
if [ ${2} == "Critical" ]; then
elif [ ${2} == "Warning" ]; then
elif [ ${2} == "Normal" ]; then

# A simple Microsoft Teams Adaptive Card layout
        \"type\": \"AdaptiveCard\",
        \"\$schema\": \"\",
            \"version\": \"1.4\",
            \"body\": [
                \"type\": \"TextBlock\",
                \"text\": \"${2}: ${5} - ${4}, ${1}\",
                \"wrap\": true,
                \"size\": \"Large\",
                \"weight\": \"Bolder\",
                \"color\": \"${textcolor}\"
                \"type\": \"TextBlock\",
                \"text\": \"${OV_STDIN}\",
                \"wrap\": true,
                \"size\": \"Medium\"

# Post the TEAMSCARD to WebHook
(curl -X POST -H 'Content-Type: application/json' -d "${TEAMSCARD}" $TEAMSURL)&>$LOGFILE

OmniVista 2500 GUI

In the OmniVista admin GUI, we need to create a new Trap Responder, choose which Trap Types we want to send messages on and fill out the Response as stated in the Script file and in the picture below.





With this method you may extend the OmniVista 2500 trap handling to inform other systems on specific events.


Pär Stolpe, Systems Engineer at Linköping University (LiU) in Sweden. He has a B.Sc. from LiU focused in Computer Engineering and Telecommunications. He is a long term sysadmin, skilled in Wired/Wireless Networking (SPB advocate), Linux, Solaris and Windows, scripting, etc. Freelance baroque oboist.


Please wait...


Comment below to share your thoughts on this blog post

Notify me of followup comments via e-mail. You can also subscribe without commenting.

This site uses Akismet to reduce spam. Learn how your comment data is processed.