----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/24850/#review50971 -----------------------------------------------------------
May as well add an AggregateSource too while we're at it. ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProvider.java <https://reviews.apache.org/r/24850/#comment88856> Yeah. Stupid flat-properties. ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java <https://reviews.apache.org/r/24850/#comment88855> May not always be a double here. It's conceivable that an alert could use a string or int (covered by a double, but you get the idea). - Nate Cole On Aug. 19, 2014, 10:22 a.m., Jonathan Hurley wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/24850/ > ----------------------------------------------------------- > > (Updated Aug. 19, 2014, 10:22 a.m.) > > > Review request for Ambari and Nate Cole. > > > Bugs: AMBARI-6915 > https://issues.apache.org/jira/browse/AMBARI-6915 > > > Repository: ambari > > > 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':[ > ] > } > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java > 3347a7754481861e139bb1c29b3f1fc63f0ca15e > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProvider.java > f20a9a92b50b5942a4dd1c6e146942ead72af4a4 > > ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinition.java > 8d9b3c20035a80d7bed15c84c511f64635f06ec3 > > ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionFactory.java > 1775f88ff72adbb98ab53e080c34101eab00fad7 > > ambari-server/src/main/java/org/apache/ambari/server/state/alert/PortSource.java > PRE-CREATION > > ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java > PRE-CREATION > > ambari-server/src/main/java/org/apache/ambari/server/state/alert/ScriptSource.java > PRE-CREATION > > ambari-server/src/main/java/org/apache/ambari/server/state/alert/Source.java > f64b7d2e593d2db5d7a524dab1e1533d2003b16c > > ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java > 68cbc92813a3c4681d892e7030e0ab0c06dd1e12 > > ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AlertDefinitionResourceProviderTest.java > 76a633c056662e175572f0a0d0e9a5ffb05d08b1 > ambari-server/src/test/resources/stacks/HDP/2.0.5/services/HDFS/alerts.json > 85aa3ab67d76866c44840ad94375c11274b51d25 > > Diff: https://reviews.apache.org/r/24850/diff/ > > > Testing > ------- > > [INFO] > ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 17:32 min > [INFO] Finished at: 2014-08-19T01:18:25-04:00 > [INFO] Final Memory: 23M/214M > [INFO] > ------------------------------------------------------------------------ > > > Thanks, > > Jonathan Hurley > >
