Merge "borg-backup-server: volume space monitor"
This commit is contained in:
commit
0acbf39c91
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
THRESHOLD=90
|
||||
|
||||
df -PkH | grep '/opt/backups' | awk '{ print $5 " " $6 }' | while read output;
|
||||
do
|
||||
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
|
||||
partition=$(echo $output | awk '{print $2}' )
|
||||
if [ $usep -ge $THRESHOLD ]; then
|
||||
echo "Backup volume \"$partition ($usep%)\" on $(hostname) at $(date)" |
|
||||
mail -s "ACTION REQUIRED: Backup volume usage at $usep%" infra-root@openstack.org
|
||||
fi
|
||||
done
|
@ -15,6 +15,22 @@
|
||||
group: root
|
||||
mode: '0755'
|
||||
|
||||
- name: Install backup volume monitor
|
||||
copy:
|
||||
src: 'backup-volume-monitor.sh'
|
||||
dest: '/usr/local/bin/backup-volume-monitor'
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0755'
|
||||
|
||||
- name: Run backup volume monitor
|
||||
cron:
|
||||
name: backup-volume-monitor
|
||||
state: present
|
||||
job: '/usr/local/bin/backup-volume-monitor'
|
||||
minute: '0'
|
||||
hour: '0'
|
||||
|
||||
- name: Build all borg users from backup hosts
|
||||
set_fact:
|
||||
borg_users: '{{ borg_users }} + [ {{ hostvars[item]["borg_user"] }} ]'
|
||||
|
Loading…
x
Reference in New Issue
Block a user