> On Sept. 3, 2016, 3:17 p.m., Jonathan Hurley wrote: > > This is not the correct way to accomplish this. Instead, when you create > > the alert target, you can specify which alert states the alert target cares > > about: > > > > ``` > > { > > "AlertTarget": { > > "name": "Simple", > > "description": "This target does not work and is only an exmaple of > > setting states", > > "alert_states": ["OK", "WARNING"] > > "notification_type": "FOO", > > "groups": [1,2,3] > > } > > } > > ``` > > > > This is also accomplished through the Web Client when created/editing the > > target. > > yao lei wrote: > thanks for your explaination. > Do your mean that we can creating or editing the alert target on web ui?
Yes you can. - Jonathan ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/51599/#review147727 ----------------------------------------------------------- On Sept. 3, 2016, 10:36 a.m., yao lei wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/51599/ > ----------------------------------------------------------- > > (Updated Sept. 3, 2016, 10:36 a.m.) > > > Review request for Ambari and Jonathan Hurley. > > > Bugs: AMBARI-18292 > https://issues.apache.org/jira/browse/AMBARI-18292 > > > Repository: ambari > > > Description > ------- > > By default, Ambari allow all notifications of all kinds of alert states > (OK,WARNING,CRITICAL,UNKNOWN) to dispatch in script-based alert dispatcher. > However, sometimes we hope to filter notification of some alert states > This patch will resolve this by setting > 'notification.dispatch.alert.script.states' in ambari.properties as following: > > #Only dispatch WARNING and CRITICAL state notification > notification.dispatch.alert.script.states=WARNING,CRITICAL > > If you don't set this property that means all notifications will be > dispatched. > > I think making the desired alerts notifications configurable may be useful > for Ambari users. > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcher.java > 907588d > > ambari-server/src/test/java/org/apache/ambari/server/notifications/dispatchers/AlertScriptDispatcherTest.java > 9e0e406 > > Diff: https://reviews.apache.org/r/51599/diff/ > > > Testing > ------- > > Tested > > Running > org.apache.ambari.server.notifications.dispatchers.AlertScriptDispatcherTest > Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.096 sec - in > > > Thanks, > > yao lei > >