> 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? > > Jonathan Hurley wrote: > Yes you can. > > yao lei wrote: > Thanks your reply. > I think i need to upgrade my current ambari 2.1.1 > > yao lei wrote: > Hi,jhurley. > I am sorry to bother you again. > I can't find the operation on Web Client to create alert target which > notification_type is ALERT_SCRIPT. > It seems that Ambari only support creating/editing alert notifications of > type EMAIL/SNMP ( Alerts -> Actions -> Manage Notifications -> Icon plus -> > Create Alert Notification) > My Ambari verison now is 2.4.0.1
That's correct - creating a SCRIPT type dispatcher is not supported in the web client yet. I believe the web client is working on scoping an alert wizard for 2.5.0, but until then you'd need to use a POST to create it. - 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 > >