incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject svn commit: r1461316 - in /incubator/ambari/trunk: ./ ambari-agent/src/main/puppet/modules/hdp-nagios/files/ ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server/ ambari-agent/src/main/puppet/modules/hdp-nagios/templates/ contrib/addons/src...
Date Tue, 26 Mar 2013 21:11:03 GMT
Author: smohanty
Date: Tue Mar 26 21:11:02 2013
New Revision: 1461316

URL: http://svn.apache.org/r1461316
Log:
AMBARI-1533. Add Nagios check for ambari-agent process for each host in the cluster. (smohanty)

Added:
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_ambari_agent_status.sh
Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server/config.pp
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-commands.cfg.erb
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-servicegroups.cfg.erb
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-services.cfg.erb
    incubator/ambari/trunk/contrib/addons/src/addOns/nagios/scripts/nagios_alerts.php

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1461316&r1=1461315&r2=1461316&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Tue Mar 26 21:11:02 2013
@@ -527,6 +527,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1533. Add Nagios check for ambari-agent process for each host in 
+ the cluster. (smohanty)
+
  AMBARI-1713. Need to delete private ssh key from /var/run/ambari-server
  /bootstrap/* on Ambari Server after bootstrap is complete. (swagle)
 

Added: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_ambari_agent_status.sh
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_ambari_agent_status.sh?rev=1461316&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_ambari_agent_status.sh
(added)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_ambari_agent_status.sh
Tue Mar 26 21:11:02 2013
@@ -0,0 +1,39 @@
+#!/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

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server/config.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server/config.pp?rev=1461316&r1=1461315&r2=1461316&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server/config.pp
(original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server/config.pp
Tue Mar 26 21:11:02 2013
@@ -44,6 +44,7 @@ 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': }
 
   anchor{'hdp-nagios::server::config::begin':} -> Hdp-nagios::Server::Configfile<||>
-> anchor{'hdp-nagios::server::config::end':}
   Anchor['hdp-nagios::server::config::begin'] -> Hdp-nagios::Server::Check<||> ->
Anchor['hdp-nagios::server::config::end']

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-commands.cfg.erb
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-commands.cfg.erb?rev=1461316&r1=1461315&r2=1461316&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-commands.cfg.erb
(original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-commands.cfg.erb
Tue Mar 26 21:11:02 2013
@@ -83,3 +83,7 @@ define command{
         command_name    check_hive_metastore_status
         command_line    $USER1$/check_hive_metastore_status.sh $HOSTADDRESS$ $ARG1$ $ARG2$
$ARG3$ $ARG4$ $ARG5$
        }
+define command{
+        command_name    check_ambari_agent_status
+        command_line    $USER1$/check_ambari_agent_status.sh
+       }

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-servicegroups.cfg.erb
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-servicegroups.cfg.erb?rev=1461316&r1=1461315&r2=1461316&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-servicegroups.cfg.erb
(original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-servicegroups.cfg.erb
Tue Mar 26 21:11:02 2013
@@ -34,3 +34,7 @@ define servicegroup {
   servicegroup_name  ZOOKEEPER
   alias  ZOOKEEPER Checks
 }
+define servicegroup {
+  servicegroup_name  AMBARI
+  alias  AMBARI Checks
+}
\ No newline at end of file

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-services.cfg.erb
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-services.cfg.erb?rev=1461316&r1=1461315&r2=1461316&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-services.cfg.erb
(original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/templates/hadoop-services.cfg.erb
Tue Mar 26 21:11:02 2013
@@ -76,6 +76,18 @@ define service {
         max_check_attempts      3
 }
 
+# AMBARI AGENT Checks
+define service {
+        hostgroup_name          nagios-server
+        use                     hadoop-service
+        service_description     AMBARI::Check ambari-agent process
+        servicegroups           AMBARI
+        check_command           check_ambari_agent_status
+        normal_check_interval   5
+        retry_check_interval    0.5
+        max_check_attempts      2
+}
+
 # NAGIOS SERVER ZOOKEEPER Checks
 <%if scope.function_hdp_nagios_members_exist('zookeeper-servers')-%>
 define service {

Modified: incubator/ambari/trunk/contrib/addons/src/addOns/nagios/scripts/nagios_alerts.php
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/contrib/addons/src/addOns/nagios/scripts/nagios_alerts.php?rev=1461316&r1=1461315&r2=1461316&view=diff
==============================================================================
--- incubator/ambari/trunk/contrib/addons/src/addOns/nagios/scripts/nagios_alerts.php (original)
+++ incubator/ambari/trunk/contrib/addons/src/addOns/nagios/scripts/nagios_alerts.php Tue
Mar 26 21:11:02 2013
@@ -381,6 +381,9 @@ function hdp_mon_generate_response( $res
       case "ZKSERVERS":
 	    $pieces[0] = "ZOOKEEPER";
         break;
+      case "AMBARI":
+	    $pieces[0] = "AMBARI";
+      break;      
       case "NAGIOS":
       case "HDFS":
       case "MAPREDUCE":



Mime
View raw message