Add block device event sensor and monitor
[khatus.git] / bin / khatus_monitor_devices
diff --git a/bin/khatus_monitor_devices b/bin/khatus_monitor_devices
new file mode 100755 (executable)
index 0000000..915933c
--- /dev/null
@@ -0,0 +1,20 @@
+#! /usr/bin/awk -f
+
+BEGIN {
+     FS = msg_fs ? msg_fs : "|"
+    OFS = msg_fs ? msg_fs : "|"
+    Kfs = key_fs ? key_fs : ":"
+}
+
+$1 == "OK" && \
+$2 == "khatus_sensor_devices" \
+{
+    alert("low", "BlockDeviceEvent", $3 " " $4)
+}
+
+function alert(priority, subject, body) {
+    # priority : "low" | "med" | "hi"
+    # subject  : no spaces
+    # body     : anything
+    print("OK", "khatus_monitor_devices", "alert", priority, subject, body)
+}
This page took 0.022058 seconds and 4 git commands to generate.