ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [1/3] AMBARI-4153. Nagios on HDP1. Using resource management lib (aonishuk)
Date Tue, 24 Dec 2013 15:46:37 GMT
Updated Branches:
  refs/heads/trunk b3659b0f3 -> 95fb387b9


http://git-wip-us.apache.org/repos/asf/ambari/blob/95fb387b/ambari-server/src/main/resources/stacks/HDP/1.3._/services/NAGIOS/package/templates/nagios.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3._/services/NAGIOS/package/templates/nagios.j2
b/ambari-server/src/main/resources/stacks/HDP/1.3._/services/NAGIOS/package/templates/nagios.j2
new file mode 100644
index 0000000..01e21ac
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3._/services/NAGIOS/package/templates/nagios.j2
@@ -0,0 +1,146 @@
+#!/bin/sh
+# $Id$
+# Nagios	Startup script for the Nagios monitoring daemon
+#
+# chkconfig:	- 85 15
+# description:	Nagios is a service monitoring system
+# processname: nagios
+# config: /etc/nagios/nagios.cfg
+# pidfile: /var/nagios/nagios.pid
+#
+### BEGIN INIT INFO
+# Provides:		nagios
+# Required-Start:	$local_fs $syslog $network
+# Required-Stop:	$local_fs $syslog $network
+# Short-Description:    start and stop Nagios monitoring server
+# Description:		Nagios is is a service monitoring system 
+### END INIT INFO
+
+#
+#
+# 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.
+#
+#
+#
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+prefix="/usr"
+exec_prefix="/usr"
+exec="/usr/sbin/nagios"
+prog="nagios"
+config="/etc/nagios/nagios.cfg"
+pidfile="{{nagios_pid_file}}"
+user="{{nagios_user}}"
+
+[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+lockfile=/var/lock/subsys/$prog
+
+start() {
+    [ -x $exec ] || exit 5
+    [ -f $config ] || exit 6
+    echo -n $"Starting $prog: "
+    daemon --user=$user $exec -d $config
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && touch $lockfile
+    return $retval
+}
+
+stop() {
+    echo -n $"Stopping $prog: "
+    killproc -d 10 $exec
+    retval=$?
+    echo
+    [ $retval -eq 0 ] && rm -f $lockfile
+    return $retval
+}
+
+
+restart() {
+    stop
+    start
+}
+
+reload() {
+    echo -n $"Reloading $prog: "
+    killproc $exec -HUP
+    RETVAL=$?
+    echo
+}
+
+force_reload() {
+    restart
+}
+
+check_config() {
+        $nice runuser -s /bin/bash - $user -c "$corelimit >/dev/null 2>&1 ; $exec
-v $config > /dev/null 2>&1"
+        RETVAL=$?
+        if [ $RETVAL -ne 0 ] ; then
+                echo -n $"Configuration validation failed"
+                failure
+                echo
+                exit 1
+
+        fi
+}
+
+
+case "$1" in
+    start)
+        status $prog && exit 0
+	check_config
+        $1
+        ;;
+    stop)
+        status $prog|| exit 0
+        $1
+        ;;
+    restart)
+	check_config
+        $1
+        ;;
+    reload)
+        status $prog || exit 7
+	check_config
+        $1
+        ;;
+    force-reload)
+	check_config
+        force_reload
+        ;;
+    status)
+        status $prog
+        ;;
+    condrestart|try-restart)
+        status $prog|| exit 0
+	check_config
+        restart
+        ;;
+    configtest)
+        echo -n  $"Checking config for $prog: "
+        check_config && success
+        echo
+	;;
+    *)
+        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
+        exit 2
+esac
+exit $?

http://git-wip-us.apache.org/repos/asf/ambari/blob/95fb387b/ambari-server/src/main/resources/stacks/HDP/1.3._/services/NAGIOS/package/templates/resource.cfg.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3._/services/NAGIOS/package/templates/resource.cfg.j2
b/ambari-server/src/main/resources/stacks/HDP/1.3._/services/NAGIOS/package/templates/resource.cfg.j2
new file mode 100644
index 0000000..23c7a56
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3._/services/NAGIOS/package/templates/resource.cfg.j2
@@ -0,0 +1,33 @@
+###########################################################################
+#
+# RESOURCE.CFG - Sample Resource File for Nagios 3.2.3
+#
+# Last Modified: 09-10-2003
+#
+# You can define $USERx$ macros in this file, which can in turn be used
+# in command definitions in your host config file(s).  $USERx$ macros are
+# useful for storing sensitive information such as usernames, passwords,
+# etc.  They are also handy for specifying the path to plugins and
+# event handlers - if you decide to move the plugins or event handlers to
+# a different directory in the future, you can just update one or two
+# $USERx$ macros, instead of modifying a lot of command definitions.
+#
+# The CGIs will not attempt to read the contents of resource files, so
+# you can set restrictive permissions (600 or 660) on them.
+#
+# Nagios supports up to 32 $USERx$ macros ($USER1$ through $USER32$)
+#
+# Resource files may also be used to store configuration directives for
+# external data sources like MySQL...
+#
+###########################################################################
+
+# Sets $USER1$ to be the path to the plugins
+$USER1$={{plugins_dir}}
+
+# Sets $USER2$ to be the path to event handlers
+#$USER2$={{eventhandlers_dir}}
+
+# Store some usernames and passwords (hidden from the CGIs)
+#$USER3$=someuser
+#$USER4$=somepassword
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/95fb387b/ambari-server/src/main/resources/stacks/HDP/1.3._/services/SQOOP/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3._/services/SQOOP/package/scripts/service_check.py
b/ambari-server/src/main/resources/stacks/HDP/1.3._/services/SQOOP/package/scripts/service_check.py
index 107d012..b872be6 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3._/services/SQOOP/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3._/services/SQOOP/package/scripts/service_check.py
@@ -26,7 +26,7 @@ class SqoopServiceCheck(Script):
     import params
     env.set_params(params)
     if params.security_enabled:
-        Execute(format("{kinit_path_local}  -kt {smoke_user_keytab} {smoke_test_user}"))
+        Execute(format("{kinit_path_local}  -kt {smoke_user_keytab} {smokeuser}"))
     Execute("sqoop version",
             user = params.smokeuser,
             logoutput = True


Mime
View raw message