Commit | Line | Data |
---|---|---|
03c229bf | 1 | BEGIN { |
8482fea6 SK |
2 | FS1 = "|" # Fiels separator, level 1 (record to fields) |
3 | FS2 = ":" # Fiels separator, level 2 (field to subfields | |
4 | ||
5 | OFS = FS1 | |
6 | Kfs = FS2 | |
7 | } | |
8 | ||
9 | # ----------------------------------------------------------------------------- | |
10 | # alert | |
11 | # ----------------------------------------------------------------------------- | |
12 | function msg_out_alert_low(subject, body) { | |
13 | msg_out_alert("low", subject, body) | |
14 | } | |
15 | ||
16 | function msg_out_alert_med(subject, body) { | |
17 | msg_out_alert("med", subject, body) | |
03c229bf SK |
18 | } |
19 | ||
8482fea6 SK |
20 | function msg_out_alert_hi(subject, body) { |
21 | msg_out_alert("hi", subject, body) | |
22 | } | |
23 | ||
24 | function msg_out_alert(priority, subject, body) { | |
e103315c SK |
25 | # priority : "low" | "med" | "hi" |
26 | # subject : string without spaces | |
27 | # body : anything | |
8482fea6 SK |
28 | print(Node, Module, "alert", priority, subject, body) |
29 | } | |
30 | ||
31 | # ----------------------------------------------------------------------------- | |
32 | # log | |
33 | # ----------------------------------------------------------------------------- | |
34 | function msg_out_log_info(location, msg) { | |
35 | msg_out_log("info", location, msg) | |
e103315c SK |
36 | } |
37 | ||
8482fea6 SK |
38 | function msg_out_log_error(location, msg) { |
39 | msg_out_log("error", location, msg) | |
03c229bf SK |
40 | } |
41 | ||
8482fea6 SK |
42 | function msg_out_log(level, location, msg) { |
43 | print(Node, Module, "log", location, level, msg) > "/dev/stderr" | |
03c229bf SK |
44 | } |
45 | ||
8482fea6 SK |
46 | # ----------------------------------------------------------------------------- |
47 | # status_bar | |
48 | # ----------------------------------------------------------------------------- | |
49 | function msg_out_status_bar(bar) { | |
50 | print(Node, Module, "status_bar", bar) | |
03c229bf SK |
51 | } |
52 | ||
8482fea6 SK |
53 | # ----------------------------------------------------------------------------- |
54 | # data | |
55 | # ----------------------------------------------------------------------------- | |
56 | function msg_out_data(key, val) { | |
57 | print(Node, Module, "data", key, val) | |
03c229bf | 58 | } |