<commit_before>#
#
# 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.
#
#


# NAGIOS SERVER Check (status log update)
<%if scope.function_hdp_nagios_members_exist('nagios-server')-%>
define service {
        name                            hadoop-service
        use                             generic-service
        notification_options            w,u,c
        first_notification_delay        0
        notification_interval           0     # Send the notification once
}

define service {        
        hostgroup_name          nagios-server        
        use                     hadoop-service
        service_description     NAGIOS::Nagios status log staleness
        servicegroups           NAGIOS
        check_command           check_nagios!10!/var/nagios/status.dat!<%=scope.function_hdp_template_var("::hdp-nagios::server::config::nagios_lookup_daemon_str")%>
        normal_check_interval   5
        retry_check_interval    0.5
        max_check_attempts      2
}

# NAGIOS SERVER HDFS Checks
define service {
        hostgroup_name          nagios-server
        use                     hadoop-service
        service_description     HDFS::Percent DataNodes storage full
        servicegroups           HDFS
        check_command           check_aggregate!"DATANODE::DataNode storage full"!10%!30%
        normal_check_interval   2
        retry_check_interval    1 
        max_check_attempts      1
}

define service {
        hostgroup_name          nagios-server
        use                     hadoop-service
        service_description     HDFS::Percent DataNodes down
        servicegroups           HDFS
        check_command           check_aggregate!"DATANODE::DataNode process down"!10%!30%
        normal_check_interval   0.5
        retry_check_interval    0.25
        max_check_attempts      3
}

# NAGIOS SERVER MAPREDUCE Checks
define service {
        hostgroup_name          nagios-server
        use                     hadoop-service
        service_description     MAPREDUCE::Percent TaskTrackers down
        servicegroups           MAPREDUCE
        check_command           check_aggregate!"TASKTRACKER::TaskTracker process down"!10%!30%
        normal_check_interval   0.5
        retry_check_interval    0.25
        max_check_attempts      3
}

