From: Frank Brehm Date: Mon, 7 Oct 2024 16:20:46 +0000 (+0200) Subject: committing changes in /etc made by "/usr/bin/python3 /usr/bin/nala upgrade -y" X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=1fcf1b40b4f65a6b6f107da77c30797301f352e4;p=config%2Fhelga-hetzner%2Fetc.git committing changes in /etc made by "/usr/bin/python3 /usr/bin/nala upgrade -y" Packages with configuration changes: -icinga2-common 2.13.6-2+deb12u1 all +icinga2-common 2.14.2-1+debian12 all Package changes: -icinga2 2.13.6-2+deb12u1 amd64 -icinga2-bin 2.13.6-2+deb12u1 amd64 -icinga2-common 2.13.6-2+deb12u1 all +icinga2 2.14.2-1+debian12 amd64 +icinga2-bin 2.14.2-1+debian12 amd64 +icinga2-common 2.14.2-1+debian12 all -libcups2 2.4.2-3+deb12u7 amd64 +libcups2 2.4.2-3+deb12u8 amd64 -linux-image-amd64 6.1.106-3 amd64 +linux-image-6.1.0-26-amd64 6.1.112-1 amd64 +linux-image-amd64 6.1.112-1 amd64 -php8.2-cli 8.2.20-1~deb12u1 amd64 -php8.2-common 8.2.20-1~deb12u1 amd64 -php8.2-curl 8.2.20-1~deb12u1 amd64 -php8.2-fpm 8.2.20-1~deb12u1 amd64 -php8.2-gd 8.2.20-1~deb12u1 amd64 -php8.2-intl 8.2.20-1~deb12u1 amd64 -php8.2-mbstring 8.2.20-1~deb12u1 amd64 -php8.2-mysql 8.2.20-1~deb12u1 amd64 -php8.2-opcache 8.2.20-1~deb12u1 amd64 -php8.2-readline 8.2.20-1~deb12u1 amd64 -php8.2-xml 8.2.20-1~deb12u1 amd64 -php8.2-zip 8.2.20-1~deb12u1 amd64 +php8.2-cli 8.2.24-1~deb12u1 amd64 +php8.2-common 8.2.24-1~deb12u1 amd64 +php8.2-curl 8.2.24-1~deb12u1 amd64 +php8.2-fpm 8.2.24-1~deb12u1 amd64 +php8.2-gd 8.2.24-1~deb12u1 amd64 +php8.2-intl 8.2.24-1~deb12u1 amd64 +php8.2-mbstring 8.2.24-1~deb12u1 amd64 +php8.2-mysql 8.2.24-1~deb12u1 amd64 +php8.2-opcache 8.2.24-1~deb12u1 amd64 +php8.2-readline 8.2.24-1~deb12u1 amd64 +php8.2-xml 8.2.24-1~deb12u1 amd64 +php8.2-zip 8.2.24-1~deb12u1 amd64 -vim-icinga2 2.13.6-2+deb12u1 all +vim-icinga2 2.14.2-1+debian12 all --- diff --git a/.etckeeper b/.etckeeper index 2c3b8d8..f8218c8 100755 --- a/.etckeeper +++ b/.etckeeper @@ -691,6 +691,9 @@ maybe chmod 0644 'icinga2/features-available/influxdb.conf' 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' @@ -1750,6 +1753,8 @@ maybe chmod 0755 'systemd/system/default.target.wants' 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' diff --git a/icinga2/conf.d/commands.conf b/icinga2/conf.d/commands.conf index bd511ce..e7d555c 100644 --- a/icinga2/conf.d/commands.conf +++ b/icinga2/conf.d/commands.conf @@ -43,6 +43,7 @@ object NotificationCommand "mail-host-notification" { required = true value = "$notification_hoststate$" } + "-X" = "$notification_hostnotes$" "-t" = { required = true value = "$notification_type$" @@ -62,6 +63,7 @@ object NotificationCommand "mail-host-notification" { notification_hostoutput = "$host.output$" notification_hoststate = "$host.state$" notification_useremail = "$user.email$" + notification_hostnotes = "$host.notes$" } } @@ -110,6 +112,8 @@ object NotificationCommand "mail-service-notification" { required = true value = "$notification_type$" } + "-X" = "$notification_hostnotes$" + "-x" = "$notification_servicenotes$" "-u" = { required = true value = "$notification_servicedisplayname$" @@ -131,6 +135,8 @@ object NotificationCommand "mail-service-notification" { notification_servicestate = "$service.state$" notification_useremail = "$user.email$" notification_servicedisplayname = "$service.display_name$" + notification_hostnotes = "$host.notes$" + notification_servicenotes = "$service.notes$" } } @@ -160,6 +166,7 @@ object NotificationCommand "mail-host-notification" { NOTIFICATIONCOMMENT = "$notification.comment$" HOSTDISPLAYNAME = "$host.display_name$" USEREMAIL = "$user.email$" + HOSTNOTES = "$host.notes$" } } @@ -180,6 +187,8 @@ object NotificationCommand "mail-service-notification" { HOSTDISPLAYNAME = "$host.display_name$" SERVICEDISPLAYNAME = "$service.display_name$" USEREMAIL = "$user.email$" + HOSTNOTES = "$host.notes$" + SERVICENOTES = "$service.notes$" } } diff --git a/icinga2/conf.d/hosts.conf b/icinga2/conf.d/hosts.conf index 0118f03..e54d01d 100644 --- a/icinga2/conf.d/hosts.conf +++ b/icinga2/conf.d/hosts.conf @@ -30,7 +30,7 @@ object Host NodeName { 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" //} diff --git a/icinga2/features-available/journald.conf b/icinga2/features-available/journald.conf new file mode 100644 index 0000000..e0b36f7 --- /dev/null +++ b/icinga2/features-available/journald.conf @@ -0,0 +1,7 @@ +/** + * The JournaldLogger type writes log information to the systemd journal. + */ + +object JournaldLogger "journald" { + severity = "warning" +} diff --git a/icinga2/scripts/mail-host-notification.sh b/icinga2/scripts/mail-host-notification.sh index 744481a..70d3b50 100755 --- a/icinga2/scripts/mail-host-notification.sh +++ b/icinga2/scripts/mail-host-notification.sh @@ -27,6 +27,7 @@ Required parameters: 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) @@ -63,7 +64,7 @@ urlencode() { } ## 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 ;; @@ -77,6 +78,7 @@ do 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 @@ -129,6 +131,12 @@ if [ -n "$HOSTADDRESS6" ] ; then 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 @@ -141,7 +149,7 @@ fi 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. diff --git a/icinga2/scripts/mail-service-notification.sh b/icinga2/scripts/mail-service-notification.sh index 8e560ac..31d9137 100755 --- a/icinga2/scripts/mail-service-notification.sh +++ b/icinga2/scripts/mail-service-notification.sh @@ -29,6 +29,8 @@ Required parameters: 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) @@ -65,7 +67,7 @@ urlencode() { } ## 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 ;; @@ -79,6 +81,8 @@ do 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 @@ -134,6 +138,18 @@ if [ -n "$HOSTADDRESS6" ] ; then 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 @@ -146,7 +162,7 @@ fi 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. diff --git a/init.d/icinga2 b/init.d/icinga2 index 3abca95..daad9a9 100755 --- a/init.d/icinga2 +++ b/init.d/icinga2 @@ -23,12 +23,12 @@ DAEMON_GROUP=nagios 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 @@ -47,14 +47,16 @@ trap '' 13 # SIGPIPE # 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 () { @@ -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 } diff --git a/systemd/system/icinga2.service.d/limits.conf b/systemd/system/icinga2.service.d/limits.conf new file mode 100644 index 0000000..ad24f7e --- /dev/null +++ b/systemd/system/icinga2.service.d/limits.conf @@ -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