You can use DSCC to perform this task. For information, see Directory Service Control Center Interface and the DSCC online help.
Select the alerts that will be sent to the syslog, as described in To Enable Administrative Alerts.
Enable alerts to run a script.
$ dpconf set-server-prop -h host -p port scriptable-alerts-enabled:true
Set the name of the script that will be run.
$ dpconf set-server-prop -h host -p port scriptable-alerts-command:script-name