]> git.hoellein.online Git - homeserver/commitdiff
committing changes in /etc after apt run
authormhoellein <mhoellein@freenet.de>
Fri, 10 Jul 2020 10:08:02 +0000 (12:08 +0200)
committermhoellein <mhoellein@freenet.de>
Fri, 10 Jul 2020 10:08:02 +0000 (12:08 +0200)
Package changes:
-icinga2 2.8.1-0ubuntu2 amd64
-icinga2-bin 2.8.1-0ubuntu2 amd64
-icinga2-common 2.8.1-0ubuntu2 all
+libboost-context1.67.0-icinga 1.67.0-13.1.bionic amd64
+libboost-coroutine1.67.0-icinga 1.67.0-13.1.bionic amd64
+libboost-filesystem1.67.0-icinga 1.67.0-13.1.bionic amd64
+libboost-program-options1.67.0-icinga 1.67.0-13.1.bionic amd64
+libboost-regex1.67.0-icinga 1.67.0-13.1.bionic amd64
+libboost-system1.67.0-icinga 1.67.0-13.1.bionic amd64
+libboost-thread1.67.0-icinga 1.67.0-13.1.bionic amd64
-libicinga2 2.8.1-0ubuntu2 amd64

25 files changed:
.etckeeper
icinga2/conf.d/commands.conf
icinga2/conf.d/hosts.conf
icinga2/conf.d/notifications.conf
icinga2/conf.d/services.conf
icinga2/features-available/checker.conf
icinga2/features-available/command.conf
icinga2/features-available/compatlog.conf
icinga2/features-available/debuglog.conf
icinga2/features-available/elasticsearch.conf
icinga2/features-available/gelf.conf
icinga2/features-available/graphite.conf
icinga2/features-available/influxdb.conf
icinga2/features-available/livestatus.conf
icinga2/features-available/mainlog.conf
icinga2/features-available/notification.conf
icinga2/features-available/opentsdb.conf
icinga2/features-available/perfdata.conf
icinga2/features-available/statusdata.conf
icinga2/scripts/mail-host-notification.sh
icinga2/scripts/mail-service-notification.sh
icinga2/zones.d/README
init.d/icinga2
logrotate.d/icinga2
systemd/system/icinga2.service.d/limits.conf [new file with mode: 0644]

index ed2a533d50cdabc72807229dee5705b0a94a1f48..073c5cf63478c6e1d654087bf2e1d3b6481d6466 100755 (executable)
@@ -2735,51 +2735,127 @@ maybe chmod 0644 'icinga/objects/usg.cfg'
 maybe chown 'nagios' 'icinga2'
 maybe chgrp 'nagios' 'icinga2'
 maybe chmod 0750 'icinga2'
-maybe chmod 0755 'icinga2/conf.d'
+maybe chown 'nagios' 'icinga2/conf.d'
+maybe chgrp 'nagios' 'icinga2/conf.d'
+maybe chmod 0750 'icinga2/conf.d'
+maybe chown 'nagios' 'icinga2/conf.d/api-users.conf'
+maybe chgrp 'nagios' 'icinga2/conf.d/api-users.conf'
 maybe chmod 0644 'icinga2/conf.d/api-users.conf'
+maybe chown 'nagios' 'icinga2/conf.d/app.conf'
+maybe chgrp 'nagios' 'icinga2/conf.d/app.conf'
 maybe chmod 0644 'icinga2/conf.d/app.conf'
+maybe chown 'nagios' 'icinga2/conf.d/apt.conf'
+maybe chgrp 'nagios' 'icinga2/conf.d/apt.conf'
 maybe chmod 0644 'icinga2/conf.d/apt.conf'
+maybe chown 'nagios' 'icinga2/conf.d/commands.conf'
+maybe chgrp 'nagios' 'icinga2/conf.d/commands.conf'
 maybe chmod 0644 'icinga2/conf.d/commands.conf'
+maybe chown 'nagios' 'icinga2/conf.d/downtimes.conf'
+maybe chgrp 'nagios' 'icinga2/conf.d/downtimes.conf'
 maybe chmod 0644 'icinga2/conf.d/downtimes.conf'
+maybe chown 'nagios' 'icinga2/conf.d/groups.conf'
+maybe chgrp 'nagios' 'icinga2/conf.d/groups.conf'
 maybe chmod 0644 'icinga2/conf.d/groups.conf'
