Updated Branches:
  refs/heads/trunk 69a97d479 -> 5f9b4e834

AMBARI-3200. Nagios alert for ambari shows critical even after agent is up 
(Vitaly Brodetskyi via dlysnichenko)


Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/5f9b4e83
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/5f9b4e83
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/5f9b4e83

Branch: refs/heads/trunk
Commit: 5f9b4e834dd3c493038989171541c157f153ba7c
Parents: 69a97d4
Author: Lisnichenko Dmitro <[email protected]>
Authored: Thu Sep 12 17:42:29 2013 +0300
Committer: Lisnichenko Dmitro <[email protected]>
Committed: Thu Sep 12 17:42:29 2013 +0300

----------------------------------------------------------------------
 ambari-agent/conf/unix/ambari-agent.ini         |  2 +-
 .../files/check_ambari_agent_status.sh          | 39 --------------------
 .../modules/hdp-nagios/manifests/params.pp      |  3 +-
 .../hdp-nagios/manifests/server/config.pp       |  1 -
 .../templates/hadoop-commands.cfg.erb           |  9 -----
 .../templates/hadoop-services.cfg.erb           | 27 ++++----------
 .../main/python/ambari_agent/AmbariConfig.py    |  2 +-
 7 files changed, 12 insertions(+), 71 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/5f9b4e83/ambari-agent/conf/unix/ambari-agent.ini
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/unix/ambari-agent.ini 
b/ambari-agent/conf/unix/ambari-agent.ini
index 243ff90..a6d7a65 100644
--- a/ambari-agent/conf/unix/ambari-agent.ini
+++ b/ambari-agent/conf/unix/ambari-agent.ini
@@ -23,7 +23,7 @@ prefix=/var/lib/ambari-agent/data
 loglevel=INFO
 data_cleanup_interval=86400
 data_cleanup_max_age=2592000
-ping_port=0
+ping_port=8670
 
 [stack]
 installprefix=/var/ambari-agent/

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/5f9b4e83/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_ambari_agent_status.sh
----------------------------------------------------------------------
diff --git 
a/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_ambari_agent_status.sh
 
b/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_ambari_agent_status.sh
deleted file mode 100644
index a8b510a..0000000
--- 
a/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_ambari_agent_status.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env bash
-#
-#
-# 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.
-#
-#
-AMBARI_AGENT_PID_PATH="/var/run/ambari-agent/ambari-agent.pid";
-RES="3";
-if [ -f $AMBARI_AGENT_PID_PATH ]
-then
-  RES=`cat $AMBARI_AGENT_PID_PATH | xargs ps -f -p | wc -l`;
-  AMBARI_AGENT_PID=`cat $AMBARI_AGENT_PID_PATH`; 
-else 
-  RES=-1; 
-fi
-
-if [ $RES -eq "2" ]
-then
-  echo "OK: Ambari Agent is running [PID:$AMBARI_AGENT_PID]";
-  exit 0;
-else
-  echo "CRITICAL: Ambari Agent is not running [$AMBARI_AGENT_PID_PATH not 
found]";
-  exit 2;
-fi
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/5f9b4e83/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/params.pp
----------------------------------------------------------------------
diff --git 
a/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/params.pp 
b/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/params.pp
index 2107899..0d811ba 100644
--- a/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/params.pp
+++ b/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/params.pp
@@ -92,6 +92,7 @@ class hdp-nagios::params() inherits hdp::params
     hue-server => {host_member_info => 'hue_server_host'},
     resourcemanager => {host_member_info => 'rm_host'},
     nodemanagers => {host_member_info => 'nm_hosts'},
-    historyserver2 => {host_member_info => 'hs_host'}
+    historyserver2 => {host_member_info => 'hs_host'},
+    journalnodes => {host_member_info => 'journalnode_hosts'}
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/5f9b4e83/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server/config.pp
----------------------------------------------------------------------
diff --git 
a/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server/config.pp 
b/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server/config.pp
index f013c58..9f1c44e 100644
--- a/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server/config.pp
+++ b/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server/config.pp
@@ -47,7 +47,6 @@ class hdp-nagios::server::config()
   hdp-nagios::server::check { 'check_oozie_status.sh': }
   hdp-nagios::server::check { 'check_templeton_status.sh': }
   hdp-nagios::server::check { 'check_hive_metastore_status.sh': }
