GitXplorerGitXplorer
k

webenable-hackathon-2021

public
0 stars
0 forks
1 issues

Commits

List of commits on branch main.

No commits found

There are no commits on branch main.

README

The README file for this repository.

Ambient monitor

  • 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:

Monitoring a system

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 (metrics scraping)

Prometheus to scraping metrics from the node.

With metrics like:

scripts/prometheus.sh

Prometheus can run anywhere in your infrastructure to scrape the metrics.

Audio based on monitoring

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

Interesting metrics

  • 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

Interesting sound sites

Background sounds

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.