# AMBARI AGENT Checks
define service {
        hostgroup_name          agent-servers
        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 {
        hostgroup_name          nagios-server
        use                     hadoop-service
        service_description     ZOOKEEPER::Percent ZooKeeper Servers down
        servicegroups           ZOOKEEPER
        check_command           check_aggregate!"ZOOKEEPER::ZooKeeper Server process down"!35%!70%
        normal_check_interval   0.5
        retry_check_interval    0.25
        max_check_attempts      3
}
<%end-%>

# NAGIOS SERVER HBASE Checks
<%if scope.function_hdp_nagios_members_exist('hbasemasters')-%>
define service {
        hostgroup_name          nagios-server
        use                     hadoop-service
        service_description     HBASE::Percent RegionServers down
        servicegroups           HBASE
        check_command           check_aggregate!"REGIONSERVER::RegionServer process down"!10%!30%
        normal_check_interval   0.5
        retry_check_interval    0.25
        max_check_attempts      3
}
<%end-%>
<%end-%>



# GANGLIA SERVER Checks
<%if scope.function_hdp_nagios_members_exist('ganglia-server')-%>
define service {
        hostgroup_name          ganglia-server
        use                     hadoop-service
        service_description     GANGLIA::Ganglia [gmetad] process down
        servicegroups           GANGLIA
        check_command           check_tcp!<%=scope.function_hdp_template_var("::hdp::ganglia_port")%>!-w 1 -c 1
        normal_check_interval   0.25
        retry_check_interval    0.25
        max_check_attempts      4
}

define service {
        hostgroup_name          ganglia-server
        use                     hadoop-service
        service_description     GANGLIA::Ganglia Collector [gmond] process down alert for slaves
        servicegroups           GANGLIA
        check_command           check_tcp!<%=scope.function_hdp_template_var("::hdp::ganglia_collector_slaves_port")%>!-w 1 -c 1
        normal_check_interval   0.25
        retry_check_interval    0.25
        max_check_attempts      4
}

define service {
        hostgroup_name          ganglia-server
        use                     hadoop-service
        service_description     GANGLIA::Ganglia Collector [gmond] process down alert for NameNode
        servicegroups           GANGLIA
        check_command           check_tcp!<%=scope.function_hdp_template_var("::hdp::ganglia_collector_namenode_port")%>!-w 1 -c 1
        normal_check_interval   0.25
        retry_check_interval    0.25
        max_check_attempts      4
}

define service {
        hostgroup_name          ganglia-server
        use                     hadoop-service
        service_description     GANGLIA::Ganglia Collector [gmond] process down alert for JobTracker
        servicegroups           GANGLIA
        check_command           check_tcp!<%=scope.function_hdp_template_var("::hdp::ganglia_collector_jobtracker_port")%>!-w 1 -c 1
        normal_check_interval   0.25
        retry_check_interval    0.25
        max_check_attempts      4
}

<%if scope.function_hdp_nagios_members_exist('hbasemasters')-%>
define service {
        hostgroup_name          ganglia-server
        use                     hadoop-service
        service_description     GANGLIA::Ganglia Collector [gmond] process down alert for HBase Master
        servicegroups           GANGLIA
        check_command           check_tcp!<%=scope.function_hdp_template_var("::hdp::ganglia_collector_hbase_port")%>!-w 1 -c 1
        normal_check_interval   0.25
        retry_check_interval    0.25
        max_check_attempts      4
}
<%end-%>

<%if scope.function_hdp_nagios_members_exist('resorcemanager')-%>
define service {
        hostgroup_name          ganglia-server
        use                     hadoop-service
        service_description     GANGLIA::Ganglia Collector [gmond] process down alert for Resource Manager
        servicegroups           GANGLIA
        check_command           check_tcp!<%=scope.function_hdp_template_var("::hdp::ganglia_collector_rm_port")%>!-w 1 -c 1
        normal_check_interval   0.25
        retry_check_interval    0.25
        max_check_attempts      4
}
<%end-%>

<%if scope.function_hdp_nagios_members_exist('nodemanagers')-%><commit_msg>AMBARI-2781. Ambari with hdp 2.0.3 stack shows an alert : gmond process down for JobTracker. (<NAME> via smohanty)<commit_after>#
#
# 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.
#
#


# NAGIOS SERVER Check (status log update)
<%if scope.function_hdp_nagios_members_exist('nagios-server')-%>
define service {
        name                            hadoop-service
        use                             generic-service
        notification_options            w,u,c
        first_notification_delay        0
        notification_interval           0     # Send the notification once
}

define service {        
        hostgroup_name          nagios-server        
        use                     hadoop-service
        service_description     NAGIOS::Nagios status log staleness
        servicegroups           NAGIOS
        check_command           check_nagios!10!/var/nagios/status.dat!<%=scope.function_hdp_template_var("::hdp-nagios::server::config::nagios_lookup_daemon_str")%>
        normal_check_interval   5
        retry_check_interval    0.5
        max_check_attempts      2
}

# NAGIOS SERVER HDFS Checks
define service {
        hostgroup_name          nagios-server
        use                     hadoop-service
        service_description     HDFS::Percent DataNodes storage full
        servicegroups           HDFS
        check_command           check_aggregate!"DATANODE::DataNode storage full"!10%!30%
        normal_check_interval   2
        retry_check_interval    1 
        max_check_attempts      1
}

define service {
        hostgroup_name          nagios-server
        use                     hadoop-service
        service_description     HDFS::Percent DataNodes down
        servicegroups           HDFS
        check_command           check_aggregate!"DATANODE::DataNode process down"!10%!30%
        normal_check_interval   0.5
        retry_check_interval    0.25
        max_check_attempts      3
}

# NAGIOS SERVER MAPREDUCE Checks
define service {
        hostgroup_name          nagios-server
        use                     hadoop-service
        service_description     MAPREDUCE::Percent TaskTrackers down
        servicegroups           MAPREDUCE
        check_command           check_aggregate!"TASKTRACKER::TaskTracker process down"!10%!30%
        normal_check_interval   0.5
        retry_check_interval    0.25
        max_check_attempts      3
}

# AMBARI AGENT Checks
define service {
        hostgroup_name          agent-servers
        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 {
        hostgroup_name          nagios-server
        use                     hadoop-service
        service_description     ZOOKEEPER::Percent ZooKeeper Servers down
        servicegroups           ZOOKEEPER
        check_command           check_aggregate!"ZOOKEEPER::ZooKeeper Server process down"!35%!70%
        normal_check_interval   0.5
        retry_check_interval    0.25
        max_check_attempts      3
}
<%end-%>

# NAGIOS SERVER HBASE Checks
<%if scope.function_hdp_nagios_members_exist('hbasemasters')-%>
define service {
        hostgroup_name          nagios-server
        use                     hadoop-service
        service_description     HBASE::Percent RegionServers down
        servicegroups           HBASE
        check_command           check_aggregate!"REGIONSERVER::RegionServer process down"!10%!30%
        normal_check_interval   0.5
        retry_check_interval    0.25
        max_check_attempts      3
}
<%end-%>
<%end-%>



# GANGLIA SERVER Checks
<%if scope.function_hdp_nagios_members_exist('ganglia-server')-%>
define service {
        hostgroup_name          ganglia-server
        use                     hadoop-service
        service_description     GANGLIA::Ganglia [gmetad] process down
        servicegroups           GANGLIA
        check_command           check_tcp!<%=scope.function_hdp_template_var("::hdp::ganglia_port")%>!-w 1 -c 1
        normal_check_interval   0.25
        retry_check_interval    0.25
        max_check_attempts      4
}

define service {
        hostgroup_name          ganglia-server
        use                     hadoop-service
        service_description     GANGLIA::Ganglia Collector [gmond] process down alert for slaves
        servicegroups           GANGLIA
        check_command           check_tcp!<%=scope.function_hdp_template_var("::hdp::ganglia_collector_slaves_port")%>!-w 1 -c 1
        normal_check_interval   0.25
        retry_check_interval    0.25
        max_check_attempts      4
}

define service {
        hostgroup_name          ganglia-server
        use                     hadoop-service
        service_description     GANGLIA::Ganglia Collector [gmond] process down alert for NameNode
        servicegroups           GANGLIA
        check_command           check_tcp!<%=scope.function_hdp_template_var("::hdp::ganglia_collector_namenode_port")%>!-w 1 -c 1
        normal_check_interval   0.25
        retry_check_interval    0.25
        max_check_attempts      4
}

<%if scope.function_hdp_nagios_members_exist('jobtracker')-%>
define service {
        hostgroup_name          ganglia-server
        use                     hadoop-service
        service_description     GANGLIA::Ganglia Collector [gmond] process down alert for JobTracker
        servicegroups           GANGLIA
        check_command           check_tcp!<%=scope.function_hdp_template_var("::hdp::ganglia_collector_jobtracker_port")%>!-w 1 -c 1
        normal_check_interval   0.25
        retry_check_interval    0.25
        max_check_attempts      4
}
<%end-%>

<%if scope.function_hdp_nagios_members_exist('hbasemasters')-%>
define service {
        hostgroup_name          ganglia-server
        use                     hadoop-service
        service_description     GANGLIA::Ganglia Collector [gmond] process down alert for HBase Master
        servicegroups           GANGLIA
        check_command           check_tcp!<%=scope.function_hdp_template_var("::hdp::ganglia_collector_hbase_port")%>!-w 1 -c 1
        normal_check_interval   0.25
        retry_check_interval    0.25
        max_check_attempts      4
}
<%end-%>

<%if scope.function_hdp_nagios_members_exist('resorcemanager')-%>
define service {
        hostgroup_name          ganglia-server
        use                     hadoop-service
        service_description     GANGLIA::Ganglia Collector [gmond] process down alert for Resource Manager
        servicegroups           GANGLIA
        check_command           check_tcp!<%=scope.function_hdp_template_var("::hdp::ganglia_collector_rm_port")%>!-w 1 -c 1
        normal_check_interval   0.25
        retry_check_interval    0.25
        max_check_attempts      4
}
<%end-%>

<%if scope.function_hdp_nagios_members_exist('nodemanagers')-%>
{'fraction_non_alphanumeric': 0.06006908904810645, 'fraction_numerical': 0.015417093142272261, 'mean_word_length': 2.133493686109441, 'pattern_counts': {'":': 14, '<': 44, '<?xml version=': 0, '>': 44, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6892668', 'n_tokens_mistral': 4602, 'n_tokens_neox': 4365, 'n_words': 1010}