X-Git-Url: https://git.xandkar.net/?p=khatus.git;a=blobdiff_plain;f=README.md;h=1f5e325dbd2c063d1dba0a08bd77c60ffc09bf46;hp=7ab320b548852abb03751496baef3b746ebce74a;hb=HEAD;hpb=ec80b4403b0d2ea418a281225f7f2719a609f0d3 diff --git a/README.md b/README.md index 7ab320b..1f5e325 100644 --- a/README.md +++ b/README.md @@ -2,78 +2,20 @@ khatus ====== ![mascot](mascot.jpg) -Experimental, system monitor and status (bar) reporter I use with +Experimental system-monitor and status (bar) reporter I use with [dwm](https://dwm.suckless.org/) on GNU/Linux. -![screenshot](screenshot.jpg) +![screenshot](screenshot.png) +Experiments +----------- +The approaches experimented-with so far (later versions do not _necessarily_ +obsolete earlier ones, they're just different): -Design ------- - -``` - parallel +----------+ +----------+ +----------+ - stateless | sensor_1 | | sensor_2 | ... | sensor_n | - collectors +----------+ +----------+ +----------+ - | | | - data data data - | | | - V V V - serial +-----------------------------------------+ - stateful | controller | - observer +-----------------------------------------+ - | - decisions - | - V - serial +-----------------------------------------+ - stateless | actuator | - executor +-----------------------------------------+ - | - system commands - | - V - ~~~~~~ - ~ OS ~ - ~~~~~~ -``` - -### Actuator -By default, actuator is left disconnected from the controller's output, so if -desired - it needs to be manually attached when starting `khatus`. For example, -in my `.xinitrc` I have: - -```sh -$BIN/khatus \ -2> >($BIN/twrap.sh >> $HOME/var/log/khatus.log) \ -| $BIN/khatus_actuator \ - -v pid="$$" \ - -v display=":0" \ -2> >($BIN/twrap.sh >> $HOME/var/log/khatus-actuator.log) \ -& -``` - -(`twrap.sh` is a simple script which prefixes a timestamp to each line) - -The idea is to later have multiple, (some more-general and some more-specific) -actuators which can be selected as needed, say for example: - -```sh -$BIN/khatus \ -| tee \ ->(awk '/^STATUS_BAR/ {sub("^" $1 " *", ""); system("xsetroot -name \" " $0 " \"")}') \ ->(grep '^REPORT' | actuate_report_to_email) \ ->(grep '^ALERT' | grep mpd | actuate_alert_to_email) \ ->(grep '^ALERT' | grep IntrusionAttempt | actuate_intruder_to_iptables_drop) \ ->(grep '^ALERT' | grep NewDevice | actuate_alert_to_notify_send) ->(grep '^ALERT' | grep DiskError | actuate_call_mom) -``` - -... and/or any other such fun you might imagine. - -### Errors -Any errors encountered by any sensor are propagated as alerts by the -controller, which are in turn actualized as desktop notifications by the -actuator: - -![screenshot-self-error-propagation](screenshot-self-error-propagation.jpg) +| Name | Status | Language | Tested-on | Description | +|--------|----------|-----------|-------------------------|-------------| +| __x1__ | Archived | Bash, AWK | Ubuntu 16.04 | Single, synchronous script, saving state in text files. | +| __x2__ | Archived | Bash, AWK | Debian 10, Ubuntu 18.04 | Sensors are child processes, IPC via parent pipe. | +| __x3__ | Archived | OCaml | Debian 10 | Re-write and refinement of __x2__ | +| __x4__ | Archived | Dash, AWK | Debian 10 | Sensors are opaque daemons, cache is a file tree | +| __x5__ | [Graduated](https://github.com/xandkar/pista) | C | Ubuntu 18.04 | Sensors are opaque daemons, IPC via [pselect](https://en.wikipedia.org/wiki/Select_(Unix))ed FIFOs. |