initial commit of bin scripts into git

This commit is contained in:
2023-11-08 13:38:19 +11:00
commit 3735eea3c6
113 changed files with 11631 additions and 0 deletions

19
node-collector-myth Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
num_tuners=`ls -dl /dev/dvb/* | wc -l`
num_upcoming_recordings=`/home/ddp/bin/myth_upcoming_recordings.pl --plain_text --hours 4 | wc -l`
num_tuners_recording=`/home/ddp/bin/myth_upcoming_recordings.pl --plain_text --hours 4 | egrep -cw '^RECORDING:'`
tmp_file=/tmp/myth.prom.$$
real_file=/srv/docker/container/node-exporter/textfile_collector/myth.prom
echo "# HELP node_myth data on myth tuners and recordings coming up and happening now" >> $tmp_file
echo "# TYPE node_myth gauge" >> $tmp_file
echo "node_myth{what=\"num_tuners\"} $num_tuners" >> $tmp_file
echo "node_myth{what=\"num_upcoming_recordings\"} $num_upcoming_recordings" >> $tmp_file
echo "node_myth{what=\"num_tuners_recording\"} $num_tuners_recording" >> $tmp_file
mv $tmp_file $real_file