From 4946ba29c03f4b183a4e3a7e35ff5c3ac7eff18d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 12 Nov 2014 15:39:01 -0800 Subject: [PATCH] nagios: Disable the SSH checks on localhost The Nagios Docker container won't have SSH access enabled. The irregularity in tabs vs. spaces occurs upstream. --- nagios/Dockerfile.template | 2 ++ nagios/no-localhost-ssh.patch | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 nagios/no-localhost-ssh.patch diff --git a/nagios/Dockerfile.template b/nagios/Dockerfile.template index 73bcca7..d783125 100644 --- a/nagios/Dockerfile.template +++ b/nagios/Dockerfile.template @@ -46,6 +46,8 @@ RUN sed -i 's|\(authorized_for_configuration_information=.*\)|\1,guest|' /etc/na RUN sed -i 's|\(authorized_for_all_services=.*\)|\1,guest|' /etc/nagios/cgi.cfg RUN sed -i 's|\(authorized_for_all_hosts=.*\)|\1,guest|' /etc/nagios/cgi.cfg RUN sed -i 's|\(authorized_for_read_only=.*\)|\1,guest|' /etc/nagios/cgi.cfg +ADD no-localhost-ssh.patch /usr/local/share/no-localhost-ssh.patch +RUN patch -p1 < /usr/local/share/no-localhost-ssh.patch RUN mkdir /etc/nagios/cfg RUN chown nagios:nagios /etc/nagios/cfg RUN sed -i 's|\(#cfg_dir=/etc/nagios/routers.*\)|\1\ncfg_dir=/etc/nagios/cfg|' /etc/nagios/nagios.cfg diff --git a/nagios/no-localhost-ssh.patch b/nagios/no-localhost-ssh.patch new file mode 100644 index 0000000..e4e5387 --- /dev/null +++ b/nagios/no-localhost-ssh.patch @@ -0,0 +1,26 @@ +The Nagios Docker container won't have SSH access enabled. + +The irregularity in tabs vs. spaces occurs upstream. + +--- a/etc/nagios/objects/localhost.cfg ++++ b/etc/nagios/objects/localhost.cfg +@@ -131,19 +131,6 @@ + + + +-# Define a service to check SSH on the local machine. +-# Disable notifications for this service by default, as not all users may have SSH enabled. +- +-define service{ +- use local-service ; Name of service template to use +- host_name localhost +- service_description SSH +- check_command check_ssh +- notifications_enabled 0 +- } +- +- +- + # Define a service to check HTTP on the local machine. + # Disable notifications for this service by default, as not all users may have HTTP enabled. + -- 2.26.2