From 72eb4c46087e9e97349db9b9cdd9207426ed855e Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Fri, 9 Sep 2016 09:01:26 +0200
Subject: [PATCH] Addd PushOver notifications for netdata

---
 tasks/main.yml                     |  8 ++-
 templates/health_alarm_notify.conf | 99 ++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+), 2 deletions(-)
 create mode 100644 templates/health_alarm_notify.conf

diff --git a/tasks/main.yml b/tasks/main.yml
index 721e26a..a28fd60 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -77,11 +77,15 @@
 
   - name: "Configure Python Plugin"
     template:
-      src='python.d.conf'
-      dest='/etc/netdata/python.d.conf'
+      src='{{ item }}'
+      dest='/etc/netdata/{{ item }}'
       owner='root'
       group='root'
       mode=644
+      backup=yes
+    with_items:
+      - 'python.d.conf'
+      - 'health_alarm_notify.conf'
     notify:
       - "Re-start NetData"
 
diff --git a/templates/health_alarm_notify.conf b/templates/health_alarm_notify.conf
new file mode 100644
index 0000000..227f8db
--- /dev/null
+++ b/templates/health_alarm_notify.conf
@@ -0,0 +1,99 @@
+# Configuration for alarms recipients
+
+# netdata alarms have been categorized to allow different roles to receive
+# alarms related to their work.
+#
+# This file defines the addresses for each role.
+# This file is a BASH script itself.
+
+###############################################################################
+# external commands needed
+
+# The full path to the sendmail command.
+# If empty, the system $PATH will be searched for it.
+sendmail=""
+
+# The full path of the curl command.
+# If empty, the system $PATH will be searched for it.
+curl=""
+
+
+###############################################################################
+# sending emails
+
+# note: multiple recipients can be given like this:
+#              "admin1@example.com, admin2@example.com, ..."
+# note it needs a comma!
+
+# enable/disable sending emails
+SEND_EMAIL="YES"
+
+# if a role recipient is not configured, an email will be send to
+DEFAULT_RECIPIENT_EMAIL="root"
+
+
+###############################################################################
+# sending pushover notifications (pushover.net)
+
+# note: multiple recipients can be given like this:
+#                  "USERTOKEN1 USERTOKEN2 USERTOKEN3 ..."
+
+# enable/disable sending pushover notifications
+SEND_PUSHOVER="YES"
+
+# Login to pushover.com to get your pushover app token
+# You need only one for all your netdata servers.
+# Without it, netdata cannot send pushover notifications.
+PUSHOVER_APP_TOKEN="{{ netdata_pushover_app_token|default('') }}"
+
+# if a role recipient is not configured, a notification will be send to
+# this pushover user token
+DEFAULT_RECIPIENT_PUSHOVER="{{ netdata_pushover_user_token|default('') }}"
+
+
+###############################################################################
+# RECIPIENTS PER ROLE
+
+# -----------------------------------------------------------------------------
+# generic system alarms
+# CPU, disks, entropy, etc
+
+role_recipients_email[sysadmin]="${DEFAULT_RECIPIENT_EMAIL}"
+
+role_recipients_pushover[sysadmin]="${DEFAULT_RECIPIENT_PUSHOVER}"
+
+
+# -----------------------------------------------------------------------------
+# DNS related alarms
+
+role_recipients_email[domainadmin]="${DEFAULT_RECIPIENT_EMAIL}"
+
+role_recipients_pushover[domainadmin]="${DEFAULT_RECIPIENT_PUSHOVER}"
+
+
+# -----------------------------------------------------------------------------
+# database servers alarms
+# mysql, redis, memcached, etc
+
+role_recipients_email[dba]="${DEFAULT_RECIPIENT_EMAIL}"
+
+role_recipients_pushover[dba]="${DEFAULT_RECIPIENT_PUSHOVER}"
+
+
+# -----------------------------------------------------------------------------
+# web servers alarms
+# apache, nginx, etc
+
+role_recipients_email[webmaster]="${DEFAULT_RECIPIENT_EMAIL}"
+
+role_recipients_pushover[webmaster]="${DEFAULT_RECIPIENT_PUSHOVER}"
+
+
+# -----------------------------------------------------------------------------
+# proxy servers alarms
+# apache, nginx, etc
+
+role_recipients_email[proxyadmin]="${DEFAULT_RECIPIENT_EMAIL}"
+
+role_recipients_pushover[proxyadmin]="${DEFAULT_RECIPIENT_PUSHOVER}"
+
-- 
GitLab