5 Experimental, system monitor and status (bar) reporter I use with
6 [dwm](https://dwm.suckless.org/) on GNU/Linux.
8 ![screenshot](screenshot.jpg)
15 parallel +----------+ +----------+ +----------+
16 stateless | sensor_1 | | sensor_2 | ... | sensor_n |
17 collectors +----------+ +----------+ +----------+
22 serial +----------------------------------------------+
23 stateful | controller |
24 observer +----------------------------------------------+
36 +-------------+-+---------+---------+
39 parallel +------------+ +------------+ +------------+
40 stateless | filter_1 | | filter_2 | ... | filter_n |
41 filters +------------+ +------------+ +------------+
44 parallel +------------+ +------------+ +------------+
45 stateless | actuator_1 | | actuator_2 | ... | actuator_n |
46 executors +------------+ +------------+ +------------+
48 commands commands commands commands
51 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52 ~~~~~~~~~~~~~ operating system ~~~~~~~~~~~~~~~~~
53 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57 Actuator is anything that takes action upon controller messages. A few generic
60 - `khatus_actuate_alert_to_notify_send`
61 - `khatus_actuate_status_bar_to_xsetroot_name`
63 and, by default, are left disconnected from the controller's output, so if
64 desired - it needs to be manually attached when starting `khatus`. For example,
65 in my `.xinitrc` I have:
69 2> >($BIN/twrap >> $HOME/var/log/khatus.log) \
71 >($BIN/khatus_actuate_status_bar_to_xsetroot_name) \
72 >(grep -v MpdNowPlaying | $BIN/khatus_actuate_alert_to_notify_send) \
73 2> >($BIN/twrap >> $HOME/var/log/khatus-actuators.log) \
76 (where `twrap` is a simple script which prefixes a timestamp to each line)
78 The idea is to give maximum flexibility for what to do with the controller
79 output, say, for instance:
85 >(grep '^REPORT' | actuate_report_to_email) \
86 >(grep '^ALERT' | grep mpd | actuate_alert_to_email) \
87 >(grep '^ALERT' | grep IntrusionAttempt | actuate_intruder_to_iptables_drop) \
88 >(grep '^ALERT' | grep NewDevice | actuate_alert_to_notify_send)
89 >(grep '^ALERT' | grep DiskError | actuate_call_mom)
92 ... and so on, for any other such fun you might imagine.
95 Any errors encountered by any sensor are propagated as alerts by the
96 controller, which are in turn actualized as desktop notifications by the
97 `khatus_actuate_alert_to_notify_send` actuator:
99 ![screenshot-self-error-propagation](screenshot-self-error-propagation.jpg)
104 - retry/cache for sensors fetching flaky remote resources (such as weather)
105 - throttling of broken sensors (constantly returns errors)
106 - alert specification language
108 - above/bellow/equal to threshold value
110 - snooze time (if already alerted, when to re-alert?)
112 - Reduce wireless sensor resource footprint:
113 - use `nmcli monitor`, instead of polling, for state changes
114 - use `iwconfig`, instead of `nmcli`, for SSID and signal strength