AMBARI-15028. Critical alert for Kafka when using custom port(stack 2.3 and higher).(vbrodetskyi)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0a9a3aa5 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0a9a3aa5 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0a9a3aa5 Branch: refs/heads/branch-dev-patch-upgrade Commit: 0a9a3aa514f4859f2f4560fd3bd6c6036b173de8 Parents: b22aa2e Author: Vitaly Brodetskyi <vbrodets...@hortonworks.com> Authored: Fri Feb 12 03:10:15 2016 +0200 Committer: Vitaly Brodetskyi <vbrodets...@hortonworks.com> Committed: Fri Feb 12 03:10:15 2016 +0200 ---------------------------------------------------------------------- .../python/ambari_agent/alerts/port_alert.py | 2 +- .../stacks/HDP/2.3/services/KAFKA/alerts.json | 32 ++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/0a9a3aa5/ambari-agent/src/main/python/ambari_agent/alerts/port_alert.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/python/ambari_agent/alerts/port_alert.py b/ambari-agent/src/main/python/ambari_agent/alerts/port_alert.py index 848da65..92d28ad 100644 --- a/ambari-agent/src/main/python/ambari_agent/alerts/port_alert.py +++ b/ambari-agent/src/main/python/ambari_agent/alerts/port_alert.py @@ -102,7 +102,7 @@ class PortAlert(BaseAlert): host = BaseAlert.get_host_from_url(uri_value) - if host is None: + if host is None or host == "localhost" or host == "0.0.0.0": host = self.host_name try: http://git-wip-us.apache.org/repos/asf/ambari/blob/0a9a3aa5/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/alerts.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/alerts.json b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/alerts.json new file mode 100644 index 0000000..04fb583 --- /dev/null +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/alerts.json @@ -0,0 +1,32 @@ +{ + "KAFKA": { + "service": [], + "KAFKA_BROKER": [ + { + "name": "kafka_broker_process", + "label": "Kafka Broker Process", + "description": "This host-level alert is triggered if the Kafka Broker cannot be determined to be up.", + "interval": 1, + "scope": "HOST", + "source": { + "type": "PORT", + "uri": "{{kafka-broker/listeners}}", + "default_port": 6667, + "reporting": { + "ok": { + "text": "TCP OK - {0:.3f}s response on port {1}" + }, + "warning": { + "text": "TCP OK - {0:.3f}s response on port {1}", + "value": 1.5 + }, + "critical": { + "text": "Connection failed: {0} to {1}:{2}", + "value": 5.0 + } + } + } + } + ] + } +}