]>
Commit | Line | Data |
---|---|---|
b5e64645 NB |
1 | #!/bin/sh |
2 | # | |
3 | # sample event handling script for mdadm | |
4 | # e.g. mdadm --follow --program=/sbin/syslog-events --scan | |
5 | # | |
6 | # License: GPL ver.2 | |
7 | # Copyright (C) 2004 SEKINE Tatsuo <tsekine@sdri.co.jp> | |
8 | ||
9 | event="$1" | |
10 | dev="$2" | |
11 | disc="$3" | |
12 | ||
13 | facility="kern" | |
14 | tag="mdmonitor" | |
15 | ||
16 | case x"${event}" in | |
17 | xFail*) priority="error" ;; | |
18 | xTest*) priority="debug" ;; | |
19 | x*) priority="info" ;; | |
20 | esac | |
21 | ||
22 | msg="${event} event on ${dev}" | |
23 | if [ x"${disc}" != x ]; then | |
24 | msg="${msg}, related to disc ${disc}" | |
25 | fi | |
26 | ||
27 | exec logger -t "${tag}" -p "${facility}.${priority}" -- "${msg}" |