+maybe chown 'nagios' 'icinga2/conf.d/hosts.conf'
+maybe chgrp 'nagios' 'icinga2/conf.d/hosts.conf'
 maybe chmod 0644 'icinga2/conf.d/hosts.conf'
+maybe chown 'nagios' 'icinga2/conf.d/notifications.conf'
+maybe chgrp 'nagios' 'icinga2/conf.d/notifications.conf'
 maybe chmod 0644 'icinga2/conf.d/notifications.conf'
+maybe chown 'nagios' 'icinga2/conf.d/services.conf'
+maybe chgrp 'nagios' 'icinga2/conf.d/services.conf'
 maybe chmod 0644 'icinga2/conf.d/services.conf'
+maybe chown 'nagios' 'icinga2/conf.d/templates.conf'
+maybe chgrp 'nagios' 'icinga2/conf.d/templates.conf'
 maybe chmod 0644 'icinga2/conf.d/templates.conf'
+maybe chown 'nagios' 'icinga2/conf.d/timeperiods.conf'
+maybe chgrp 'nagios' 'icinga2/conf.d/timeperiods.conf'
 maybe chmod 0644 'icinga2/conf.d/timeperiods.conf'
+maybe chown 'nagios' 'icinga2/conf.d/users.conf'
+maybe chgrp 'nagios' 'icinga2/conf.d/users.conf'
 maybe chmod 0644 'icinga2/conf.d/users.conf'
-maybe chmod 0644 'icinga2/constants.conf'
-maybe chmod 0755 'icinga2/features-available'
+maybe chown 'nagios' 'icinga2/constants.conf'
+maybe chgrp 'nagios' 'icinga2/constants.conf'
+maybe chmod 0640 'icinga2/constants.conf'
+maybe chown 'nagios' 'icinga2/features-available'
+maybe chgrp 'nagios' 'icinga2/features-available'
+maybe chmod 0750 'icinga2/features-available'
+maybe chown 'nagios' 'icinga2/features-available/api.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/api.conf'
 maybe chmod 0644 'icinga2/features-available/api.conf'
+maybe chown 'nagios' 'icinga2/features-available/checker.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/checker.conf'
 maybe chmod 0644 'icinga2/features-available/checker.conf'
+maybe chown 'nagios' 'icinga2/features-available/command.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/command.conf'
 maybe chmod 0644 'icinga2/features-available/command.conf'
+maybe chown 'nagios' 'icinga2/features-available/compatlog.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/compatlog.conf'
 maybe chmod 0644 'icinga2/features-available/compatlog.conf'
+maybe chown 'nagios' 'icinga2/features-available/debuglog.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/debuglog.conf'
 maybe chmod 0644 'icinga2/features-available/debuglog.conf'
+maybe chown 'nagios' 'icinga2/features-available/elasticsearch.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/elasticsearch.conf'
 maybe chmod 0644 'icinga2/features-available/elasticsearch.conf'
+maybe chown 'nagios' 'icinga2/features-available/gelf.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/gelf.conf'
 maybe chmod 0644 'icinga2/features-available/gelf.conf'
+maybe chown 'nagios' 'icinga2/features-available/graphite.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/graphite.conf'
 maybe chmod 0644 'icinga2/features-available/graphite.conf'
+maybe chown 'nagios' 'icinga2/features-available/influxdb.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/influxdb.conf'
 maybe chmod 0644 'icinga2/features-available/influxdb.conf'
+maybe chown 'nagios' 'icinga2/features-available/livestatus.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/livestatus.conf'
 maybe chmod 0644 'icinga2/features-available/livestatus.conf'
+maybe chown 'nagios' 'icinga2/features-available/mainlog.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/mainlog.conf'
 maybe chmod 0644 'icinga2/features-available/mainlog.conf'
+maybe chown 'nagios' 'icinga2/features-available/notification.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/notification.conf'
 maybe chmod 0644 'icinga2/features-available/notification.conf'
+maybe chown 'nagios' 'icinga2/features-available/opentsdb.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/opentsdb.conf'
 maybe chmod 0644 'icinga2/features-available/opentsdb.conf'
+maybe chown 'nagios' 'icinga2/features-available/perfdata.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/perfdata.conf'
 maybe chmod 0644 'icinga2/features-available/perfdata.conf'
