Support Questions
Find answers, ask questions, and share your expertise

Ambari Flink service alert

New Contributor

Hi, I´m newbie with Hortonworks and I´m trying to understand it. I´m trying to make an alert for flink service health following but it doesn´t work. My definition:

{ "AlertDefinition" : { "service_name": "FLINK", "scope": "HOST", "enabled": true, "description": "[CUSTOM] This is a custom FLINK alert.", "name": "flink_service", "component_name": "FLINK_MASTER", "interval": 1, "label": "[Custom] FLINK alert", "source": { "default_port" : 6123, "reporting" : { "ok" : { "text" : "TCP OK - {0:.4f} response on port {1}" }, "warning" : { "text" : "TCP OK - {0:.3f}s response on port {1}", "value" : 1.5 }, "critical" : { "text" : "Connection failed: {0} on host {1}:{2}", "value" : 5.0 } }, "type" : "PORT" } } }

Any help is appreciated. Thank you.


@Jose A. Gomez

One thing I see missing in your alert json is uri

In the link you mentioned, there is an example of uri as:

"uri" : "{{core-site/ha.zookeeper.quorum}}"

Please see if setting a value for uri corresponding to Flink resolves the issue


Super Collaborator

Can you query for your alert definition and see how it was created? You shouldn't need a "uri" in the JSON as this is a PORT alert and will default to the current host without one. Here are a few things to post to help us along:

- GET api/v1/clusters/<cluster>/alert_definitions?AlertDefinition/name=flink_service&fields=AlertDefinition/*

- Ambari Server Version

- Logs from Ambari Server, including a clean Ambari Server startup

I will say that there was a bug in Ambari 2.2 (can't remember if it was 2.2.0 or 2.2.1) where the default_port value wasn't parsed correctly. The solution was to remove it and rely on the "uri" property instead.

New Contributor

Thank you for your anwers.

- GET api/v1/clusters/<cluster>/alert_definitions?AlertDefinition/name=flink_service&fields=AlertDefinition/*:

{ "href" : "http://horton1:8080/api/v1/clusters/HWCluster/alert_definitions?AlertDefinition/name=flink_service", "items" : [ { "href" : "http://horton1:8080/api/v1/clusters/HWCluster/alert_definitions/101", "AlertDefinition" : { "cluster_name" : "HWCluster", "id" : 101, "label" : "[Custom] FLINK alert", "name" : "flink_service" } } ] }

- Ambari Server Version: 2.2.2

- ambari-server.log is 4.2M, what do you need to find? the only lines about Flink are related with config applications.

Thank you again

Super Collaborator

That GET didn't show the fields I wanted to see. Can you try:


New Contributor

{ "href" : "http://horton1:8080/api/v1/clusters/HWCluster/alert_definitions/101", "AlertDefinition" : { "cluster_name" : "HWCluster", "component_name" : "FLINK_MASTER", "description" : "[CUSTOM] This is a custom FLINK alert.", "enabled" : true, "id" : 101, "ignore_host" : false, "interval" : 1, "label" : "[Custom] FLINK alert", "name" : "flink_service", "scope" : "HOST", "service_name" : "FLINK", "source" : { "default_port" : 6123.0, "type" : "PORT" } }

Thank you Jonathan

Super Collaborator

I believe you're hitting a known issue. Try to create your alert with the "default_port" property.