Do not rely on FS for msg parsing
[khatus.git] / src / awk / exe / monitor_errors.awk
old mode 100755 (executable)
new mode 100644 (file)
index 13130cc..ca9f6e6
@@ -1,10 +1,9 @@
-/^ERROR/ {
-    src = $2
-    # Not just using $3 for body - because body might contain a character
-    # identical to FS
-    len_line = length($0)
-    len_head = length($1 FS $2 FS)
-    len_body = len_line - len_head
-    body = substr($0, len_head + 1, len_body)
-    msg_out_ok_alert("hi", "ERROR_IN_" src, body)
+{
+  delete msg
+  msg_parse(msg, $0)
+}
+
+msg["type"] == "error" {
+    subject = "ERROR_IN_" msg["node"] ":" msg["module"]
+    msg_out_alert_hi(subject, msg["line"])
 }
This page took 0.029895 seconds and 4 git commands to generate.