Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > 15757095713ed4f5be55aa4e5c18fc89 > files > 5

ctdb-4.10.8-3.mga7.armv7hl.rpm

This directory should contain executable programs ending in ".script"
to handle CTDB event notifications.  The first and only argument
passed to each program is the event, which is one of:

  init, setup, startup, unhealthy, healthy

An example script that sends SNMP traps for unhealthy/healthy might
look like this:

  #!/bin/sh

  case "$1" in
      unhealthy)
          # Send an SNMP trap saying that the node is unhealthy:
          snmptrap -m ALL -v 1 -c public 10.1.1.105 ctdb \
              $(hostname) 0 0 $(date +"%s") ctdb.nodeHealth.0 i 1
          ;;
      healthy)
          # Send an SNMP trap saying that the node is healthy again:
          snmptrap -m ALL -v 1 -c public 10.1.1.105 ctdb \
	      $(hostname) 0 0 $(date +"%s") ctdb.nodeHealth.0 i 0
	  ;;
  esac

Alternatively, email could be sent:

  #!/bin/sh

  case "$1" in
      unhealthy)
          mail -s "$(hostname) is UNHEALTHY" foo@example.com </dev/null >/dev/null 2>&1
          ;;
      healthy)
          mail -s "$(hostname) is HEALTHY" foo@example.com </dev/null >/dev/null 2>&1
          ;;
  esac