wafsamba: fix pidl dependencies to rebuild on pidl changes
[Samba.git] / ctdb / config / notification.README
blob16b632f653aff77b1d784396e007dd1c64820848
1 This directory should contain executable programs ending in ".script"
2 to handle CTDB event notifications.  The first and only argument
3 passed to each program is the event, which is one of:
5   init, setup, startup, unhealthy, healthy
7 An example script that sends SNMP traps for unhealthy/healthy might
8 look like this:
10   #!/bin/sh
12   case "$1" in
13       unhealthy)
14           # Send an SNMP trap saying that the node is unhealthy:
15           snmptrap -m ALL -v 1 -c public 10.1.1.105 ctdb \
16               $(hostname) 0 0 $(date +"%s") ctdb.nodeHealth.0 i 1
17           ;;
18       healthy)
19           # Send an SNMP trap saying that the node is healthy again:
20           snmptrap -m ALL -v 1 -c public 10.1.1.105 ctdb \
21               $(hostname) 0 0 $(date +"%s") ctdb.nodeHealth.0 i 0
22           ;;
23   esac
25 Alternatively, email could be sent:
27   #!/bin/sh
29   case "$1" in
30       unhealthy)
31           mail -s "$(hostname) is UNHEALTHY" foo@example.com </dev/null >/dev/null 2>&1
32           ;;
33       healthy)
34           mail -s "$(hostname) is HEALTHY" foo@example.com </dev/null >/dev/null 2>&1
35           ;;
36   esac