-  hdp-nagios::server::check { 'check_ambari_agent_status.sh': }
   hdp-nagios::server::check { 'check_hue_status.sh': }
   hdp-nagios::server::check { 'check_mapred_local_dir_used.sh': }
   hdp-nagios::server::check { 'check_nodemanager_health.sh': }

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/5f9b4e83/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-commands.cfg.erb
----------------------------------------------------------------------
diff --git 
a/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-commands.cfg.erb
 
b/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-commands.cfg.erb
index f3aec98..6acaa39 100644
--- 
a/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-commands.cfg.erb
+++ 
b/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-commands.cfg.erb
@@ -84,10 +84,6 @@ define command{
         command_line    $USER1$/check_hive_metastore_status.sh $HOSTADDRESS$ 
$ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$
        }
 define command{
-        command_name    check_ambari_agent_status
-        command_line    $USER1$/check_ambari_agent_status.sh
-       }
-define command{
         command_name    check_hue_status
         command_line    $USER1$/check_hue_status.sh
        }
@@ -111,8 +107,3 @@ define command{
         command_name    check_resourcemanager_nodes_percentage
         command_line    $USER1$/check_resourcemanager_nodes_percentage.sh 
$HOSTADDRESS$ $ARG1$ $ARG2$ $ARG3$ $ARG4$
        }
-
-define command{
-       command_name    check_tcp_on_host
-       command_line    $USER1$/check_tcp -H $ARG1$ -p $ARG2$ $ARG3$
-       }

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/5f9b4e83/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-services.cfg.erb
----------------------------------------------------------------------
diff --git 
a/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-services.cfg.erb
 
b/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-services.cfg.erb
index 8a6a2e3..6f6a12d 100644
--- 
a/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-services.cfg.erb
+++ 
b/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-services.cfg.erb
@@ -79,24 +79,13 @@ define service {
 <%end-%>
 
 # AMBARI AGENT Checks
-define service {
-        hostgroup_name          agent-servers
-        use                     hadoop-service
-        service_description     AMBARI::Ambari Agent process
-        servicegroups           AMBARI
-        check_command           check_ambari_agent_status
-        normal_check_interval   5
-        retry_check_interval    0.5
-        max_check_attempts      2
-}
-
 <%scope.function_hdp_template_var("all_hosts").each_with_index do |hostname, 
index|-%>
 define service {
-        hostgroup_name          agent-servers
+        host_name              <%=hostname%>
         use                     hadoop-service
-        service_description     AMBARI::Ambari Agent process on <%=hostname%>
+        service_description     AMBARI::Ambari Agent process
         servicegroups           AMBARI
-        check_command           
check_tcp_on_host!<%=hostname%>!<%=scope.function_hdp_template_var("all_ping_ports")[index]%>!-w
 1 -c 1
+        check_command           
check_tcp!<%=scope.function_hdp_template_var("all_ping_ports")[index]%>!-w 1 -c 
1
         normal_check_interval   1
         retry_check_interval    0.25
         max_check_attempts      4
@@ -562,20 +551,20 @@ define service {
 
 <% end %>
 
+<%if scope.function_hdp_nagios_members_exist('journalnodes')-%>
 # Journalnode checks
-<%scope.function_hdp_template_var("::hdp::journalnode_hosts").each do 
|hostname|-%>
 define service {
-        hostgroup_name          slaves
+        hostgroup_name          journalnodes
         use                     hadoop-service
-        service_description     JOURNALNODE::JournalNode process on 
<%=hostname%>
+        service_description     JOURNALNODE::JournalNode process
         servicegroups           HDFS
-        check_command           
check_tcp_on_host!<%=hostname%>!<%=scope.function_hdp_template_var("::hdp::journalnode_port")%>!-w
 1 -c 1
+        check_command           
check_tcp!<%=scope.function_hdp_template_var("::hdp::journalnode_port")%>!-w 1 
-c 1
         normal_check_interval   1
         retry_check_interval    0.5
         max_check_attempts      3
 }
 
-<% end %>
+<%end-%>
 
 <%if scope.function_hdp_nagios_members_exist('slaves')-%>
 # HDFS::DATANODE Checks

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/5f9b4e83/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py 
b/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
index 0abfccb..a5010e3 100644
--- a/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
+++ b/ambari-agent/src/main/python/ambari_agent/AmbariConfig.py
@@ -33,7 +33,7 @@ secured_url_port=8441
 prefix=/tmp/ambari-agent
 data_cleanup_interval=86400
 data_cleanup_max_age=2592000
-ping_port=0
+ping_port=8670
 
 [services]
 

Reply via email to