Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1474610FBA for ; Thu, 11 Dec 2014 05:02:13 +0000 (UTC) Received: (qmail 88104 invoked by uid 500); 11 Dec 2014 05:02:13 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 88066 invoked by uid 500); 11 Dec 2014 05:02:12 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 87876 invoked by uid 99); 11 Dec 2014 05:02:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Dec 2014 05:02:12 +0000 Date: Thu, 11 Dec 2014 05:02:12 +0000 (UTC) From: "Jonathan Hurley (JIRA)" To: dev@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AMBARI-8623) Alert Host Count Summary Exposed Via Cluster Endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AMBARI-8623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14242156#comment-14242156 ] Jonathan Hurley commented on AMBARI-8623: ----------------------------------------- The final format was {noformat} { "href" : "http://localhost:8080/api/v1/clusters/c1?fields=alerts_summary_hosts", "Clusters" : { "cluster_name" : "c1", "version" : "HDP-2.2" }, "alerts_summary_hosts" : { "CRITICAL" : 2, "OK" : 1, "UNKNOWN" : 0, "WARNING" : 1 } } {noformat} Where the sum of all of the values will always be the total number of hosts. In the above example, there are 2 hosts whose most severe alert is CRITICAL, there is a single host whose most severe alert is WARNING, and there is a single host with all alerts OK. > Alert Host Count Summary Exposed Via Cluster Endpoint > ----------------------------------------------------- > > Key: AMBARI-8623 > URL: https://issues.apache.org/jira/browse/AMBARI-8623 > Project: Ambari > Issue Type: Task > Components: alerts, ambari-server > Affects Versions: 2.0.0 > Reporter: Jonathan Hurley > Assignee: Jonathan Hurley > Fix For: 2.0.0 > > Attachments: AMBARI-8623.patch > > > In Ambari-1.7.0 the cluster endpoint used to have a summary of host-counts by severity. We need such a field in Ambari-2.0.0. > {code} > alerts: { > summary: { > CRITICAL: 1, > OK: 4, > PASSIVE: 0, > WARNING: 0 > } > } > {code} > The alerts_summary structure currently returned by the 2.0.0 API are the summary counts of alerts in the system, not those of the hosts. There are alerts that don't have a host (such as aggregate alerts). > In order to expose the host alert count, there are two ways to do this: > 1) Add a new field to the cluster endpoint; something like {{alerts_host_summary}} > {noformat} > http://localhost:8080/api/v1/clusters/c1?fields=alerts_host_summary > { > "href" : "http://localhost:8080/api/v1/clusters/c1?fields=alerts_host_summary", > "Clusters" : { > "cluster_name" : "c1", > "version" : "HDP-2.2" > }, > "alerts_host_summary" : { > "CRITICAL" : 1, > "OK" : 41, > "UNKNOWN" : 0, > "WARNING" : 0 > } > } > {noformat} > 2) Provide a new formatter to display the alerts formatted by host: > {noformat} > http://localhost:8080/api/v1/clusters/c1/alerts?format=hostSummary > { > "href" : "http://localhost:8080/api/v1/clusters/c1/alerts?format=hostSummary", > "alerts_summary" : { > "CRITICAL" : { > "count" : 1, > "original_timestamp" : 1418150735812 > }, > "OK" : { > "count" : 41, > "original_timestamp" : 1418151145325 > }, > "UNKNOWN" : { > "count" : 0, > "original_timestamp" : 0 > }, > "WARNING" : { > "count" : 0, > "original_timestamp" : 0 > } > } > } > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)