From f00e9af3ae19eb09de4b69dabb528fa23754dd8c Mon Sep 17 00:00:00 2001 From: mhoellein Date: Thu, 13 Jul 2023 20:58:52 +0200 Subject: [PATCH] committing changes in /etc made by "apt-get upgrade" Package changes: -icinga2 2.13.7-1+ubuntu20.04 amd64 -icinga2-bin 2.13.7-1+ubuntu20.04 amd64 -icinga2-common 2.13.7-1+ubuntu20.04 all -icinga2-doc 2.13.7-1+ubuntu20.04 all -icinga2-ido-mysql 2.13.7-1+ubuntu20.04 amd64 +icinga2 2.14.0-1+ubuntu20.04 amd64 +icinga2-bin 2.14.0-1+ubuntu20.04 amd64 +icinga2-common 2.14.0-1+ubuntu20.04 all +icinga2-doc 2.14.0-1+ubuntu20.04 all +icinga2-ido-mysql 2.14.0-1+ubuntu20.04 amd64 -libruby2.7 2.7.0-5ubuntu1.11 amd64 +libruby2.7 2.7.0-5ubuntu1.12 amd64 -ruby2.7 2.7.0-5ubuntu1.11 amd64 +ruby2.7 2.7.0-5ubuntu1.12 amd64 -vim-icinga2 2.13.7-1+ubuntu20.04 all +vim-icinga2 2.14.0-1+ubuntu20.04 all --- .etckeeper | 5 ++++- icinga2/features-available/journald.conf | 7 +++++++ icinga2/scripts/mail-host-notification.sh | 12 ++++++++++-- icinga2/scripts/mail-service-notification.sh | 20 ++++++++++++++++++-- 4 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 icinga2/features-available/journald.conf diff --git a/.etckeeper b/.etckeeper index a05533bb7..a8230bae7 100755 --- a/.etckeeper +++ b/.etckeeper @@ -1317,7 +1317,7 @@ maybe chgrp 'nagios' 'icinga2/conf.d/api-users.conf' maybe chmod 0644 'icinga2/conf.d/api-users.conf' maybe chown 'nagios' 'icinga2/constants.conf' maybe chgrp 'nagios' 'icinga2/constants.conf' -maybe chmod 0644 'icinga2/constants.conf' +maybe chmod 0640 'icinga2/constants.conf' maybe chown 'nagios' 'icinga2/constants.conf.orig' maybe chgrp 'nagios' 'icinga2/constants.conf.orig' maybe chmod 0640 'icinga2/constants.conf.orig' @@ -1363,6 +1363,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' diff --git a/icinga2/features-available/journald.conf b/icinga2/features-available/journald.conf new file mode 100644 index 000000000..e0b36f7cf --- /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 744481a77..70d3b5005 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 8e560ac23..31d9137b8 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. -- 2.43.0