You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by od...@apache.org on 2013/10/02 16:17:56 UTC
git commit: AMBARI-3401. After Enabling HTTPS for Hadoop Web
Endpoints allerts are displayed,
that shouldn't be present.(Dmytro Shkvyra via odiachenko)
Updated Branches:
refs/heads/trunk 4a9ccf0c0 -> 6de666e53
AMBARI-3401. After Enabling HTTPS for Hadoop Web Endpoints allerts are displayed, that shouldn't be present.(Dmytro Shkvyra via odiachenko)
Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/6de666e5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/6de666e5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/6de666e5
Branch: refs/heads/trunk
Commit: 6de666e53610a9909b10f0d0b2d8b9b098329118
Parents: 4a9ccf0
Author: Oleksandr Diachenko <od...@hortonworks.com>
Authored: Wed Oct 2 17:17:30 2013 +0300
Committer: Oleksandr Diachenko <od...@hortonworks.com>
Committed: Wed Oct 2 17:17:40 2013 +0300
----------------------------------------------------------------------
.../hdp-nagios/files/check_datanode_storage.php | 43 +++++++++++++++++--
.../hdp-nagios/files/check_hdfs_blocks.php | 45 ++++++++++++++++++--
.../hdp-nagios/files/check_hdfs_capacity.php | 44 +++++++++++++++++--
.../hdp-nagios/files/check_name_dir_status.php | 20 ++++++---
.../hdp-nagios/files/check_rpcq_latency.php | 45 ++++++++++++++++++--
.../hdp-nagios/files/hdp_nagios_init.php | 9 ++++
.../templates/hadoop-commands.cfg.erb | 10 ++---
.../templates/hadoop-services.cfg.erb | 16 +++----
.../main/puppet/modules/hdp/manifests/params.pp | 14 +++---
9 files changed, 209 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6de666e5/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_datanode_storage.php
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_datanode_storage.php b/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_datanode_storage.php
index 079d904..dee22b4 100644
--- a/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_datanode_storage.php
+++ b/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_datanode_storage.php
@@ -21,7 +21,9 @@
* check the storage capacity remaining on local datanode storage
*/
- $options = getopt ("h:p:w:c:");
+ include "hdp_nagios_init.php";
+
+ $options = getopt ("h:p:w:c:e:k:r:t:s:");
if (!array_key_exists('h', $options) || !array_key_exists('p', $options) || !array_key_exists('w', $options)
|| !array_key_exists('c', $options)) {
usage();
@@ -32,13 +34,48 @@
$port=$options['p'];
$warn=$options['w']; $warn = preg_replace('/%$/', '', $warn);
$crit=$options['c']; $crit = preg_replace('/%$/', '', $crit);
+ $keytab_path=$options['k'];
+ $principal_name=$options['r'];
+ $kinit_path_local=$options['t'];
+ $security_enabled=$options['s'];
+ $ssl_enabled=$options['e'];
+
+ /* Kinit if security enabled */
+ $status = kinit_if_needed($security_enabled, $kinit_path_local, $keytab_path, $principal_name);
+ $retcode = $status[0];
+ $output = $status[1];
+
+ if ($output != 0) {
+ echo "CRITICAL: Error doing kinit for nagios. $output";
+ exit (2);
+ }
+
+ $protocol = ($ssl_enabled == "true" ? "https" : "http");
/* Get the json document */
- $json_string = file_get_contents("http://".$host.":".$port."/jmx?qry=Hadoop:service=DataNode,name=FSDatasetState-DS-*");
+ $ch = curl_init();
+ $username = rtrim(`id -un`, "\n");
+ curl_setopt_array($ch, array( CURLOPT_URL => $protocol."://".$host.":".$port."/jmx?qry=Hadoop:service=DataNode,name=FSDatasetState-*",
+ CURLOPT_RETURNTRANSFER => true,
+ CURLOPT_HTTPAUTH => CURLAUTH_ANY,
+ CURLOPT_USERPWD => "$username:",
+ CURLOPT_SSL_VERIFYPEER => FALSE ));
+ $json_string = curl_exec($ch);
+ $info = curl_getinfo($ch);
+ if (intval($info['http_code']) == 401){
+ logout();
+ $json_string = curl_exec($ch);
+ }
+ $info = curl_getinfo($ch);
+ curl_close($ch);
$json_array = json_decode($json_string, true);
$object = $json_array['beans'][0];
$cap_remain = $object['Remaining']; /* Total capacity - any extenal files created in data directories by non-hadoop app */
$cap_total = $object['Capacity']; /* Capacity used by all data partitions minus space reserved for M/R */
+ if (count($object) == 0) {
+ echo "CRITICAL: Data inaccessible, Status code = ". $info['http_code'] ."\n";
+ exit(2);
+ }
$percent_full = ($cap_total - $cap_remain)/$cap_total * 100;
$out_msg = "Capacity:[" . $cap_total .
@@ -58,6 +95,6 @@
/* print usage */
function usage () {
- echo "Usage: $0 -h <host> -p port -w <warn%> -c <crit%>\n";
+ echo "Usage: $0 -h <host> -p port -w <warn%> -c <crit%> -k keytab path -r principal name -t kinit path -s security enabled -e ssl enabled\n";
}
?>
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6de666e5/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_hdfs_blocks.php
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_hdfs_blocks.php b/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_hdfs_blocks.php
index ed35e1a..19347b4 100644
--- a/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_hdfs_blocks.php
+++ b/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_hdfs_blocks.php
@@ -22,7 +22,9 @@
* check_jmx -H hostaddress -p port -w 1% -c 1%
*/
- $options = getopt ("h:p:w:c:s:");
+ include "hdp_nagios_init.php";
+
+ $options = getopt ("h:p:w:c:s:e:k:r:t:u:");
if (!array_key_exists('h', $options) || !array_key_exists('p', $options) || !array_key_exists('w', $options)
|| !array_key_exists('c', $options) || !array_key_exists('s', $options)) {
usage();
@@ -34,10 +36,43 @@
$warn=$options['w']; $warn = preg_replace('/%$/', '', $warn);
$crit=$options['c']; $crit = preg_replace('/%$/', '', $crit);
$nn_jmx_property=$options['s'];
+ $keytab_path=$options['k'];
+ $principal_name=$options['r'];
+ $kinit_path_local=$options['t'];
+ $security_enabled=$options['u'];
+ $ssl_enabled=$options['e'];
+
+ /* Kinit if security enabled */
+ $status = kinit_if_needed($security_enabled, $kinit_path_local, $keytab_path, $principal_name);
+ $retcode = $status[0];
+ $output = $status[1];
+
+ if ($output != 0) {
+ echo "CRITICAL: Error doing kinit for nagios. $output";
+ exit (2);
+ }
+
+ $protocol = ($ssl_enabled == "true" ? "https" : "http");
+
foreach (preg_split('/,/', $hosts) as $host) {
/* Get the json document */
- $json_string = file_get_contents("http://".$host.":".$port."/jmx?qry=Hadoop:service=NameNode,name=".$nn_jmx_property);
+
+ $ch = curl_init();
+ $username = rtrim(`id -un`, "\n");
+ curl_setopt_array($ch, array( CURLOPT_URL => $protocol."://".$host.":".$port."/jmx?qry=Hadoop:service=NameNode,name=".$nn_jmx_property,
+ CURLOPT_RETURNTRANSFER => true,
+ CURLOPT_HTTPAUTH => CURLAUTH_ANY,
+ CURLOPT_USERPWD => "$username:",
+ CURLOPT_SSL_VERIFYPEER => FALSE ));
+ $json_string = curl_exec($ch);
+ $info = curl_getinfo($ch);
+ if (intval($info['http_code']) == 401){
+ logout();
+ $json_string = curl_exec($ch);
+ }
+ $info = curl_getinfo($ch);
+ curl_close($ch);
$json_array = json_decode($json_string, true);
$m_percent = 0;
$c_percent = 0;
@@ -45,6 +80,10 @@
$missing_blocks = $object['MissingBlocks'];
$corrupt_blocks = $object['CorruptBlocks'];
$total_blocks = $object['BlocksTotal'];
+ if (count($object) == 0) {
+ echo "CRITICAL: Data inaccessible, Status code = ". $info['http_code'] ."\n";
+ exit(2);
+ }
if($total_blocks == 0) {
$m_percent = 0;
$c_percent = 0;
@@ -71,6 +110,6 @@
/* print usage */
function usage () {
- echo "Usage: $0 -h <host> -p port -w <warn%> -c <crit%> -s <namenode bean name>\n";
+ echo "Usage: $0 -h <host> -p port -w <warn%> -c <crit%> -s <namenode bean name> -k keytab path -r principal name -t kinit path -s security enabled -e ssl enabled\n";
}
?>
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6de666e5/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_hdfs_capacity.php
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_hdfs_capacity.php b/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_hdfs_capacity.php
index 5b25d0a..af72723 100644
--- a/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_hdfs_capacity.php
+++ b/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_hdfs_capacity.php
@@ -22,7 +22,9 @@
* check_jmx -H hostaddress -p port -w 1 -c 1
*/
- $options = getopt ("h:p:w:c:");
+ include "hdp_nagios_init.php";
+
+ $options = getopt ("h:p:w:c:e:k:r:t:s:");
if (!array_key_exists('h', $options) || !array_key_exists('p', $options) || !array_key_exists('w', $options)
|| !array_key_exists('c', $options)) {
usage();
@@ -33,15 +35,51 @@
$port=$options['p'];
$warn=$options['w']; $warn = preg_replace('/%$/', '', $warn);
$crit=$options['c']; $crit = preg_replace('/%$/', '', $crit);
+ $keytab_path=$options['k'];
+ $principal_name=$options['r'];
+ $kinit_path_local=$options['t'];
+ $security_enabled=$options['s'];
+ $ssl_enabled=$options['e'];
+
+ /* Kinit if security enabled */
+ $status = kinit_if_needed($security_enabled, $kinit_path_local, $keytab_path, $principal_name);
+ $retcode = $status[0];
+ $output = $status[1];
+
+ if ($output != 0) {
+ echo "CRITICAL: Error doing kinit for nagios. $output";
+ exit (2);
+ }
+
+ $protocol = ($ssl_enabled == "true" ? "https" : "http");
+
foreach (preg_split('/,/', $hosts) as $host) {
/* Get the json document */
- $json_string = file_get_contents("http://".$host.":".$port."/jmx?qry=Hadoop:service=NameNode,name=FSNamesystemState");
+ $ch = curl_init();
+ $username = rtrim(`id -un`, "\n");
+ curl_setopt_array($ch, array( CURLOPT_URL => $protocol."://".$host.":".$port."/jmx?qry=Hadoop:service=NameNode,name=FSNamesystemState",
+ CURLOPT_RETURNTRANSFER => true,
+ CURLOPT_HTTPAUTH => CURLAUTH_ANY,
+ CURLOPT_USERPWD => "$username:",
+ CURLOPT_SSL_VERIFYPEER => FALSE ));
+ $json_string = curl_exec($ch);
+ $info = curl_getinfo($ch);
+ if (intval($info['http_code']) == 401){
+ logout();
+ $json_string = curl_exec($ch);
+ }
+ $info = curl_getinfo($ch);
+ curl_close($ch);
$json_array = json_decode($json_string, true);
$percent = 0;
$object = $json_array['beans'][0];
$CapacityUsed = $object['CapacityUsed'];
$CapacityRemaining = $object['CapacityRemaining'];
+ if (count($object) == 0) {
+ echo "CRITICAL: Data inaccessible, Status code = ". $info['http_code'] ."\n";
+ exit(2);
+ }
$CapacityTotal = $CapacityUsed + $CapacityRemaining;
if($CapacityTotal == 0) {
$percent = 0;
@@ -66,6 +104,6 @@
/* print usage */
function usage () {
- echo "Usage: $0 -h <host> -p port -w <warn%> -c <crit%>\n";
+ echo "Usage: $0 -h <host> -p port -w <warn%> -c <crit%> -k keytab path -r principal name -t kinit path -s security enabled -e ssl enabled\n";
}
?>
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6de666e5/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_name_dir_status.php
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_name_dir_status.php b/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_name_dir_status.php
index a60fca8..186166d 100644
--- a/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_name_dir_status.php
+++ b/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_name_dir_status.php
@@ -24,7 +24,7 @@
include "hdp_nagios_init.php";
- $options = getopt("h:p:k::r::t::s::");
+ $options = getopt("h:p:e:k:r:t:s:");
//Check only for mandatory options
if (!array_key_exists('h', $options) || !array_key_exists('p', $options)) {
usage();
@@ -37,6 +37,7 @@
$principal_name=$options['r'];
$kinit_path_local=$options['t'];
$security_enabled=$options['s'];
+ $ssl_enabled=$options['e'];
/* Kinit if security enabled */
$status = kinit_if_needed($security_enabled, $kinit_path_local, $keytab_path, $principal_name);
@@ -48,19 +49,28 @@
exit (2);
}
+ $protocol = ($ssl_enabled == "true" ? "https" : "http");
+
/* Get the json document */
$ch = curl_init();
$username = rtrim(`id -un`, "\n");
- curl_setopt_array($ch, array( CURLOPT_URL => "http://".$host.":".$port."/jmx?qry=Hadoop:service=NameNode,name=NameNodeInfo",
+ curl_setopt_array($ch, array( CURLOPT_URL => $protocol."://".$host.":".$port."/jmx?qry=Hadoop:service=NameNode,name=NameNodeInfo",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPAUTH => CURLAUTH_ANY,
- CURLOPT_USERPWD => "$username:" ));
+ CURLOPT_USERPWD => "$username:",
+ CURLOPT_SSL_VERIFYPEER => FALSE ));
$json_string = curl_exec($ch);
+ $info = curl_getinfo($ch);
+ if (intval($info['http_code']) == 401){
+ logout();
+ $json_string = curl_exec($ch);
+ }
+ $info = curl_getinfo($ch);
curl_close($ch);
$json_array = json_decode($json_string, true);
$object = $json_array['beans'][0];
if ($object['NameDirStatuses'] == "") {
- echo "WARNING: NameNode directory status not available via http://".$host.":".$port."/jmx url" . "\n";
+ echo "WARNING: NameNode directory status not available via ".$protocol."://".$host.":".$port."/jmx url, code " . $info['http_code'] ."\n";
exit(1);
}
$NameDirStatuses = json_decode($object['NameDirStatuses'], true);
@@ -78,6 +88,6 @@
/* print usage */
function usage () {
- echo "Usage: $0 -h <host> -p port -k keytab path -r principal name -t kinit path -s security enabled";
+ echo "Usage: $0 -h <host> -p port -k keytab path -r principal name -t kinit path -s security enabled -e ssl enabled";
}
?>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6de666e5/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_rpcq_latency.php
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_rpcq_latency.php b/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_rpcq_latency.php
index 6d12bf8..463f69b 100644
--- a/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_rpcq_latency.php
+++ b/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_rpcq_latency.php
@@ -24,7 +24,9 @@
* Service Name = JobTracker, NameNode, JobHistoryServer
*/
- $options = getopt ("h:p:w:c:n:");
+ include "hdp_nagios_init.php";
+
+ $options = getopt ("h:p:w:c:n:e:k:r:t:s:");
if (!array_key_exists('h', $options) || !array_key_exists('p', $options) || !array_key_exists('w', $options)
|| !array_key_exists('c', $options) || !array_key_exists('n', $options)) {
usage();
@@ -36,12 +38,47 @@
$master=$options['n'];
$warn=$options['w'];
$crit=$options['c'];
+ $keytab_path=$options['k'];
+ $principal_name=$options['r'];
+ $kinit_path_local=$options['t'];
+ $security_enabled=$options['s'];
+ $ssl_enabled=$options['e'];
+
+ /* Kinit if security enabled */
+ $status = kinit_if_needed($security_enabled, $kinit_path_local, $keytab_path, $principal_name);
+ $retcode = $status[0];
+ $output = $status[1];
+
+ if ($output != 0) {
+ echo "CRITICAL: Error doing kinit for nagios. $output";
+ exit (2);
+ }
+
+ $protocol = ($ssl_enabled == "true" ? "https" : "http");
+
/* Get the json document */
- $json_string = file_get_contents("http://".$host.":".$port."/jmx?qry=Hadoop:service=".$master.",name=RpcActivityForPort*");
+ $ch = curl_init();
+ $username = rtrim(`id -un`, "\n");
+ curl_setopt_array($ch, array( CURLOPT_URL => $protocol."://".$host.":".$port."/jmx?qry=Hadoop:service=".$master.",name=RpcActivityForPort*",
+ CURLOPT_RETURNTRANSFER => true,
+ CURLOPT_HTTPAUTH => CURLAUTH_ANY,
+ CURLOPT_USERPWD => "$username:",
+ CURLOPT_SSL_VERIFYPEER => FALSE ));
+ $json_string = curl_exec($ch);
+ $info = curl_getinfo($ch);
+ if (intval($info['http_code']) == 401){
+ logout();
+ $json_string = curl_exec($ch);
+ }
+ $info = curl_getinfo($ch);
+ curl_close($ch);
$json_array = json_decode($json_string, true);
$object = $json_array['beans'][0];
-
+ if (count($object) == 0) {
+ echo "CRITICAL: Data inaccessible, Status code = ". $info['http_code'] ."\n";
+ exit(2);
+ }
$RpcQueueTime_avg_time = round($object['RpcQueueTime_avg_time'], 2);
$RpcProcessingTime_avg_time = round($object['RpcProcessingTime_avg_time'], 2);
@@ -62,6 +99,6 @@
/* print usage */
function usage () {
- echo "Usage: $0 -h <host> -p port -n <JobTracker/NameNode/JobHistoryServer> -w <warn_in_sec> -c <crit_in_sec>\n";
+ echo "Usage: $0 -h <host> -p port -n <JobTracker/NameNode/JobHistoryServer> -w <warn_in_sec> -c <crit_in_sec> -k keytab path -r principal name -t kinit path -s security enabled -e ssl enabled\n";
}
?>
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6de666e5/ambari-agent/src/main/puppet/modules/hdp-nagios/files/hdp_nagios_init.php
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-nagios/files/hdp_nagios_init.php b/ambari-agent/src/main/puppet/modules/hdp-nagios/files/hdp_nagios_init.php
index 55e4b2b..487eb43 100644
--- a/ambari-agent/src/main/puppet/modules/hdp-nagios/files/hdp_nagios_init.php
+++ b/ambari-agent/src/main/puppet/modules/hdp-nagios/files/hdp_nagios_init.php
@@ -68,5 +68,14 @@
return $status;
}
+
+ function logout() {
+ if (shell_exec("rm -f /tmp/krb5cc_".trim(shell_exec('id -u'))) == "" )
+ $status = true;
+ else
+ $status = false;
+
+ return $status;
+ }
?>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6de666e5/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 60e1d92..ca1585b 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
@@ -31,17 +31,17 @@ define command {
# Check data node storage full
define command {
command_name check_datanode_storage
- command_line php $USER1$/check_datanode_storage.php -h $HOSTADDRESS$ -p $ARG1$ -w $ARG2$ -c $ARG3$
+ command_line php $USER1$/check_datanode_storage.php -h $HOSTADDRESS$ -p $ARG1$ -w $ARG2$ -c $ARG3$ -e $ARG4$ -k $ARG5$ -r $ARG6$ -t $ARG7$ -s $ARG8$
}
define command{
command_name check_hdfs_blocks
- command_line php $USER1$/check_hdfs_blocks.php -h $ARG1$ -p $ARG2$ -w $ARG3$ -c $ARG4$ -s $ARG5$
+ command_line php $USER1$/check_hdfs_blocks.php -h $ARG1$ -p $ARG2$ -w $ARG3$ -c $ARG4$ -s $ARG5$ -e $ARG6$ -k $ARG7$ -r $ARG8$ -t $ARG9$ -u $ARG10$
}
define command{
command_name check_hdfs_capacity
- command_line php $USER1$/check_hdfs_capacity.php -h $ARG1$ -p $ARG2$ -w $ARG3$ -c $ARG4$
+ command_line php $USER1$/check_hdfs_capacity.php -h $ARG1$ -p $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$ -k $ARG6$ -r $ARG7$ -t $ARG8$ -s $ARG9$
}
define command{
@@ -51,7 +51,7 @@ define command{
define command{
command_name check_rpcq_latency
- command_line php $USER1$/check_rpcq_latency.php -h $HOSTADDRESS$ -p $ARG2$ -n $ARG1$ -w $ARG3$ -c $ARG4$
+ command_line php $USER1$/check_rpcq_latency.php -h $HOSTADDRESS$ -p $ARG2$ -n $ARG1$ -w $ARG3$ -c $ARG4$ -e $ARG5$ -k $ARG6$ -r $ARG7$ -t $ARG8$ -s $ARG9$
}
define command{
@@ -66,7 +66,7 @@ define command{
define command{
command_name check_name_dir_status
- command_line php $USER1$/check_name_dir_status.php -h $HOSTADDRESS$ -p $ARG1$ -k$ARG2$ -r$ARG3$ -t$ARG4$ -s$ARG5$
+ command_line php $USER1$/check_name_dir_status.php -h $HOSTADDRESS$ -p $ARG1$ -e $ARG2$ -k $ARG3$ -r $ARG4$ -t $ARG5$ -s $ARG6$
}
define command{
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6de666e5/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 6fe2c32..7facc0d 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
@@ -235,7 +235,7 @@ define service {
use hadoop-service
service_description NAMENODE::NameNode edit logs directory status on <%= namenode %>
servicegroups HDFS
- check_command check_name_dir_status!<%=scope.function_hdp_template_var("::hdp::namenode_port")%>!<%=scope.function_hdp_template_var("nagios_keytab_path")%>!<%=scope.function_hdp_template_var("nagios_principal_name")%>!<%=scope.function_hdp_template_var("kinit_path_local")%>!<%=scope.function_hdp_template_var("::hdp::params::security_enabled")%>
+ check_command check_name_dir_status!<%=scope.function_hdp_template_var("::hdp::namenode_port")%>!<%=scope.function_hdp_template_var("::hdp::params::hadoop_ssl_enabled")%>!<%=scope.function_hdp_template_var("nagios_keytab_path")%>!<%=scope.function_hdp_template_var("nagios_principal_name")%>!<%=scope.function_hdp_template_var("::hdp::params::kinit_path_local")%>!<%=scope.function_hdp_template_var("::hdp::params::security_enabled")%>
normal_check_interval 0.5
retry_check_interval 0.5
max_check_attempts 3
@@ -281,7 +281,7 @@ define service {
use hadoop-service
service_description HDFS::NameNode RPC latency on <%= namenode %>
servicegroups HDFS
- check_command check_rpcq_latency!NameNode!<%=scope.function_hdp_template_var("::hdp::namenode_port")%>!3000!5000
+ check_command check_rpcq_latency!NameNode!<%=scope.function_hdp_template_var("::hdp::namenode_port")%>!3000!5000!<%=scope.function_hdp_template_var("::hdp::params::hadoop_ssl_enabled")%>!<%=scope.function_hdp_template_var("nagios_keytab_path")%>!<%=scope.function_hdp_template_var("nagios_principal_name")%>!<%=scope.function_hdp_template_var("::hdp::params::kinit_path_local")%>!<%=scope.function_hdp_template_var("::hdp::params::security_enabled")%>
normal_check_interval 5
retry_check_interval 1
max_check_attempts 5
@@ -294,7 +294,7 @@ define service {
use hadoop-service
service_description HDFS::Blocks health
servicegroups HDFS
- check_command check_hdfs_blocks!$HOSTGROUPMEMBERS:namenode$!<%=scope.function_hdp_template_var("::hdp::namenode_port")%>!0%!0%!<%=scope.function_hdp_template_var("::hdp-nagios::params::nn_metrics_property")%>
+ check_command check_hdfs_blocks!$HOSTGROUPMEMBERS:namenode$!<%=scope.function_hdp_template_var("::hdp::namenode_port")%>!0%!0%!<%=scope.function_hdp_template_var("::hdp-nagios::params::nn_metrics_property")%>!<%=scope.function_hdp_template_var("::hdp::params::hadoop_ssl_enabled")%>!<%=scope.function_hdp_template_var("nagios_keytab_path")%>!<%=scope.function_hdp_template_var("nagios_principal_name")%>!<%=scope.function_hdp_template_var("::hdp::params::kinit_path_local")%>!<%=scope.function_hdp_template_var("::hdp::params::security_enabled")%>
normal_check_interval 2
retry_check_interval 1
max_check_attempts 1
@@ -305,7 +305,7 @@ define service {
use hadoop-service
service_description HDFS::HDFS capacity utilization
servicegroups HDFS
- check_command check_hdfs_capacity!$HOSTGROUPMEMBERS:namenode$!<%=scope.function_hdp_template_var("::hdp::namenode_port")%>!80%!90%
+ check_command check_hdfs_capacity!$HOSTGROUPMEMBERS:namenode$!<%=scope.function_hdp_template_var("::hdp::namenode_port")%>!80%!90%!<%=scope.function_hdp_template_var("::hdp::params::hadoop_ssl_enabled")%>!<%=scope.function_hdp_template_var("nagios_keytab_path")%>!<%=scope.function_hdp_template_var("nagios_principal_name")%>!<%=scope.function_hdp_template_var("::hdp::params::kinit_path_local")%>!<%=scope.function_hdp_template_var("::hdp::params::security_enabled")%>
normal_check_interval 10
retry_check_interval 1
max_check_attempts 1
@@ -366,7 +366,7 @@ define service {
use hadoop-service
service_description MAPREDUCE::JobTracker RPC latency
servicegroups MAPREDUCE
- check_command check_rpcq_latency!JobTracker!<%=scope.function_hdp_template_var("::hdp::jtnode_port")%>!3000!5000
+ check_command check_rpcq_latency!JobTracker!<%=scope.function_hdp_template_var("::hdp::jtnode_port")%>!3000!5000!<%=scope.function_hdp_template_var("::hdp::params::hadoop_ssl_enabled")%>!<%=scope.function_hdp_template_var("nagios_keytab_path")%>!<%=scope.function_hdp_template_var("nagios_principal_name")%>!<%=scope.function_hdp_template_var("::hdp::params::kinit_path_local")%>!<%=scope.function_hdp_template_var("::hdp::params::security_enabled")%>
normal_check_interval 5
retry_check_interval 1
max_check_attempts 5
@@ -442,7 +442,7 @@ define service {
use hadoop-service
service_description RESOURCEMANAGER::ResourceManager RPC latency
servicegroups YARN
- check_command check_rpcq_latency!ResorceManager!<%=scope.function_hdp_template_var("::hdp::rm_port")%>!3000!5000
+ check_command check_rpcq_latency!ResorceManager!<%=scope.function_hdp_template_var("::hdp::rm_port")%>!3000!5000!<%=scope.function_hdp_template_var("::hdp::params::hadoop_ssl_enabled")%>!<%=scope.function_hdp_template_var("nagios_keytab_path")%>!<%=scope.function_hdp_template_var("nagios_principal_name")%>!<%=scope.function_hdp_template_var("::hdp::params::kinit_path_local")%>!<%=scope.function_hdp_template_var("::hdp::params::security_enabled")%>
normal_check_interval 5
retry_check_interval 1
max_check_attempts 5
@@ -524,7 +524,7 @@ define service {
use hadoop-service
service_description JOBHISTORY::HistoryServer RPC latency
servicegroups MAPREDUCE
- check_command check_rpcq_latency!JobHistoryServer!<%=scope.function_hdp_template_var("::hdp::hs_port")%>!3000!5000
+ check_command check_rpcq_latency!JobHistoryServer!<%=scope.function_hdp_template_var("::hdp::hs_port")%>!3000!5000!<%=scope.function_hdp_template_var("::hdp::params::hadoop_ssl_enabled")%>!<%=scope.function_hdp_template_var("nagios_keytab_path")%>!<%=scope.function_hdp_template_var("nagios_principal_name")%>!<%=scope.function_hdp_template_var("::hdp::params::kinit_path_local")%>!<%=scope.function_hdp_template_var("::hdp::params::security_enabled")%>
normal_check_interval 5
retry_check_interval 1
max_check_attempts 5
@@ -588,7 +588,7 @@ define service {
use hadoop-service
service_description DATANODE::DataNode space
servicegroups HDFS
- check_command check_datanode_storage!<%=scope.function_hdp_template_var("::hdp::datanode_port")%>!90%!90%
+ check_command check_datanode_storage!<%=scope.function_hdp_template_var("::hdp::datanode_port")%>!90%!90%!<%=scope.function_hdp_template_var("::hdp::params::hadoop_ssl_enabled")%>!<%=scope.function_hdp_template_var("nagios_keytab_path")%>!<%=scope.function_hdp_template_var("nagios_principal_name")%>!<%=scope.function_hdp_template_var("::hdp::params::kinit_path_local")%>!<%=scope.function_hdp_template_var("::hdp::params::security_enabled")%>
normal_check_interval 5
retry_check_interval 1
max_check_attempts 2
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/6de666e5/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp b/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
index 9f40db2..5466484 100644
--- a/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
+++ b/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
@@ -40,12 +40,12 @@ class hdp::params()
}
## Stack version
- $stack_version = hdp_default("stack_version", "1.3.0")
- if (hdp_get_major_stack_version($hdp::params::stack_version) >= 2) {
- $isHadoop2Stack = true
- } else {
- $isHadoop2Stack = false
- }
+ $stack_version = hdp_default("stack_version", "1.3.0")
+ if (hdp_get_major_stack_version($hdp::params::stack_version) >= 2) {
+ $isHadoop2Stack = true
+ } else {
+ $isHadoop2Stack = false
+ }
##### global state defaults ####
$cluster_service_state = hdp_default("cluster_service_state","running")
@@ -63,6 +63,8 @@ class hdp::params()
default => false,
}
+ $hadoop_ssl_enabled = hdp_default("core-site/hadoop.ssl.enabled", false)
+
$kerberos_domain = hdp_default("kerberos_domain","EXAMPLE.COM")
$kinit_path_local = hdp_get_kinit_path(hdp_default("kinit_path_local"), "/usr/bin", "/usr/kerberos/bin", "/usr/sbin")
$keytab_path = hdp_default("keytab_path", "/etc/security/keytabs")