Browse Source

AMBARI-4778. Nagios reports a Host as down when it is actually up.(vbrodetskyi)

Vitaly Brodetskyi 11 years ago
parent
commit
d6d048d4a7

+ 8 - 7
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/hadoop-hosts.cfg.j2

@@ -18,13 +18,14 @@
 #
 {% for host in all_hosts %}
 define host {
-        alias        {{host}}
-        host_name    {{host}}
-        use          linux-server
-        address      {{host}}
-        check_interval         0.25
-        retry_interval         0.25
-        max_check_attempts     4
+        alias                     {{host}}
+        host_name                 {{host}}
+        use                       linux-server
+        address                   {{host}}
+        check_command             check_tcp_wrapper!{{all_ping_ports[loop.index-1]}}!-w 1 -c 1
+        check_interval            0.25
+        retry_interval            0.25
+        max_check_attempts        4
         notifications_enabled     1
         first_notification_delay  0     # Send notification soon after change in the hard state
         notification_interval     0     # Send the notification once

+ 26 - 7
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-hosts.cfg.j2

@@ -1,12 +1,31 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#
 {% for host in all_hosts %}
 define host {
-        alias        {{host}}
-        host_name    {{host}}
-        use          linux-server
-        address      {{host}}
-        check_interval         0.25
-        retry_interval         0.25
-        max_check_attempts     4
+        alias                     {{host}}
+        host_name                 {{host}}
+        use                       linux-server
+        address                   {{host}}
+        check_command             check_tcp_wrapper!{{all_ping_ports[loop.index-1]}}!-w 1 -c 1
+        check_interval            0.25
+        retry_interval            0.25
+        max_check_attempts        4
         notifications_enabled     1
         first_notification_delay  0     # Send notification soon after change in the hard state
         notification_interval     0     # Send the notification once