Commit | Line | Data |
---|---|---|
1 | #! /usr/bin/awk -f | |
2 | ||
3 | BEGIN { | |
4 | FS = msg_fs ? msg_fs : "|" | |
5 | OFS = msg_fs ? msg_fs : "|" | |
6 | Kfs = key_fs ? key_fs : ":" | |
7 | } | |
8 | ||
9 | $1 == "OK" && \ | |
10 | $2 == "khatus_sensor_devices" \ | |
11 | { | |
12 | alert("low", "BlockDeviceEvent", $3 " " $4) | |
13 | } | |
14 | ||
15 | function alert(priority, subject, body) { | |
16 | # priority : "low" | "med" | "hi" | |
17 | # subject : no spaces | |
18 | # body : anything | |
19 | print("OK", "khatus_monitor_devices", "alert", priority, subject, body) | |
20 | } |