summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-03-28 14:57:07 +0000
committerLennart Weller <lhw@ring0.de>2018-03-28 15:01:19 +0000
commit8f50633ae91f9a28970f042f6dce62faa7b0c9ea (patch)
tree8312213833a1e0a8642e5ca646d12e96e566d502
parentUpdate copyright (diff)
downloadnetdata-8f50633ae91f9a28970f042f6dce62faa7b0c9ea.tar.xz
netdata-8f50633ae91f9a28970f042f6dce62faa7b0c9ea.zip
Patch: making SEND_EMAILS configurable
Diffstat (limited to '')
-rw-r--r--debian/changelog4
-rw-r--r--debian/netdata.config18
-rw-r--r--debian/netdata.postinst.in26
-rw-r--r--debian/netdata.templates14
-rw-r--r--debian/po/POTFILES.in1
-rw-r--r--debian/po/templates.pot50
6 files changed, 113 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 1876662f3..7567fb8cb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,11 @@
netdata (1.10.0+dfsg-1) UNRELEASED; urgency=medium
+ [ Federico Ceratto ]
* New upstream release
+ [ Lennart Weller ]
+ * Patch by Daniel Baumann to enable SEND_EMAILS configuration (Closes: #888815)
+
-- Federico Ceratto <federico@debian.org> Tue, 27 Mar 2018 22:28:59 +0100
netdata (1.9.0+dfsg-1) unstable; urgency=medium
diff --git a/debian/netdata.config b/debian/netdata.config
new file mode 100644
index 000000000..4a4b6bea6
--- /dev/null
+++ b/debian/netdata.config
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+CONFFILE="/etc/netdata/health_alarm_notify.conf"
+
+. /usr/share/debconf/confmodule
+
+if [ -e "${CONFFILE}" ]; then
+ # contains bashisms
+ . ${CONFFILE} || true
+
+ db_set netdata/send_email "${SEND_EMAIL}"
+fi
+
+db_settitle netdata/title
+db_input low netdata/send_email || true
+db_go
+
+db_stop
diff --git a/debian/netdata.postinst.in b/debian/netdata.postinst.in
index 48989f11e..71cac68a3 100644
--- a/debian/netdata.postinst.in
+++ b/debian/netdata.postinst.in
@@ -2,8 +2,34 @@
set -e
+CONFFILE="/etc/netdata/health_alarm_notify.conf"
+
+. /usr/share/debconf/confmodule
+
case "$1" in
configure)
+ db_get netdata/send_email
+ SEND_EMAIL="${RET:-true}" # boolean
+
+ db_stop
+
+ case "${SEND_EMAIL}" in
+ true)
+ SEND_EMAIL="YES"
+ ;;
+
+ *)
+ SEND_EMAIL="NO"
+ ;;
+ esac
+
+ if [ -e "${CONFFILE}" ]; then
+ sed -e "s|^ *SEND_EMAIL=.*|SEND_EMAIL=\"${SEND_EMAIL}\"|" \
+ < "${CONFFILE}" > "${CONFFILE}.tmp"
+
+ mv -f "${CONFFILE}.tmp" "${CONFFILE}"
+ fi
+
if [ -z "$2" ]; then
if ! getent group netdata >/dev/null; then
addgroup --quiet --system netdata
diff --git a/debian/netdata.templates b/debian/netdata.templates
new file mode 100644
index 000000000..b21b81e39
--- /dev/null
+++ b/debian/netdata.templates
@@ -0,0 +1,14 @@
+Template: netdata/title
+Type: title
+_Description: netdata: Configuration
+
+Template: netdata/send_email
+Type: boolean
+Default: true
+_Description: send emails:
+ netdata sends emails for warnings and alerts to root@localhost for
+ monitoring purposes. Potentially this can trigger a lot of emails.
+ .
+ Please choose to enable or disable sending emails.
+ .
+ If unsure, allow it to send emails (default).
diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in
new file mode 100644
index 000000000..e40390257
--- /dev/null
+++ b/debian/po/POTFILES.in
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] netdata.templates
diff --git a/debian/po/templates.pot b/debian/po/templates.pot
new file mode 100644
index 000000000..ca5f41a0b
--- /dev/null
+++ b/debian/po/templates.pot
@@ -0,0 +1,50 @@
+# Messages for netdata email configuration
+# Copyright (C) 2018
+# This file is distributed under the same license as the netdata package.
+# Daniel Baumann <daniel.baumann@progress-linux.org>
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: netdata\n"
+"Report-Msgid-Bugs-To: netdata@packages.debian.org\n"
+"POT-Creation-Date: 2018-02-27 10:30+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: title
+#. Description
+#: ../netdata.templates:1001
+msgid "netdata: Configuration"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../netdata.templates:2001
+msgid "send emails:"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../netdata.templates:2001
+msgid ""
+"netdata sends emails for warnings and alerts to root@localhost for "
+"monitoring purposes. Potentially this can trigger a lot of emails."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../netdata.templates:2001
+msgid "Please choose to enable or disable sending emails."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../netdata.templates:2001
+msgid "If unsure, allow it to send emails (default)."
+msgstr ""