nagios: Disable the SSH checks on localhost
authorW. Trevor King <wking@tremily.us>
Wed, 12 Nov 2014 23:39:01 +0000 (15:39 -0800)
committerW. Trevor King <wking@tremily.us>
Fri, 14 Nov 2014 21:24:11 +0000 (13:24 -0800)
The Nagios Docker container won't have SSH access enabled.

The irregularity in tabs vs. spaces occurs upstream.

nagios/Dockerfile.template
nagios/no-localhost-ssh.patch [new file with mode: 0644]

index 73bcca7c615225cd2ba13777fc2c38f9546c0a01..d78312585eba198dcc02d95c78c9f077629adff3 100644 (file)
@@ -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 (file)
index 0000000..e4e5387
--- /dev/null
@@ -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.