Create a script called spike.sh at local/share/check_mk/notifications
Step 2
Paste the below script in the spike.sh file, using your prefered editor like nano or vim.
#!/bin/bash
# Notify via Spike.sh
# In order to use this script:
# - copy it into your site into ~/local/share/check_mk/notificaions
# - make sure it is executable
# - Modify the spike webhook url into SPIKE_URL=
# - Create a notification rule that makes use of the new plugin
curl --header "Content-Type: application/json" \
--request POST \
--data '{"OMD_ROOT" : "'"$OMD_ROOT"'","OMD_SITE" : "'"$OMD_SITE"'","NOTIFY_WHAT" : "'"$NOTIFY_WHAT"'","NOTIFY_CONTACTNAME" : "'"$NOTIFY_CONTACTNAME"'","NOTIFY_CONTACTEMAIL" : "'"$NOTIFY_CONTACTEMAIL"'","NOTIFY_CONTACTPAGER" : "'"$NOTIFY_CONTACTPAGER"'","NOTIFY_DATE" : "'"$NOTIFY_DATE"'","NOTIFY_LONGDATETIME" : "'"$NOTIFY_LONGDATETIME"'","NOTIFY_SHORTDATETIME" : "'"$NOTIFY_SHORTDATETIME"'","NOTIFY_HOSTNAME" : "'"$NOTIFY_HOSTNAME"'","NOTIFY_HOSTOUTPUT" : "'"$NOTIFY_HOSTOUTPUT"'","NOTIFY_HOSTSTATE" : "'"$NOTIFY_HOSTSTATE"'","NOTIFY_NOTIFICATIONTYPE" : "'"$NOTIFY_NOTIFICATIONTYPE"'","NOTIFY_PARAMETERS" : "'"$NOTIFY_PARAMETERS"'","NOTIFY_PARAMETER_1" : "'"$NOTIFY_PARAMETER_1"'","NOTIFY_PARAMETER_2" : "'"$NOTIFY_PARAMETER_2"'","NOTIFY_SERVICEDESC" : "'"$NOTIFY_SERVICEDESC"'","NOTIFY_SERVICEOUTPUT" : "'"$NOTIFY_SERVICEOUTPUT"'","NOTIFY_SERVICESTATE" : "'"$NOTIFY_SERVICESTATE"'"}' \
"$SPIKE_URL"
Step 3
Export the spike webhook in an environment variable as:
In case if you are using Checkmk with Docker containers, follow these steps.
Step 1
Create a script called spike.sh in your server at $HOME
$ sudo nano $HOME/spike.sh
Step 2
Paste the below script in the spike.sh file.
#!/bin/bash
# Notify via Spike.sh
# In order to use this script:
# - copy it into your site into ~/local/share/check_mk/notificaions
# - make sure it is executable
# - Modify the spike webhook url into SPIKE_URL=
# - Create a notification rule that makes use of the new plugin
curl --header "Content-Type: application/json" \
--request POST \
--data '{"OMD_ROOT" : "'"$OMD_ROOT"'","OMD_SITE" : "'"$OMD_SITE"'","NOTIFY_WHAT" : "'"$NOTIFY_WHAT"'","NOTIFY_CONTACTNAME" : "'"$NOTIFY_CONTACTNAME"'","NOTIFY_CONTACTEMAIL" : "'"$NOTIFY_CONTACTEMAIL"'","NOTIFY_CONTACTPAGER" : "'"$NOTIFY_CONTACTPAGER"'","NOTIFY_DATE" : "'"$NOTIFY_DATE"'","NOTIFY_LONGDATETIME" : "'"$NOTIFY_LONGDATETIME"'","NOTIFY_SHORTDATETIME" : "'"$NOTIFY_SHORTDATETIME"'","NOTIFY_HOSTNAME" : "'"$NOTIFY_HOSTNAME"'","NOTIFY_HOSTOUTPUT" : "'"$NOTIFY_HOSTOUTPUT"'","NOTIFY_HOSTSTATE" : "'"$NOTIFY_HOSTSTATE"'","NOTIFY_NOTIFICATIONTYPE" : "'"$NOTIFY_NOTIFICATIONTYPE"'","NOTIFY_PARAMETERS" : "'"$NOTIFY_PARAMETERS"'","NOTIFY_PARAMETER_1" : "'"$NOTIFY_PARAMETER_1"'","NOTIFY_PARAMETER_2" : "'"$NOTIFY_PARAMETER_2"'","NOTIFY_SERVICEDESC" : "'"$NOTIFY_SERVICEDESC"'","NOTIFY_SERVICEOUTPUT" : "'"$NOTIFY_SERVICEOUTPUT"'","NOTIFY_SERVICESTATE" : "'"$NOTIFY_SERVICESTATE"'"}' \
"$SPIKE_URL"
Step 3
Export the spike webhook in an environment variable as: