max / mountaineer
| 1 | #!/bin/sh |
| 2 | # yambar `svc` segment feed: services health summary from sysop. |
| 3 | # |
| 4 | # Emits one yambar record per second: |
| 5 | # state|string|ok (all up) |
| 6 | # state|string|down (some down) |
| 7 | # count|string|<N> (count of down services, only on `down`) |
| 8 | # |
| 9 | # Routes operator into `sysop services` when state != ok. |
| 10 | |
| 11 | |
| 12 | |
| 13 | while ; do |
| 14 | summary="" |
| 15 | case "" in |
| 16 | ok) |
| 17 | |
| 18 | ;; |
| 19 | *' down') |
| 20 | count="" |
| 21 | |
| 22 | ;; |
| 23 | *) |
| 24 | |
| 25 | ;; |
| 26 | esac |
| 27 | |
| 28 | done |
| 29 |