From f31ea13dd82890c9f646168c8016d68814f807f9 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Fri, 27 Sep 2019 23:27:52 +0200 Subject: [PATCH] committing changes in /etc made by "apt dist-upgrade -y" Package changes: -base-files 10.3 amd64 +base-files 10.3+deb10u1 amd64 -bzip2 1.0.6-9.1 amd64 +bzip2 1.0.6-9.2~deb10u1 amd64 -console-setup 1.191 all -console-setup-linux 1.191 all +console-setup 1.193~deb10u1 all +console-setup-linux 1.193~deb10u1 all -dirmngr 2.2.12-1 amd64 +dirmngr 2.2.12-1+deb10u1 amd64 -e2fslibs 1.44.5-1 amd64 -e2fsprogs 1.44.5-1 amd64 +e2fslibs 1.44.5-1+deb10u1 amd64 +e2fsprogs 1.44.5-1+deb10u1 amd64 -gnupg 2.2.12-1 all -gnupg-l10n 2.2.12-1 all -gnupg-utils 2.2.12-1 amd64 -gpg 2.2.12-1 amd64 -gpg-agent 2.2.12-1 amd64 -gpg-wks-client 2.2.12-1 amd64 -gpg-wks-server 2.2.12-1 amd64 -gpgconf 2.2.12-1 amd64 -gpgsm 2.2.12-1 amd64 -gpgv 2.2.12-1 amd64 +gnupg 2.2.12-1+deb10u1 all +gnupg-l10n 2.2.12-1+deb10u1 all +gnupg-utils 2.2.12-1+deb10u1 amd64 +gpg 2.2.12-1+deb10u1 amd64 +gpg-agent 2.2.12-1+deb10u1 amd64 +gpg-wks-client 2.2.12-1+deb10u1 amd64 +gpg-wks-server 2.2.12-1+deb10u1 amd64 +gpgconf 2.2.12-1+deb10u1 amd64 +gpgsm 2.2.12-1+deb10u1 amd64 +gpgv 2.2.12-1+deb10u1 amd64 -icinga2 2.10.5-1.stretch amd64 -icinga2-bin 2.10.5-1.stretch amd64 -icinga2-common 2.10.5-1.stretch all +icinga2 2.11.0-2.buster amd64 +icinga2-bin 2.11.0-2.buster amd64 +icinga2-common 2.11.0-2.buster all -initramfs-tools 0.133 all -initramfs-tools-core 0.133 all +initramfs-tools 0.133+deb10u1 all +initramfs-tools-core 0.133+deb10u1 all -keyboard-configuration 1.191 all +keyboard-configuration 1.193~deb10u1 all +libboost-atomic1.67.0 1.67.0-13 amd64 +libboost-chrono1.67.0 1.67.0-13 amd64 +libboost-context1.67.0 1.67.0-13 amd64 +libboost-coroutine1.67.0 1.67.0-13 amd64 +libboost-date-time1.67.0 1.67.0-13 amd64 +libboost-filesystem1.67.0 1.67.0-13 amd64 +libboost-program-options1.67.0 1.67.0-13 amd64 +libboost-regex1.67.0 1.67.0-13 amd64 +libboost-thread1.67.0 1.67.0-13 amd64 -libbz2-1.0 1.0.6-9.1 amd64 +libbz2-1.0 1.0.6-9.2~deb10u1 amd64 -libcom-err2 1.44.5-1 amd64 -libcomerr2 1.44.5-1 amd64 +libcom-err2 1.44.5-1+deb10u1 amd64 +libcomerr2 1.44.5-1+deb10u1 amd64 -libcryptsetup12 2:2.1.0-5 amd64 +libcryptsetup12 2:2.1.0-5+deb10u2 amd64 -libexpat1 2.2.6-2 amd64 -libext2fs2 1.44.5-1 amd64 +libexpat1 2.2.6-2+deb10u1 amd64 +libext2fs2 1.44.5-1+deb10u1 amd64 -libglib2.0-0 2.58.3-2 amd64 +libglib2.0-0 2.58.3-2+deb10u1 amd64 -libldap-2.4-2 2.4.47+dfsg-3 amd64 -libldap-common 2.4.47+dfsg-3 all +libldap-2.4-2 2.4.47+dfsg-3+deb10u1 amd64 +libldap-common 2.4.47+dfsg-3+deb10u1 all -libmariadb3 1:10.3.15-1 amd64 +libmariadb3 1:10.3.17-0+deb10u1 amd64 -libncurses5 6.1+20181013-2 amd64 -libncurses6 6.1+20181013-2 amd64 -libncursesw5 6.1+20181013-2 amd64 -libncursesw6 6.1+20181013-2 amd64 +libncurses5 6.1+20181013-2+deb10u1 amd64 +libncurses6 6.1+20181013-2+deb10u1 amd64 +libncursesw5 6.1+20181013-2+deb10u1 amd64 +libncursesw6 6.1+20181013-2+deb10u1 amd64 -libpam-systemd 241-5 amd64 +libpam-systemd 241-7~deb10u1 amd64 -libss2 1.44.5-1 amd64 +libss2 1.44.5-1+deb10u1 amd64 -libsystemd0 241-5 amd64 +libsystemd0 241-7~deb10u1 amd64 -libtinfo5 6.1+20181013-2 amd64 -libtinfo6 6.1+20181013-2 amd64 +libtinfo5 6.1+20181013-2+deb10u1 amd64 +libtinfo6 6.1+20181013-2+deb10u1 amd64 -libudev1 241-5 amd64 +libudev1 241-7~deb10u1 amd64 +linux-image-4.19.0-6-amd64 4.19.67-2+deb10u1 amd64 -linux-image-amd64 4.19+105 amd64 +linux-image-amd64 4.19+105+deb10u1 amd64 -mariadb-common 1:10.3.15-1 all +mariadb-common 1:10.3.17-0+deb10u1 all -ncurses-base 6.1+20181013-2 all -ncurses-bin 6.1+20181013-2 amd64 -ncurses-term 6.1+20181013-2 all +ncurses-base 6.1+20181013-2+deb10u1 all +ncurses-bin 6.1+20181013-2+deb10u1 amd64 +ncurses-term 6.1+20181013-2+deb10u1 all -systemd 241-5 amd64 -systemd-sysv 241-5 amd64 +systemd 241-7~deb10u1 amd64 +systemd-sysv 241-7~deb10u1 amd64 -tzdata 2019b-0+deb10u1 all +tzdata 2019c-0+deb10u1 all -udev 241-5 amd64 +udev 241-7~deb10u1 amd64 -unzip 6.0-23 amd64 -usb.ids 2019.04.23-1 all +unzip 6.0-23+deb10u1 amd64 +usb.ids 2019.07.27-0+deb10u1 all -vim-icinga2 2.10.5-1.buster all +vim-icinga2 2.11.0-2.buster all --- .etckeeper | 92 ++++++++++++++++++-- apt/apt.conf.d/01autoremove-kernels | 60 ++++++------- debian_version | 2 +- icinga2/conf.d/hosts.conf | 2 +- icinga2/conf.d/notifications.conf | 2 +- icinga2/conf.d/services.conf | 2 +- icinga2/scripts/mail-host-notification.sh | 28 +++--- icinga2/scripts/mail-service-notification.sh | 26 +++--- 8 files changed, 150 insertions(+), 64 deletions(-) diff --git a/.etckeeper b/.etckeeper index 83b8d37..5353a47 100755 --- a/.etckeeper +++ b/.etckeeper @@ -718,44 +718,118 @@ maybe chmod 0644 'hosts.deny' 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/satellite.conf' +maybe chgrp 'nagios' 'icinga2/conf.d/satellite.conf' maybe chmod 0644 'icinga2/conf.d/satellite.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 chown 'nagios' 'icinga2/constants.conf' +maybe chgrp 'nagios' 'icinga2/constants.conf' +maybe chmod 0640 'icinga2/constants.conf' maybe chmod 0644 'icinga2/constants.conf.orig' -maybe chmod 0755 'icinga2/features-available' +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/api.conf.bak.2017-10-13' +maybe chgrp 'nagios' 'icinga2/features-available/api.conf.bak.2017-10-13' maybe chmod 0644 'icinga2/features-available/api.conf.bak.2017-10-13' +maybe chown 'nagios' 'icinga2/features-available/api.conf.orig.2017-10-13' +maybe chgrp 'nagios' 'icinga2/features-available/api.conf.orig.2017-10-13' maybe chmod 0644 'icinga2/features-available/api.conf.orig.2017-10-13' +maybe chown 'nagios' 'icinga2/features-available/api.conf.orig.2017-11-16' +maybe chgrp 'nagios' 'icinga2/features-available/api.conf.orig.2017-11-16' maybe chmod 0644 'icinga2/features-available/api.conf.orig.2017-11-16' +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' @@ -777,9 +851,13 @@ maybe chmod 0644 'icinga2/repository.d/README' 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 chown 'nagios' 'icinga2/zones.conf' +maybe chgrp 'nagios' 'icinga2/zones.conf' +maybe chmod 0640 'icinga2/zones.conf' maybe chmod 0644 'icinga2/zones.conf.orig' -maybe chmod 0755 'icinga2/zones.d' +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 chmod 0755 'init' maybe chmod 0755 'init.d' diff --git a/apt/apt.conf.d/01autoremove-kernels b/apt/apt.conf.d/01autoremove-kernels index 5353e8a..49b6fe2 100644 --- a/apt/apt.conf.d/01autoremove-kernels +++ b/apt/apt.conf.d/01autoremove-kernels @@ -2,64 +2,64 @@ APT::NeverAutoRemove { "^linux-image-4\.19\.0-5-amd64$"; - "^linux-image-4\.9\.0-9-amd64$"; + "^linux-image-4\.19\.0-6-amd64$"; "^linux-headers-4\.19\.0-5-amd64$"; - "^linux-headers-4\.9\.0-9-amd64$"; + "^linux-headers-4\.19\.0-6-amd64$"; "^linux-image-extra-4\.19\.0-5-amd64$"; - "^linux-image-extra-4\.9\.0-9-amd64$"; + "^linux-image-extra-4\.19\.0-6-amd64$"; "^linux-modules-4\.19\.0-5-amd64$"; - "^linux-modules-4\.9\.0-9-amd64$"; + "^linux-modules-4\.19\.0-6-amd64$"; "^linux-modules-extra-4\.19\.0-5-amd64$"; - "^linux-modules-extra-4\.9\.0-9-amd64$"; + "^linux-modules-extra-4\.19\.0-6-amd64$"; "^linux-signed-image-4\.19\.0-5-amd64$"; - "^linux-signed-image-4\.9\.0-9-amd64$"; + "^linux-signed-image-4\.19\.0-6-amd64$"; "^linux-image-unsigned-4\.19\.0-5-amd64$"; - "^linux-image-unsigned-4\.9\.0-9-amd64$"; + "^linux-image-unsigned-4\.19\.0-6-amd64$"; "^kfreebsd-image-4\.19\.0-5-amd64$"; - "^kfreebsd-image-4\.9\.0-9-amd64$"; + "^kfreebsd-image-4\.19\.0-6-amd64$"; "^kfreebsd-headers-4\.19\.0-5-amd64$"; - "^kfreebsd-headers-4\.9\.0-9-amd64$"; + "^kfreebsd-headers-4\.19\.0-6-amd64$"; "^gnumach-image-4\.19\.0-5-amd64$"; - "^gnumach-image-4\.9\.0-9-amd64$"; + "^gnumach-image-4\.19\.0-6-amd64$"; "^.*-modules-4\.19\.0-5-amd64$"; - "^.*-modules-4\.9\.0-9-amd64$"; + "^.*-modules-4\.19\.0-6-amd64$"; "^.*-kernel-4\.19\.0-5-amd64$"; - "^.*-kernel-4\.9\.0-9-amd64$"; + "^.*-kernel-4\.19\.0-6-amd64$"; "^linux-backports-modules-.*-4\.19\.0-5-amd64$"; - "^linux-backports-modules-.*-4\.9\.0-9-amd64$"; + "^linux-backports-modules-.*-4\.19\.0-6-amd64$"; "^linux-modules-.*-4\.19\.0-5-amd64$"; - "^linux-modules-.*-4\.9\.0-9-amd64$"; + "^linux-modules-.*-4\.19\.0-6-amd64$"; "^linux-tools-4\.19\.0-5-amd64$"; - "^linux-tools-4\.9\.0-9-amd64$"; + "^linux-tools-4\.19\.0-6-amd64$"; "^linux-cloud-tools-4\.19\.0-5-amd64$"; - "^linux-cloud-tools-4\.9\.0-9-amd64$"; + "^linux-cloud-tools-4\.19\.0-6-amd64$"; "^linux-buildinfo-4\.19\.0-5-amd64$"; - "^linux-buildinfo-4\.9\.0-9-amd64$"; + "^linux-buildinfo-4\.19\.0-6-amd64$"; "^linux-source-4\.19\.0-5-amd64$"; - "^linux-source-4\.9\.0-9-amd64$"; + "^linux-source-4\.19\.0-6-amd64$"; }; /* Debug information: # dpkg list: -iF linux-image-4.19.0-5-amd64 4.19.37-5+deb10u2 amd64 Linux 4.19 for 64-bit PCs (signed) -ii linux-image-4.9.0-8-amd64 4.9.144-3.1 amd64 Linux 4.9 for 64-bit PCs -ii linux-image-4.9.0-9-amd64 4.9.168-1+deb9u5 amd64 Linux 4.9 for 64-bit PCs -iU linux-image-amd64 4.19+105 amd64 Linux for 64-bit PCs (meta-package) +ii linux-image-4.19.0-5-amd64 4.19.37-5+deb10u2 amd64 Linux 4.19 for 64-bit PCs (signed) +iF linux-image-4.19.0-6-amd64 4.19.67-2+deb10u1 amd64 Linux 4.19 for 64-bit PCs (signed) +ii linux-image-4.9.0-9-amd64 4.9.168-1+deb9u5 amd64 Linux 4.9 for 64-bit PCs +iU linux-image-amd64 4.19+105+deb10u1 amd64 Linux for 64-bit PCs (meta-package) # list of installed kernel packages: 4.19.0-5-amd64 4.19.37-5+deb10u2 -4.9.0-8-amd64 4.9.144-3.1 +4.19.0-6-amd64 4.19.67-2+deb10u1 4.9.0-9-amd64 4.9.168-1+deb9u5 # list of different kernel versions: +4.19.67-2+deb10u1 4.19.37-5+deb10u2 4.9.168-1+deb9u5 -4.9.144-3.1 -# Installing kernel: 4.19.37-5+deb10u2 (4.19.0-5-amd64) -# Running kernel: 4.9.168-1+deb9u5 (4.9.0-9-amd64) -# Last kernel: 4.19.37-5+deb10u2 -# Previous kernel: 4.9.168-1+deb9u5 +# Installing kernel: 4.19.67-2+deb10u1 (4.19.0-6-amd64) +# Running kernel: 4.19.37-5+deb10u2 (4.19.0-5-amd64) +# Last kernel: 4.19.67-2+deb10u1 +# Previous kernel: 4.19.37-5+deb10u2 # Kernel versions list to keep: 4.19.37-5+deb10u2 -4.9.168-1+deb9u5 +4.19.67-2+deb10u1 # Kernel packages (version part) to protect: 4\.19\.0-5-amd64 -4\.9\.0-9-amd64 +4\.19\.0-6-amd64 */ diff --git a/debian_version b/debian_version index 2f52450..ae425d6 100644 --- a/debian_version +++ b/debian_version @@ -1 +1 @@ -10.0 +10.1 diff --git a/icinga2/conf.d/hosts.conf b/icinga2/conf.d/hosts.conf index 5ff1f9b..0118f03 100644 --- a/icinga2/conf.d/hosts.conf +++ b/icinga2/conf.d/hosts.conf @@ -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`. */ diff --git a/icinga2/conf.d/notifications.conf b/icinga2/conf.d/notifications.conf index 6a7e1f5..ac65875 100644 --- a/icinga2/conf.d/notifications.conf +++ b/icinga2/conf.d/notifications.conf @@ -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. diff --git a/icinga2/conf.d/services.conf b/icinga2/conf.d/services.conf index 416915b..c8e1b3c 100644 --- a/icinga2/conf.d/services.conf +++ b/icinga2/conf.d/services.conf @@ -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" diff --git a/icinga2/scripts/mail-host-notification.sh b/icinga2/scripts/mail-host-notification.sh index 781fee3..93f942e 100755 --- a/icinga2/scripts/mail-host-notification.sh +++ b/icinga2/scripts/mail-host-notification.sh @@ -1,7 +1,6 @@ -#!/usr/bin/env bash -# -# Copyright (C) 2012-2018 Icinga Development Team (https://icinga.com/) -# Except of function urlencode which is Copyright (C) by Brian White (brian@aljex.com) used under MIT license +#!/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,11 +50,14 @@ Error() { } urlencode() { - local LANG=C i c e='' - for ((i=0;i<${#1};i++)); do - c=${1:$i:1} - [[ "$c" =~ [a-zA-Z0-9\.\~\_\-] ]] || printf -v c '%%%02X' "'$c" - e+="$c" + 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" } @@ -155,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 diff --git a/icinga2/scripts/mail-service-notification.sh b/icinga2/scripts/mail-service-notification.sh index d4a1944..8ccb8d4 100755 --- a/icinga2/scripts/mail-service-notification.sh +++ b/icinga2/scripts/mail-service-notification.sh @@ -1,6 +1,5 @@ -#!/usr/bin/env bash -# -# Copyright (C) 2012-2018 Icinga Development Team (https://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`" @@ -53,11 +52,14 @@ Error() { } urlencode() { - local LANG=C i c e='' - for ((i=0;i<${#1};i++)); do - c=${1:$i:1} - [[ "$c" =~ [a-zA-Z0-9\.\~\_\-] ]] || printf -v c '%%%02X' "'$c" - e+="$c" + 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" } @@ -160,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 -- 2.39.5