]> Frank Brehm's Git Trees - config/ns1/etc.git/commitdiff
committing changes in /etc made by "apt dist-upgrade -y"
authorFrank Brehm <frank@brehm-online.com>
Thu, 13 Jul 2023 16:03:08 +0000 (18:03 +0200)
committerFrank Brehm <frank@brehm-online.com>
Thu, 13 Jul 2023 16:03:08 +0000 (18:03 +0200)
Packages with configuration changes:
-icinga2-common 2.13.7-1+debian11 all

Package changes:
-icinga2 2.13.7-1+debian11 amd64
-icinga2-bin 2.13.7-1+debian11 amd64
-icinga2-common 2.13.7-1+debian11 all
-icinga2-ido-pgsql 2.13.7-1+debian11 amd64
-vim-icinga2 2.13.7-1+debian11 all
+vim-icinga2 2.14.0-1+debian11 all

.etckeeper
icinga2/conf.d/commands.conf
icinga2/features-available/journald.conf [new file with mode: 0644]
icinga2/scripts/mail-host-notification.sh
icinga2/scripts/mail-service-notification.sh

index 15bf20b5d960caf599ec41db5c9d8b5e7ef2099a..275d1a8ae07b88f005f26323fa82b7fc2e7d219f 100755 (executable)
@@ -948,6 +948,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'
index bd511cebcfdf4275ddda81d8827711ecef53ce4a..e7d555c8653aa8fcccd66022bdd8abcee1276748 100644 (file)
@@ -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/features-available/journald.conf b/icinga2/features-available/journald.conf
new file mode 100644 (file)
index 0000000..e0b36f7
--- /dev/null
@@ -0,0 +1,7 @@
+/**
+ * The JournaldLogger type writes log information to the systemd journal.
+ */
+
+object JournaldLogger "journald" {
+    severity = "warning"
+}
index 744481a77757f97521b9af6ca69dc4fa88cdb4aa..70d3b50051ad81ca55698b5be050128f7f802d9b 100755 (executable)
@@ -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.
index 8e560ac23981941965fbd4f50636b340711147f9..31d9137b885eaae5db6e4e537ef6c9925f36c301 100755 (executable)
@@ -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.