This PR implements a simple pubsub system that produces OutageMaps periodically (60 seconds) from UISP by looking at all ongoing UISP outages, grouping device outages by related nn, and printing them to the log. I will open another PR to add support to update slack channel topics with a status indicator.
Note: this implementation drops outages if they are going on for > 60days.
[14:12:03] ~/code/nycmesh-tool gabe/outage-informer* ❱ make && bin/nycmesh-tool daemon --enable-slack=false
GOOS= GOARCH= go build -ldflags='-X github.com/byxorna/nycmesh-tool/pkg/version.GitCommit=5d9431a590b861285326a0aa988ef8678a2e5c32 -X "github.com/byxorna/nycmesh-tool/pkg/version.BuildDate=Tue Feb 15 07:12:07 PM UTC 2022" -X "github.com/byxorna/nycmesh-tool/pkg/version.Release=v0.4.2-23-g5d9431a" -X "github.com/byxorna/nycmesh-tool/pkg/version.GitBranch=gabe/outage-informer"' -o bin/nycmesh-tool github.com/byxorna/nycmesh-tool
2022/02/15 14:12:09 config file: /home/gabe/.nycmesh-tool.yaml
2022/02/15 14:12:09 binary release v0.4.2-23-g5d9431a, built Tue Feb 15 07:12:07 PM UTC 2022
2022/02/15 14:12:09 launching daemon...
2022/02/15 14:12:09 logged into UISP as gabeconradi
2022/02/15 14:12:09 daemon config: {"core":{"format":"json"},"slack":{},"daemon":{"dfs-event-detection":true,"outage-detection":true,"enable-slack":false}}
2022/02/15 14:12:09 bootstrapping by fetching logs 48h0m0s old
2022/02/15 14:12:09 watching for DFS events with `\bchanged frequency due to DFS detection\b`
2022/02/15 14:12:09 nn:204 in outage for 7h43m50.154435991s (1 in outage: nycmesh-204-omni)
...
2022/02/15 14:16:09 nn:204 outage all clear!
This PR implements a simple pubsub system that produces
OutageMap
s periodically (60 seconds) from UISP by looking at all ongoing UISP outages, grouping device outages by related nn, and printing them to the log. I will open another PR to add support to update slack channel topics with a status indicator.Note: this implementation drops outages if they are going on for > 60days.