Browse Source

AMBARI-4947. Change Hive alerts to move away from Hive metadata queries to port checks.(vbrodetskyi)

Vitaly Brodetskyi 11 years ago
parent
commit
c6f9ff7826

+ 3 - 0
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/files/check_wrapper.sh

@@ -20,6 +20,9 @@ function real_component() {
     HIVE-METASTORE)
       realCompName="HIVE_METASTORE"
     ;;
+    HIVE-SERVER)
+      realCompName="HIVE_SERVER"
+    ;;
     FLUME)
       realCompName="FLUME_SERVER"
     ;;

+ 1 - 0
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/scripts/params.py

@@ -63,6 +63,7 @@ journalnode_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.
 datanode_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.datanode.http.address'])
 flume_port = "4159"
 hive_metastore_port = config['configurations']['global']['hive_metastore_port'] #"9083"
+hive_server_port = "10000"
 templeton_port = config['configurations']['webhcat-site']['templeton.port'] #"50111"
 hbase_rs_port = "60030"
 

+ 14 - 6
ambari-server/src/main/resources/stacks/HDP/1.3.2/services/NAGIOS/package/templates/hadoop-services.cfg.j2

@@ -662,13 +662,21 @@ define service {
 define service {
         hostgroup_name          hiveserver
         use                     hadoop-service
-        service_description     HIVE-METASTORE::Hive Metastore status
+        service_description     HIVE-METASTORE::Hive Metastore process
         servicegroups           HIVE
-        {% if security_enabled %}
-        check_command           check_hive_metastore_status!{{ hive_metastore_port }}!{{ java64_home }}!true!{{ nagios_keytab_path }}!{{ nagios_principal_name }}!{{ kinit_path_local }}
-        {% else %}
-        check_command           check_hive_metastore_status!{{ hive_metastore_port }}!{{ java64_home }}!false
-        {% endif %}
+        check_command           check_tcp_wrapper!{{ hive_metastore_port }}!-w 1 -c 1
+        normal_check_interval   0.5
+        retry_check_interval    0.5
+        max_check_attempts      3
+}
+
+# HIVE Server check
+define service {
+        hostgroup_name          hiveserver
+        use                     hadoop-service
+        service_description     HIVE-SERVER::HiveServer2 process
+        servicegroups           HIVE
+        check_command           check_tcp_wrapper!{{ hive_server_port }}!-w 1 -c 1
         normal_check_interval   0.5
         retry_check_interval    0.5
         max_check_attempts      3

+ 3 - 0
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/files/check_wrapper.sh

@@ -23,6 +23,9 @@ function real_component() {
     HIVE-METASTORE)
       realCompName="HIVE_METASTORE"
     ;;
+    HIVE-SERVER)
+      realCompName="HIVE_SERVER"
+    ;;
     FLUME)
       realCompName="FLUME_SERVER"
     ;;

+ 1 - 0
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/scripts/params.py

@@ -63,6 +63,7 @@ journalnode_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.
 datanode_port = get_port_from_url(config['configurations']['hdfs-site']['dfs.datanode.http.address'])
 flume_port = "4159"
 hive_metastore_port = config['configurations']['global']['hive_metastore_port'] #"9083"
+hive_server_port = "10000"
 templeton_port = config['configurations']['webhcat-site']['templeton.port'] #"50111"
 hbase_rs_port = "60030"
 storm_ui_port = config['configurations']['storm-site']['ui.port']

+ 14 - 6
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/NAGIOS/package/templates/hadoop-services.cfg.j2

@@ -702,13 +702,21 @@ define service {
 define service {
         hostgroup_name          hiveserver
         use                     hadoop-service
-        service_description     HIVE-METASTORE::Hive Metastore status
+        service_description     HIVE-METASTORE::Hive Metastore process
         servicegroups           HIVE
-        {% if security_enabled %}
-        check_command           check_hive_metastore_status!{{ hive_metastore_port }}!{{ java64_home }}!true!{{ nagios_keytab_path }}!{{ nagios_principal_name }}!{{ kinit_path_local }}
-        {% else %}
-        check_command           check_hive_metastore_status!{{ hive_metastore_port }}!{{ java64_home }}!false
-        {% endif %}
+        check_command           check_tcp_wrapper!{{ hive_metastore_port }}!-w 1 -c 1
+        normal_check_interval   0.5
+        retry_check_interval    0.5
+        max_check_attempts      3
+}
+
+# HIVE Server check
+define service {
+        hostgroup_name          hiveserver
+        use                     hadoop-service
+        service_description     HIVE-SERVER::HiveServer2 process
+        servicegroups           HIVE
+        check_command           check_tcp_wrapper!{{ hive_server_port }}!-w 1 -c 1
         normal_check_interval   0.5
         retry_check_interval    0.5
         max_check_attempts      3

+ 1 - 0
contrib/addons/src/addOns/nagios/scripts/nagios_alerts.php

@@ -380,6 +380,7 @@ function hdp_mon_generate_response( $response_data )
         $pieces[0] = "HBASE";
         break;
       case "HIVE-METASTORE":
+      case "HIVE-SERVER":
         $pieces[0] = "HIVE";
         break;
       case "ZKSERVERS":