- Monitoring network traffic on a port.
- Playing ambient sound based on the traffic.
Goal is to have an ambient sound (background music or effects) play according to metrics of a system you want to monitor.
Requirements handled by Nix:
Choice: prometheus-node-exporter
Runs a Prometheus node_exporter, exposing metrics on port 9100.
scripts/node-exporter.sh
Normally you would run this on your server of interest, barebone, on-premise or in the cloud.
Prometheus to scraping metrics from the node.
With metrics like:
scripts/prometheus.sh
Prometheus can run anywhere in your infrastructure to scrape the metrics.
Go application, serving static web content and providing an endpoint that returns the 'audio-params' to use.
Iterative attempts:
- v1: random integer for BPM
- v2: query prometheus and translate to BPM
scripts/ambient-monitor.sh
node_network_receive_bytes_total{device="wlp0s20f3"} 9.30349675e+08
node_network_receive_errs_total{device="wlp0s20f3"} 0
node_network_receive_packets_total{device="wlp0s20f3"} 633263
node_network_transmit_bytes_total{device="wlp0s20f3"} 1.4333448e+07
node_network_transmit_errs_total{device="wlp0s20f3"} 0
node_network_transmit_packets_total{device="wlp0s20f3"} 113194
Another idea would be to enable ambient sounds per metric (CPU, mem, network) and enable sound effects like sea waves, wind, thunder and adjust the volume based on the metric. This could alarm you in another way than staring at a monitoring screen.