+maybe chown 'nagios' 'icinga2/features-available/statusdata.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/statusdata.conf'
 maybe chmod 0644 'icinga2/features-available/statusdata.conf'
+maybe chown 'nagios' 'icinga2/features-available/syslog.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/syslog.conf'
 maybe chmod 0644 'icinga2/features-available/syslog.conf'
-maybe chmod 0755 'icinga2/features-enabled'
-maybe chmod 0644 'icinga2/icinga2.conf'
+maybe chown 'nagios' 'icinga2/features-enabled'
+maybe chgrp 'nagios' 'icinga2/features-enabled'
+maybe chmod 0750 'icinga2/features-enabled'
+maybe chown 'nagios' 'icinga2/icinga2.conf'
+maybe chgrp 'nagios' 'icinga2/icinga2.conf'
+maybe chmod 0640 'icinga2/icinga2.conf'
 maybe chmod 0644 'icinga2/init.conf'
 maybe chown 'nagios' 'icinga2/pki'
 maybe chgrp 'nagios' 'icinga2/pki'
 maybe chmod 0700 'icinga2/pki'
+maybe chown 'nagios' 'icinga2/pki/ca.crt'
+maybe chgrp 'nagios' 'icinga2/pki/ca.crt'
 maybe chmod 0644 'icinga2/pki/ca.crt'
+maybe chown 'nagios' 'icinga2/pki/home.hoellein.online.crt'
+maybe chgrp 'nagios' 'icinga2/pki/home.hoellein.online.crt'
 maybe chmod 0644 'icinga2/pki/home.hoellein.online.crt'
+maybe chown 'nagios' 'icinga2/pki/home.hoellein.online.key'
+maybe chgrp 'nagios' 'icinga2/pki/home.hoellein.online.key'
 maybe chmod 0600 'icinga2/pki/home.hoellein.online.key'
 maybe chmod 0755 'icinga2/scripts'
 maybe chmod 0755 'icinga2/scripts/mail-host-notification.sh'
 maybe chmod 0755 'icinga2/scripts/mail-service-notification.sh'
-maybe chmod 0644 'icinga2/zones.conf'
-maybe chmod 0755 'icinga2/zones.d'
+maybe chown 'nagios' 'icinga2/zones.conf'
+maybe chgrp 'nagios' 'icinga2/zones.conf'
+maybe chmod 0640 'icinga2/zones.conf'
+maybe chown 'nagios' 'icinga2/zones.d'
+maybe chgrp 'nagios' 'icinga2/zones.d'
+maybe chmod 0750 'icinga2/zones.d'
 maybe chmod 0644 'icinga2/zones.d/README'
 maybe chgrp 'icingaweb2' 'icingaweb2'
 maybe chmod 2770 'icingaweb2'
@@ -8741,6 +8817,8 @@ maybe chmod 0755 'systemd/system/final.target.wants'
 maybe chmod 0755 'systemd/system/getty.target.wants'
 maybe chmod 0755 'systemd/system/graphical.target.wants'
 maybe chmod 0644 'systemd/system/hddtemp.service'
+maybe chmod 0755 'systemd/system/icinga2.service.d'
+maybe chmod 0644 'systemd/system/icinga2.service.d/limits.conf'
 maybe chmod 0755 'systemd/system/mariadb.service.d'
 maybe chmod 0644 'systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf'
 maybe chmod 0755 'systemd/system/multi-user.target.wants'
