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

15
node-collector-backups Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
prom_file=/srv/docker/container/node-exporter/textfile_collector/backups.prom
ISSUE=`/home/ddp/bin/backup-success`
RES=$?
echo "# HELP node_backups status of last backup" > $prom_file
echo "# TYPE node_backups gauge" >> $prom_file
if [ $RES != 0 ];
then
echo "node_backups{what=\"state\",issue=\"$ISSUE\"} $RES" >> $prom_file
curl 'https://mon.depaoli.id.au/api/push/hoJD234qsx?status=down&msg=OK'
else
echo "node_backups{what=\"state\"} $RES" >> $prom_file
curl 'https://mon.depaoli.id.au/api/push/hoJD234qsx?status=up&msg=OK'
fi