Updated Branches: refs/heads/trunk d9ff52e2b -> 0aefc3760
AMBARI-2964. After stopping YARN some alerts are shown with incorrect data. (Vitaly Brodetskyi via dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/0aefc376 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/0aefc376 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/0aefc376 Branch: refs/heads/trunk Commit: 0aefc3760704782fe79b0e33a29dcfda35352ac9 Parents: d9ff52e Author: Lisnichenko Dmitro <[email protected]> Authored: Tue Aug 20 15:31:36 2013 +0300 Committer: Lisnichenko Dmitro <[email protected]> Committed: Tue Aug 20 15:31:36 2013 +0300 ---------------------------------------------------------------------- .../hdp-nagios/files/check_resourcemanager_nodes_percentage.sh | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0aefc376/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_resourcemanager_nodes_percentage.sh ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_resourcemanager_nodes_percentage.sh b/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_resourcemanager_nodes_percentage.sh index cc899fa..358da57 100644 --- a/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_resourcemanager_nodes_percentage.sh +++ b/ambari-agent/src/main/puppet/modules/hdp-nagios/files/check_resourcemanager_nodes_percentage.sh @@ -31,6 +31,11 @@ RESOURCEMANAGER_URL="http://$HOST:$PORT/ws/v1/cluster/metrics" export PATH="/usr/bin:$PATH" RESPONSE=`curl -s $RESOURCEMANAGER_URL` +if [ -z "$RESPONSE" ]; then + echo "CRITICAL: Can't get data from http://$HOST:$PORT/ws/v1/cluster/metrics" + exit 2; +fi + #code below is parsing RESPONSE that we get from resourcemanager api, for number between "activeNodes": and ',' ACTIVE_NODES=`echo "$RESPONSE" | sed -nre 's/^.*"activeNodes":([[:digit:]]+).*$/\1/gp'` LOST_NODES=`echo "$RESPONSE" | sed -nre 's/^.*"lostNodes":([[:digit:]]+).*$/\1/gp'`
