[ https://issues.apache.org/jira/browse/AMBARI-21122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yao Lei updated AMBARI-21122: ----------------------------- Description: Jave Codes Part Now we can use property <code>ambari.dispatch-property.script.filename</code> to tell AlertScriptDispatcher to lookup script by filename,default in /var/lib/ambari-server/resources/scripts. We can change the directory in ambari.properties by ambari.dispatch-property.script.directory property. Execute a command manually like following to create an alert target: <code> POST api/v1/alert_targets { "AlertTarget": { "name": "syslogger", "description": "Syslog Target", "notification_type": "ALERT_SCRIPT", "global": false, "groups":[1,3] "alert_states":["WARNING","CRITICAL","UNKNOWN"], "properties": { "ambari.dispatch-property.script.filename": "foo.py" } } } </code> was:Jave Codes Part > Part One: Specify the script directly in alert target for script-based alert > dispatchers > ----------------------------------------------------------------------------------------- > > Key: AMBARI-21122 > URL: https://issues.apache.org/jira/browse/AMBARI-21122 > Project: Ambari > Issue Type: Technical task > Reporter: Yao Lei > Assignee: Yao Lei > Fix For: 3.0.0 > > Attachments: AMBARI-21122.patch > > > Jave Codes Part > Now we can use property <code>ambari.dispatch-property.script.filename</code> > to tell AlertScriptDispatcher to lookup script by filename,default in > /var/lib/ambari-server/resources/scripts. > We can change the directory in ambari.properties by > ambari.dispatch-property.script.directory property. > Execute a command manually like following to create an alert target: > <code> > POST api/v1/alert_targets > { > "AlertTarget": { > "name": "syslogger", > "description": "Syslog Target", > "notification_type": "ALERT_SCRIPT", > "global": false, > "groups":[1,3] > "alert_states":["WARNING","CRITICAL","UNKNOWN"], > "properties": { > "ambari.dispatch-property.script.filename": "foo.py" > } > } > } > </code> -- This message was sent by Atlassian JIRA (v6.3.15#6346)