index 9c5153811a7d4aee4cfbd41399ff56ec78447d81..bd511cebcfdf4275ddda81d8827711ecef53ce4a 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 object NotificationCommand "mail-host-notification" {
-  command = [ SysconfDir + "/icinga2/scripts/mail-host-notification.sh" ]
+  command = [ ConfigDir + "/scripts/mail-host-notification.sh" ]
 
   arguments += {
     "-4" = "$notification_address$"
@@ -66,7 +66,7 @@ object NotificationCommand "mail-host-notification" {
 }
 
 object NotificationCommand "mail-service-notification" {
-  command = [ SysconfDir + "/icinga2/scripts/mail-service-notification.sh" ]
+  command = [ ConfigDir + "/scripts/mail-service-notification.sh" ]
 
   arguments += {
     "-4" = "$notification_address$"
@@ -146,7 +146,7 @@ object NotificationCommand "mail-service-notification" {
 /*
 
 object NotificationCommand "mail-host-notification" {
-  command = [ SysconfDir + "/icinga2/scripts/mail-host-notification.sh" ]
+  command = [ ConfigDir + "/scripts/mail-host-notification.sh" ]
 
   env = {
     NOTIFICATIONTYPE = "$notification.type$"
@@ -164,7 +164,7 @@ object NotificationCommand "mail-host-notification" {
 }
 
 object NotificationCommand "mail-service-notification" {
-  command = [ SysconfDir + "/icinga2/scripts/mail-service-notification.sh" ]
+  command = [ ConfigDir + "/scripts/mail-service-notification.sh" ]
 
   env = {
     NOTIFICATIONTYPE = "$notification.type$"
index 5ff1f9b615553cfe714389eb8377170151bbe4f4..0118f033ed0707702c6dff0f38e53915b3d48720 100644 (file)
@@ -23,7 +23,7 @@ object Host NodeName {
   address = "127.0.0.1"
   address6 = "::1"
 
-  /* Set custom attribute `os` for hostgroup assignment in `groups.conf`. */
+  /* Set custom variable `os` for hostgroup assignment in `groups.conf`. */
   vars.os = "Linux"
 
   /* Define http vhost attributes for service apply rules in `services.conf`. */
index 6a7e1f5a489d963fb416c0d893b34259364e8b9a..ac65875468d3410fb3a1523c4d02a435f6e71ce9 100644 (file)
@@ -2,7 +2,7 @@
  * The example notification apply rules.
  *
  * Only applied if host/service objects have
- * the custom attribute `notification` defined
+ * the custom variable `notification` defined
  * and containing `mail` as key.
  *
  * Check `hosts.conf` for an example.
index 416915bc07928fbd5419e9ee35f9d0d7a422308a..c8e1b3cc65952977105614632a40293f349acd83 100644 (file)
@@ -42,7 +42,7 @@ apply Service "ping6" {
 /*
  * Apply the `ssh` service to all hosts
  * with the `address` attribute defined and
- * the custom attribute `os` set to `Linux`.
+ * the custom variable `os` set to `Linux`.
  */
 apply Service "ssh" {
   import "generic-service"
index 1139e626ef5d5936a2c5bf76af8779b1be88096c..6f003b8f3f405618d98e1f01f4d0860e38f64b4e 100644 (file)
@@ -2,6 +2,4 @@
  * The checker component takes care of executing service checks.
  */
 
-library "checker"
-
 object CheckerComponent "checker" { }
index 35830560effd971f3abdc859d6b3605c25183f66..ffdd143a93f83f6458ee9b38f517803b6ffd97ad 100644 (file)
@@ -3,7 +3,5 @@
  * commands pipe.
  */
 
-library "compat"
-
 object ExternalCommandListener "command" { }
 
index 58c5df7168e2c91f51378ad7abfa7cef88e17e3f..6f5cf5f5279d91b90286cd888f00f24c4f6ae584 100644 (file)
@@ -3,7 +3,5 @@
  * that is compatible with Icinga 1.x.
  */
 
-library "compat"
-
 object CompatLogger "compatlog" { }
 
index 6e8e5813e6112e0ac4318f842c213cb54c9eb1ef..e66518fe16483589d18015821c5d4ba30cdd088c 100644 (file)
@@ -6,6 +6,5 @@
 
 object FileLogger "debug-file" {
   severity = "debug"
-  path = LocalStateDir + "/log/icinga2/debug.log"
+  path = LogDir + "/debug.log"
 }
-
index 86a05a24831406ec9517db5acab7777abf2ea027..8014913a7d045732395373be622f38d95c9815bf 100644 (file)
@@ -1,5 +1,3 @@
-library "perfdata"
-
 object ElasticsearchWriter "elasticsearch" {
   //host = "127.0.0.1"
   //port = 9200
index 2db44ef7e37fa37fb085875a18fbbd40c66f9b59..c14c86408a865bee5287c7a1a2561ea376551191 100644 (file)
@@ -4,8 +4,6 @@
  * Logstash or any other receiver.
  */
 
-library "perfdata"
-
 object GelfWriter "gelf" {
   //host = "127.0.0.1"
   //port = 12201
index f2e59d9e89fb73fbe9a78e4505c00fe6c21478c3..ae8a9288ffdaf0fe2903e71142e3db9f8babd145 100644 (file)
@@ -3,8 +3,6 @@
  * performance data to a graphite tcp socket.
  */
 
-library "perfdata"
-
 object GraphiteWriter "graphite" {
   //host = "127.0.0.1"
   //port = 2003
index 20f9ed253b0e36367b31122b31dd54a215f194ca..af8423577d5d46aa4d998d635f2fc7ca9f2bec75 100644 (file)
@@ -3,8 +3,6 @@
  * performance data to an InfluxDB HTTP API
  */
 
-library "perfdata"
-
 object InfluxdbWriter "influxdb" {
   //host = "127.0.0.1"
   //port = 8086
index 45d44d6b99387ddd0fd93d7897e8e1b6976e4bbf..246c085e3371a4696eea91385df47e9068ce3bc3 100644 (file)
@@ -1,8 +1,6 @@
 /**
- *  The livestatus library implements the livestatus query protocol.
+ *  The LivestatusListener type implements the Livestatus query protocol.
  */
 
-library "livestatus"
-
 object LivestatusListener "livestatus" { }
 
index ded9a7c7d96cda8d12c731908429c27ca2878120..a3bb19dabe6795383626776c22349a265f1a8b33 100644 (file)
@@ -4,6 +4,5 @@
 
 object FileLogger "main-log" {
   severity = "information"
-  path = LocalStateDir + "/log/icinga2/icinga2.log"
+  path = LogDir + "/icinga2.log"
 }
-
index aa22f6059b1851161f51bc2fd08a2aabd00d561a..3f9a88edf03295da5d1c260c86533a2b276e867e 100644 (file)
@@ -1,7 +1,5 @@
 /**
- * The notification component takes care of executing service checks.
+ * The notification component is responsible for sending notifications.
  */
 
-library "notification"
-
 object NotificationComponent "notification" { }
index fcb547d01e2cfb572542ce63205f39b8583fb302..540556c101b740d1c81fb43d57da10d4f654a65c 100644 (file)
@@ -3,8 +3,6 @@
  * performance data to a OpenTSDB tcp socket.
  */
 
-library "perfdata"
-
 object OpenTsdbWriter "opentsdb" {
   //host = "127.0.0.1"
   //port = 4242
index 356431f373d55655ca31a48d9efffead5f63ac3f..3ba8635408c430c20f287f9826daf425a6e168d2 100644 (file)
@@ -3,6 +3,4 @@
  * them in a regular interval.
  */
 
-library "perfdata"
-
 object PerfdataWriter "perfdata" { }
index af02aa5214702ae3c47c02ee5887508d6ab7c9c8..bb81c9617a1763b13503c4c017c3dc65008958aa 100644 (file)
@@ -4,7 +4,5 @@
  * hosts and services.
  */
 
-library "compat"
-
 object StatusDataWriter "status" { }
 
index d6e22ce9a32a3162ebe2c80266bc5686e4076bab..93f942e13f167ddd7109f39e8305ef49c8b1731c 100755 (executable)
@@ -1,6 +1,6 @@
-#!/usr/bin/env bash
-#
-# Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/)
+#!/bin/sh
+# Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+
+# Except of function urlencode which is Copyright (C) by Brian White (brian@aljex.com) used under MIT license
 
 PROG="`basename $0`"
 ICINGA2HOST="`hostname`"
@@ -49,6 +49,19 @@ Error() {
   exit 1;
 }
 
+urlencode() {
+  local LANG=C i=0 c e s="$1"
+
+  while [ $i -lt ${#1} ]; do
+    [ "$i" -eq 0 ] || s="${s#?}"
+    c=${s%"${s#?}"}
+    [ -z "${c#[[:alnum:].~_-]}" ] || c=$(printf '%%%02X' "'$c")
+    e="${e}${c}"
+    i=$((i + 1))
+  done
+  echo "$e"
+}
+
 ## Main
 while getopts 4:6::b:c:d:f:hi:l:n:o:r:s:t:v: opt
 do
@@ -79,14 +92,14 @@ done
 
 shift $((OPTIND - 1))
 
-## Check required parameters (TODO: better error message)
 ## Keep formatting in sync with mail-service-notification.sh
-if [ ! "$LONGDATETIME" ] \
-|| [ ! "$HOSTNAME" ] || [ ! "$HOSTDISPLAYNAME" ] \
-|| [ ! "$HOSTOUTPUT" ] || [ ! "$HOSTSTATE" ] \
-|| [ ! "$USEREMAIL" ] || [ ! "$NOTIFICATIONTYPE" ]; then
-  Error "Requirement parameters are missing."
-fi
+for P in LONGDATETIME HOSTNAME HOSTDISPLAYNAME HOSTOUTPUT HOSTSTATE USEREMAIL NOTIFICATIONTYPE ; do
+       eval "PAR=\$${P}"
+
+       if [ ! "$PAR" ] ; then
+               Error "Required parameter '$P' is missing."
+       fi
+done
 
 ## Build the message's subject
 SUBJECT="[$NOTIFICATIONTYPE] Host $HOSTDISPLAYNAME is $HOSTSTATE!"
@@ -128,7 +141,7 @@ fi
 if [ -n "$ICINGAWEB2URL" ] ; then
   NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE
 
-$ICINGAWEB2URL/monitoring/host/show?host=$HOSTNAME"
+$ICINGAWEB2URL/monitoring/host/show?host=$(urlencode "$HOSTNAME")"
 fi
 
 ## Check whether verbose mode was enabled and log to syslog.
@@ -144,13 +157,15 @@ if [ -n "$MAILFROM" ] ; then
 
   ## Debian/Ubuntu use mailutils which requires `-a` to append the header
   if [ -f /etc/debian_version ]; then
-    /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | $MAILBIN -a "From: $MAILFROM" -s "$SUBJECT" $USEREMAIL
+    /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \
+    | $MAILBIN -a "From: $MAILFROM" -s "$SUBJECT" $USEREMAIL
   ## Other distributions (RHEL/SUSE/etc.) prefer mailx which sets a sender address with `-r`
   else
-    /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | $MAILBIN -r "$MAILFROM" -s "$SUBJECT" $USEREMAIL
+    /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \
+    | $MAILBIN -r "$MAILFROM" -s "$SUBJECT" $USEREMAIL
   fi
 
 else
-  /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" \
+  /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \
   | $MAILBIN -s "$SUBJECT" $USEREMAIL
 fi
index b94001dc9a6bf9989a2e1e10ba174778926bd536..8ccb8d45653205a3c653369abaa989fd6371645d 100755 (executable)
@@ -1,6 +1,6 @@
-#!/usr/bin/env bash
-#
-# Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/)
+#!/bin/sh
+# Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+
+# Except of function urlencode which is Copyright (C) by Brian White (brian@aljex.com) used under MIT license
 
 PROG="`basename $0`"
 ICINGA2HOST="`hostname`"
@@ -51,6 +51,19 @@ Error() {
   exit 1;
 }
 
+urlencode() {
+  local LANG=C i=0 c e s="$1"
+
+  while [ $i -lt ${#1} ]; do
+    [ "$i" -eq 0 ] || s="${s#?}"
+    c=${s%"${s#?}"}
+    [ -z "${c#[[:alnum:].~_-]}" ] || c=$(printf '%%%02X' "'$c")
+    e="${e}${c}"
+    i=$((i + 1))
+  done
+  echo "$e"
+}
+
 ## Main
 while getopts 4:6:b:c:d:e:f:hi:l:n:o:r:s:t:u:v: opt
 do
@@ -83,15 +96,14 @@ done
 
 shift $((OPTIND - 1))
 
-## Check required parameters (TODO: better error message)
 ## Keep formatting in sync with mail-host-notification.sh
-if [ ! "$LONGDATETIME" ] \
-|| [ ! "$HOSTNAME" ] || [ ! "$HOSTDISPLAYNAME" ] \
-|| [ ! "$SERVICENAME" ] || [ ! "$SERVICEDISPLAYNAME" ] \
-|| [ ! "$SERVICEOUTPUT" ] || [ ! "$SERVICESTATE" ] \
-|| [ ! "$USEREMAIL" ] || [ ! "$NOTIFICATIONTYPE" ]; then
-  Error "Requirement parameters are missing."
-fi
+for P in LONGDATETIME HOSTNAME HOSTDISPLAYNAME SERVICENAME SERVICEDISPLAYNAME SERVICEOUTPUT SERVICESTATE USEREMAIL NOTIFICATIONTYPE ; do
+        eval "PAR=\$${P}"
+
+        if [ ! "$PAR" ] ; then
+                Error "Required parameter '$P' is missing."
+        fi
+done
 
 ## Build the message's subject
 SUBJECT="[$NOTIFICATIONTYPE] $SERVICEDISPLAYNAME on $HOSTDISPLAYNAME is $SERVICESTATE!"
@@ -134,7 +146,7 @@ fi
 if [ -n "$ICINGAWEB2URL" ] ; then
   NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE
 
-$ICINGAWEB2URL/monitoring/service/show?host=$HOSTNAME&service=$SERVICENAME"
+$ICINGAWEB2URL/monitoring/service/show?host=$(urlencode "$HOSTNAME")&service=$(urlencode "$SERVICENAME")"
 fi
 
 ## Check whether verbose mode was enabled and log to syslog.
@@ -150,13 +162,15 @@ if [ -n "$MAILFROM" ] ; then
 
   ## Debian/Ubuntu use mailutils which requires `-a` to append the header
   if [ -f /etc/debian_version ]; then
-    /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | $MAILBIN -a "From: $MAILFROM" -s "$SUBJECT" $USEREMAIL
+    /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \
+    | $MAILBIN -a "From: $MAILFROM" -s "$SUBJECT" $USEREMAIL
   ## Other distributions (RHEL/SUSE/etc.) prefer mailx which sets a sender address with `-r`
   else
-    /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | $MAILBIN -r "$MAILFROM" -s "$SUBJECT" $USEREMAIL
+    /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \
+    | $MAILBIN -r "$MAILFROM" -s "$SUBJECT" $USEREMAIL
   fi
 
 else
-  /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" \
+  /usr/bin/printf "%b" "$NOTIFICATION_MESSAGE" | tr -d '\015' \
   | $MAILBIN -s "$SUBJECT" $USEREMAIL
 fi
index ceff6bd8c8eaf0d06f4687c2b0ca9a5045f13990..e378eae9d42033aa1a18fc51cde05d2c17422a45 100644 (file)
@@ -1,2 +1,2 @@
-This directory contains configuration files for cluster zones. If you're not
-running a cluster you can safely ignore this directory.
+Please check the documentation for more details:
+https://icinga.com/docs/icinga2/latest/doc/06-distributed-monitoring/
index 4ee354ce594bc275cd1164eab16eb6601f65d812..daad9a94876d4dbb7050c7eefc01f308cfaccdef 100755 (executable)
@@ -47,14 +47,16 @@ trap '' 13 # SIGPIPE
 
 # check run directory
 check_run () {
-  test -d '/var/run/icinga2' || mkdir /var/run/icinga2
-  test -d '/var/run/icinga2/cmd' || mkdir /var/run/icinga2/cmd
+  if [ ! -e '/var/run/icinga2' ]; then
+    mkdir /var/run/icinga2
+    mkdir /var/run/icinga2/cmd
 
-  chown "$DAEMON_USER":"$DAEMON_GROUP" /var/run/icinga2
-  chmod 0755 /var/run/icinga2
+    chown "$DAEMON_USER":"$DAEMON_CMDGROUP" /var/run/icinga2/cmd
+    chmod 2710 /var/run/icinga2/cmd
 
-  chown "$DAEMON_USER":"$DAEMON_CMDGROUP" /var/run/icinga2/cmd
-  chmod 2710 /var/run/icinga2/cmd
+    chown "$DAEMON_USER":"$DAEMON_GROUP" /var/run/icinga2
+    chmod 0755 /var/run/icinga2
+  fi
 }
 
 check_config () {
@@ -128,7 +130,7 @@ do_reload() {
   # restarting (for example, when it is sent a SIGHUP),
   # then implement that here.
   #
-  start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
+  start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE --name $NAME
   return 0
 }
 
index 867502d0e258b40e99425d54fcb451ad1c182f35..df45df74aafc234b1a0214258125776c53c10d0e 100644 (file)
@@ -21,4 +21,3 @@
        create 644 nagios nagios
        # TODO: figure out how to get Icinga to re-open this log file
 }
-
diff --git a/systemd/system/icinga2.service.d/limits.conf b/systemd/system/icinga2.service.d/limits.conf
new file mode 100644 (file)
index 0000000..ad24f7e
--- /dev/null
@@ -0,0 +1,9 @@
+# Icinga 2 sets some default values to extend OS defaults
+#
+# Please refer to our troubleshooting documentations for details
+# and reasons on these values.
+[Service]
+TasksMax=infinity
+
+# May also cause problems, uncomment if you have any
+#LimitNPROC=62883