1 This directory should contain executable programs to handle CTDB event
2 notifications. The first and only argument passed to each program is
3 the event, which is one of:
5 init, setup, startup, unhealthy, healthy
7 To use notifications with this directory then you need to set:
9 CTDB_NOTIFY_SCRIPT=/etc/ctdb/notify.sh
11 in your CTDB configuration file.
13 An example script that sends SNMP traps for unhealthy/healthy might
20 # Send an SNMP trap saying that the node is unhealthy:
21 snmptrap -m ALL -v 1 -c public 10.1.1.105 ctdb \
22 $(hostname) 0 0 $(date +"%s") ctdb.nodeHealth.0 i 1
25 # Send an SNMP trap saying that the node is healthy again:
26 snmptrap -m ALL -v 1 -c public 10.1.1.105 ctdb \
27 $(hostname) 0 0 $(date +"%s") ctdb.nodeHealth.0 i 0
31 Alternatively, email could be sent:
37 mail -s "$(hostname) is UNHEALTHY" foo@example.com </dev/null >/dev/null 2>&1
40 mail -s "$(hostname) is HEALTHY" foo@example.com </dev/null >/dev/null 2>&1
44 When adding programs please note the exclusion patterns in notify.sh.