📜 ⬆️ ⬇️

SMS alert plugin for critical tasks for Redmine

In our company , it became necessary to notify via SMS about the tasks set in the Redmine tracker, with the priority “Accident!”. It is very convenient to receive such alerts when instant response is required.

Together with the development team from secoint.ru, we developed the redmine_status_notifier plugin, which I will discuss under the cat.


How the plugin works

If in a new or existing task, the priority becomes for example, Accident! or Akhtung !, a script is launched that sends an alert to the specified mobile numbers via sms-gateway. When closing a task, alerts are also sent, which is very convenient for keeping the nervous system responsible for the project.
')
How to install and configure

The plugin is tested on the latest stable versions of Redmine, for example, 2.1.4.
We load the plugin into the redmine / plugins folder:
cd redmine/plugins && git clone https://github.com/olemskoi/redmine_status_notifier.git 


We edit the “critical_priority” parameters (the list of priorities for which notifications will be sent) and “script” (the path to the script that will send notifications) in the redmine_status_notifier / init.rb file.

Create a script similar to the following:
 #!/bin/sh #      : # : new / done ACTION="$1" #   ISSUE_ID="$2" #   PROJECT="$3" #   SUBJECT="$4" #   sms-    smsc.ru SMSC_LOGIN="mylogin" SMSC_PASSWORD="mypassword" #   ,    SMSC_NOTIFYTELS="89167777777,89151111111" case "$ACTION" in active) #      STATUS="new" ;; done) #    STATUS="done" ;; *) echo "please define action" exit 1 ;; esac #  sms-.      : "new myproject #111:  " SMSC_MESSAGE="$STATUS $PROJECT #$ISSUE_ID: $SUBJECT" #  API smsc,   curl     LC_ALL=ru_RU.UTF-8 /usr/bin/curl --silent --show-error "https://smsc.ru/sys/send.php?charset=utf-8&login=$SMSC_LOGIN&psw=$SMSC_PASSWORD&phones=$SMSC_NOTIFYTELS&mes=$SMSC_MESSAGE" > /dev/null 2>&1 


Restart Redmine.

For projects that need alerts, in the settings we include the module "Sending accident notifications".
Enable sending notifications in the project settings

That's all, now you will quickly learn about urgent tasks.

Source: https://habr.com/ru/post/160457/


All Articles