diff --git a/content/System Administration/zabbix-sound-level.md b/content/System Administration/zabbix-sound-level.md index 4b966a8fe0e8aec63f7d45c230d161870a111653..a53496769c3d056650c1d0360996aa4a8cacc7e7 100644 --- a/content/System Administration/zabbix-sound-level.md +++ b/content/System Administration/zabbix-sound-level.md @@ -21,7 +21,7 @@ I already use it to keep an eye on my servers. Maybe it can help here? # Measuring volume -We can use the [`rec` tool](https://linux.die.net/man/1/rec) (part of the [SoX](http://sox.sourceforge.net/) audio processor) to grab audio from the microphone and analyze it. +We can use the [`rec` tool](https://linux.die.net/man/1/rec) (part of the [SoX](http://sox.sourceforge.net/) audio processor) to grab audio from the microphone and analyze it[^0]. ```bash rec -n stat trim 0 .5 @@ -127,7 +127,10 @@ WantedBy=multi-user.target This takes care of a few things: 1. Waits until a network is available. -2. Sets the `AUDIODEV` and `AUDIODRIVER` environment variables required by `rec`. +2. Sets the `AUDIODEV` and `AUDIODRIVER` environment variables[^1]. 3. Runs the script at `/usr/local/bin/zs.sh` (which contains the loop we wrote). Enable the new service with `systemctl enable zs.service`, and start it with `service zs start`. It will automatically start on reboot. + +[^0]: Thanks to StackExchange user "nandhp" for this clue. Source: [audio - Monitoring the microphone level with a command line tool in Linux - Super User](https://superuser.com/questions/306701/monitoring-the-microphone-level-with-a-command-line-tool-in-linux/306765#comment513094_306765) +[^1]: Apparently required by `rec`. Suitable values for a Raspberry Pi were suggested in this forum thread: [sox default device - Raspberry Pi Forums](https://www.raspberrypi.org/forums/viewtopic.php?p=342882&sid=66f9472be6de63a3b99718595bc8ddf5#p342882)