initial commit of bin scripts into git
This commit is contained in:
15
node-collector-backups
Executable file
15
node-collector-backups
Executable 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
|
||||
Reference in New Issue
Block a user