From 57113eb6c90668f1c1a47a756f9bb98493cbc4b9 Mon Sep 17 00:00:00 2001 From: Anton Sarukhanov <code@ant.sr> Date: Sat, 23 Mar 2019 15:19:49 -0400 Subject: [PATCH] Add references to Zabbix post --- content/System Administration/zabbix-sound-level.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/content/System Administration/zabbix-sound-level.md b/content/System Administration/zabbix-sound-level.md index 4b966a8..a534967 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) -- GitLab