Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-6915

Alerts: Change AlertDefinition to Support a Reporting Member

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: None
    • Labels:
      None

      Description

      AlertDefinitions need to change slightly to allow an object-ified "reporting" structure.

      Example alerts.json

          {
            "name": "namenode_cpu",
            "label": "NameNode host CPU Utilization",
            "scope": "host",
            "source": {
              "type": "METRIC",
              "jmx": "java.lang:type=OperatingSystem/SystemCpuLoad",
              "host": "{{hdfs-site/dfs.namenode.secondary.http-address}}",
              "reporting": {
                "ok": {
                  "text": "System CPU Load is OK"
                },
                "warning": {
                  "text": "System CPU Load is Nearing Critical",
                  "value": 70
                },          
                "critical": {
                  "text": "System CPU Load is Critical",
                  "value": 80
                }
              }
            }
          }
      

      Example Heartbeat JSON:

      {  
         'alertDefinitionCommands':[  
            {  
               'alertDefinitions':[  
                  {  
                     'componentName':'NAMENODE',
                     'enabled':True,
                     'interval':1,
                     'label':'HDFS Port Check',
                     'name':'HDFS-Port',
                     'serviceName':'HDFS',
                     'source':{  
                        'port':0,
                        'reporting':{  
                           'critical':{  
                              'text':'TCP FAIL - {0:.4f} response on port {1}'
                           },
                           'ok':{  
                              'text':'TCP OK - {0:.4f} response on port {1}'
                           }
                        },
                        'type':'PORT'
                     }
                  }
               ],
               'clusterName':'c1',
               'commandType':'ALERT_DEFINITION_COMMAND',
               'hash':'0b1000cc35c3daf1bca1504d126a71bd',
               'hostName':'c6404.ambari.apache.org'
            }
         ],
         'cancelCommands':[  
      
         ],
         'executionCommands':[  
      
         ],
         'hasMappedComponents':True,
         'responseId':18,
         'restartAgent':False,
         'statusCommands':[  
      
         ]
      }
      

        Issue Links

          Activity

          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Ambari-trunk-Commit #492 (See https://builds.apache.org/job/Ambari-trunk-Commit/492/)
          AMBARI-6915 - Alerts: Change AlertDefinition to Support a Reporting Member (jonathanhurley) (jhurley: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=0ac9cb3facaff211c5c679d609f59aaca633d267)

          • ambari-server/src/main/java/org/apache/ambari/server/state/alert/ScriptSource.java
          • ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinition.java
          • ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
          • ambari-server/src/main/java/org/apache/ambari/server/state/alert/AggregateSource.java
          • ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionFactory.java
          • ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java
          • ambari-server/src/main/java/org/apache/ambari/server/state/alert/SourceType.java
          • ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProviderTest.java
          • ambari-server/src/main/java/org/apache/ambari/server/state/alert/PercentSource.java
          • ambari-server/src/main/java/org/apache/ambari/server/state/alert/Source.java
          • ambari-server/src/main/java/org/apache/ambari/server/state/alert/PortSource.java
          • ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java
          • ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProvider.java
          • ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/alerts.json
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Ambari-trunk-Commit #492 (See https://builds.apache.org/job/Ambari-trunk-Commit/492/ ) AMBARI-6915 - Alerts: Change AlertDefinition to Support a Reporting Member (jonathanhurley) (jhurley: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=0ac9cb3facaff211c5c679d609f59aaca633d267 ) ambari-server/src/main/java/org/apache/ambari/server/state/alert/ScriptSource.java ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinition.java ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java ambari-server/src/main/java/org/apache/ambari/server/state/alert/AggregateSource.java ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionFactory.java ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java ambari-server/src/main/java/org/apache/ambari/server/state/alert/SourceType.java ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProviderTest.java ambari-server/src/main/java/org/apache/ambari/server/state/alert/PercentSource.java ambari-server/src/main/java/org/apache/ambari/server/state/alert/Source.java ambari-server/src/main/java/org/apache/ambari/server/state/alert/PortSource.java ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProvider.java ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/alerts.json

            People

            • Assignee:
              jonathan.hurley Jonathan Hurley
              Reporter:
              jonathan.hurley Jonathan Hurley
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development