smb2: Fix smb2_lease_state
[Samba.git] / ctdb / config / notify.d.README
blobffce7fab2fb0faf51b74c7935e9d90d3f3d1fb39
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
14 look like this:
16   #!/bin/sh
18   case "$1" in
19       unhealthy)
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
23           ;;
24       healthy)
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
28           ;;
29   esac
31 Alternatively, email could be sent:
33   #!/bin/sh
35   case "$1" in
36       unhealthy)
37           mail -s "$(hostname) is UNHEALTHY" foo@example.com </dev/null >/dev/null 2>&1
38           ;;
39       healthy)
40           mail -s "$(hostname) is HEALTHY" foo@example.com </dev/null >/dev/null 2>&1
41           ;;
42   esac
44 When adding programs please note the exclusion patterns in notify.sh.