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

Alerts: Change AlertDefinition to Support a Reporting Member

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • None
    • 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':[  
      
         ]
      }
      

      Attachments

        Issue Links

          Activity

            People

              jonathanhurley Jonathan Hurley
              jonathanhurley Jonathan Hurley
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: