Skip to content

Distribute backup alert hooks #222

Description

@dann1

With this change a hook+exporter backup alert system was created. The hook is distributed via packaging in 7.2.1

root@PC04:~# ls -l /var/lib/one/remotes/hooks/metrics/
total 12
-rw-r----- 1 oneadmin oneadmin 8960 May 21 10:24 backup_restore_metrics.rb # looks like it was merged with no execution permission, pls consider this

And this is the reference we have for setting it up

7.5.2 Adding Hooks for Backup Subsystem Alarms
To enable alerts for backup and restore job statuses, you need to create hooks that will be triggered and monitor the status of the corresponding jobs.

Run the following commands to create the hook template files:

cat <<EOF > /tmp/backup.tmpl 
NAME="backup_state_hook" 
TYPE="api"
ARGUMENTS="$API backup" 
ARGUMENTS_STDIN="YES" 
CALL="one.vm.backup" COMMAND="/var/lib/one/remotes/hooks/update_backup_restore_metrics.rb" 
REMOTE="NO" 
EOF 

cat <<EOF > /tmp/restore.tmpl 
NAME="restore_state_hook" 
TYPE="api"
ARGUMENTS="$API restore" 
ARGUMENTS_STDIN="YES" 
CALL="one.vm.restore" COMMAND="/var/lib/one/remotes/hooks/update_backup_restore_metrics.rb" 
REMOTE="NO" 
EOF
Run the following commands to create the hooks from the template files and cleanup template files:

onehook create /tmp/backup.tmpl
onehook create /tmp/restore.tmpl
rm /tmp/{backup,restore}.tmpl

After the hooks are created, Alertmanager alerts for backup and restore job statuses will start working.

We need to automatically deploy opennebula with this, whenever features.prometheus is set to true in the inventory. Or if you think it shouldn't be tied to that, then have a way to signal it.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Fields

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions