maybe chown 'nagios' 'icinga2/features-available/influxdb2.conf'
maybe chgrp 'nagios' 'icinga2/features-available/influxdb2.conf'
maybe chmod 0644 'icinga2/features-available/influxdb2.conf'
+maybe chown 'nagios' 'icinga2/features-available/journald.conf'
+maybe chgrp 'nagios' 'icinga2/features-available/journald.conf'
+maybe chmod 0644 'icinga2/features-available/journald.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 chmod 0755 'systemd/system/getty.target.wants'
maybe chmod 0755 'systemd/system/getty@tty1.service.d'
maybe chmod 0644 'systemd/system/getty@tty1.service.d/noclear.conf'
+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/override.conf'
maybe chmod 0644 'systemd/system/minecraft.service'
required = true
value = "$notification_hoststate$"
}
+ "-X" = "$notification_hostnotes$"
"-t" = {
required = true
value = "$notification_type$"
notification_hostoutput = "$host.output$"
notification_hoststate = "$host.state$"
notification_useremail = "$user.email$"
+ notification_hostnotes = "$host.notes$"
}
}
required = true
value = "$notification_type$"
}
+ "-X" = "$notification_hostnotes$"
+ "-x" = "$notification_servicenotes$"
"-u" = {
required = true
value = "$notification_servicedisplayname$"
notification_servicestate = "$service.state$"
notification_useremail = "$user.email$"
notification_servicedisplayname = "$service.display_name$"
+ notification_hostnotes = "$host.notes$"
+ notification_servicenotes = "$service.notes$"
}
}
NOTIFICATIONCOMMENT = "$notification.comment$"
HOSTDISPLAYNAME = "$host.display_name$"
USEREMAIL = "$user.email$"
+ HOSTNOTES = "$host.notes$"
}
}
HOSTDISPLAYNAME = "$host.display_name$"
SERVICEDISPLAYNAME = "$service.display_name$"
USEREMAIL = "$user.email$"
+ HOSTNOTES = "$host.notes$"
+ SERVICENOTES = "$service.notes$"
}
}
vars.http_vhosts["http"] = {
http_uri = "/"
}
- /* Uncomment if you've sucessfully installed Icinga Web 2. */
+ /* Uncomment if you've successfully installed Icinga Web 2. */
//vars.http_vhosts["Icinga Web 2"] = {
// http_uri = "/icingaweb2"
//}
--- /dev/null
+/**
+ * The JournaldLogger type writes log information to the systemd journal.
+ */
+
+object JournaldLogger "journald" {
+ severity = "warning"
+}
Optional parameters:
-4 HOSTADDRESS (\$address\$)
-6 HOSTADDRESS6 (\$address6\$)
+ -X HOSTNOTES (\$host.notes\$)
-b NOTIFICATIONAUTHORNAME (\$notification.author\$)
-c NOTIFICATIONCOMMENT (\$notification.comment\$)
-i ICINGAWEB2URL (\$notification_icingaweb2url\$, Default: unset)
}
## Main
-while getopts 4:6::b:c:d:f:hi:l:n:o:r:s:t:v: opt
+while getopts 4:6::b:c:d:f:hi:l:n:o:r:s:t:v:X: opt
do
case "$opt" in
4) HOSTADDRESS=$OPTARG ;;
l) HOSTNAME=$OPTARG ;; # required
n) HOSTDISPLAYNAME=$OPTARG ;; # required
o) HOSTOUTPUT=$OPTARG ;; # required
+ X) HOSTNOTES=$OPTARG ;;
r) USEREMAIL=$OPTARG ;; # required
s) HOSTSTATE=$OPTARG ;; # required
t) NOTIFICATIONTYPE=$OPTARG ;; # required
IPv6: $HOSTADDRESS6"
fi
+## Check whether host notes was specified.
+if [ -n "$HOSTNOTES" ] ; then
+ NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE
+Host notes: $HOSTNOTES"
+fi
+
## Check whether author and comment was specified.
if [ -n "$NOTIFICATIONCOMMENT" ] ; then
NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE
if [ -n "$ICINGAWEB2URL" ] ; then
NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE
-$ICINGAWEB2URL/monitoring/host/show?host=$(urlencode "$HOSTNAME")"
+$ICINGAWEB2URL/icingadb/host?name=$(urlencode "$HOSTNAME")"
fi
## Check whether verbose mode was enabled and log to syslog.
Optional parameters:
-4 HOSTADDRESS (\$address\$)
-6 HOSTADDRESS6 (\$address6\$)
+ -X HOSTNOTES (\$host.notes\$)
+ -x SERVICENOTES (\$service.notes\$)
-b NOTIFICATIONAUTHORNAME (\$notification.author\$)
-c NOTIFICATIONCOMMENT (\$notification.comment\$)
-i ICINGAWEB2URL (\$notification_icingaweb2url\$, Default: unset)
}
## Main
-while getopts 4:6:b:c:d:e:f:hi:l:n:o:r:s:t:u:v: opt
+while getopts 4:6:b:c:d:e:f:hi:l:n:o:r:s:t:u:v:X:x: opt
do
case "$opt" in
4) HOSTADDRESS=$OPTARG ;;
i) ICINGAWEB2URL=$OPTARG ;;
l) HOSTNAME=$OPTARG ;; # required
n) HOSTDISPLAYNAME=$OPTARG ;; # required
+ X) HOSTNOTES=$OPTARG ;;
+ x) SERVICENOTES=$OPTARG ;;
o) SERVICEOUTPUT=$OPTARG ;; # required
r) USEREMAIL=$OPTARG ;; # required
s) SERVICESTATE=$OPTARG ;; # required
IPv6: $HOSTADDRESS6"
fi
+## Check whether host notes was specified.
+if [ -n "$HOSTNOTES" ] ; then
+ NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE
+Host notes: $HOSTNOTES"
+fi
+
+## Check whether service notes was specified.
+if [ -n "$SERVICENOTES" ] ; then
+ NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE
+Service notes: $SERVICENOTES"
+fi
+
## Check whether author and comment was specified.
if [ -n "$NOTIFICATIONCOMMENT" ] ; then
NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE
if [ -n "$ICINGAWEB2URL" ] ; then
NOTIFICATION_MESSAGE="$NOTIFICATION_MESSAGE
-$ICINGAWEB2URL/monitoring/service/show?host=$(urlencode "$HOSTNAME")&service=$(urlencode "$SERVICENAME")"
+$ICINGAWEB2URL/icingadb/service?name=$(urlencode "$SERVICENAME")&host.name=$(urlencode "$HOSTNAME")"
fi
## Check whether verbose mode was enabled and log to syslog.
DAEMON_CMDGROUP=www-data
DAEMON_ARGS="-e /var/log/icinga2/icinga2.err"
STARTUP_LOG="/var/log/icinga2/startup.log"
-PIDFILE=/run/icinga2/$NAME.pid
+PIDFILE=/var/run/icinga2/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Block/ignore SIGPIPE inside Icinga2
# Workaround for a known bug in 2.6.0
-# see https://github.com/Icinga/icinga2/issues/4867#issuecomment-273109525
+# see https://dev.icinga.com/issues/13567#note-19
trap '' 13 # SIGPIPE
# Exit if the package is not installed
# check run directory
check_run () {
- test -d '/run/icinga2' || mkdir /run/icinga2
- test -d '/run/icinga2/cmd' || mkdir /run/icinga2/cmd
+ if [ ! -e '/var/run/icinga2' ]; then
+ mkdir /var/run/icinga2
+ mkdir /var/run/icinga2/cmd
- chown "$DAEMON_USER":"$DAEMON_GROUP" /run/icinga2
- chmod 0755 /run/icinga2
+ chown "$DAEMON_USER":"$DAEMON_CMDGROUP" /var/run/icinga2/cmd
+ chmod 2710 /var/run/icinga2/cmd
- chown "$DAEMON_USER":"$DAEMON_CMDGROUP" /run/icinga2/cmd
- chmod 2710 /run/icinga2/cmd
+ chown "$DAEMON_USER":"$DAEMON_GROUP" /var/run/icinga2
+ chmod 0755 /var/run/icinga2
+ fi
}
check_config () {
# 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
}
--- /dev/null
+# 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