Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send alert for Backup error (ocrvs_8054) #349

Merged
merged 4 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions infrastructure/logrotate.conf
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ include /etc/logrotate.d
rotate 1
}

/var/log/opencrvs-backup.error.log {
missingok
monthly
create 0660 root application
rotate 1
}

/var/log/papertrail.log {
missingok
monthly
Expand Down
4 changes: 4 additions & 0 deletions infrastructure/monitoring/filebeat/filebeat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ filebeat.inputs:
enabled: true
paths:
- /var/log/opencrvs-backup.log
- type: log
enabled: true
paths:
- /var/log/opencrvs-backup.error.log
- type: log
enabled: true
paths:
Expand Down
8 changes: 8 additions & 0 deletions infrastructure/server-setup/tasks/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@
state: touch
mode: 'u+rwX,g+rwX,o-rwx'

- name: Create backup logfile for error
ansible.builtin.file:
path: /var/log/opencrvs-backup.error.log
owner: '{{ ansible_user }}'
group: 'application'
state: touch
mode: 'u+rwX,g+rwX,o-rwx'

- name: Create restore logfile
ansible.builtin.file:
path: /var/log/opencrvs-restore.log
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/server-setup/tasks/backups/crontab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
name: 'backup opencrvs'
minute: '0'
hour: '0'
job: 'bash {{ crontab_user_home }}/backup.sh --passphrase={{ backup_encryption_passphrase }} --ssh_user={{ backup_server_user }} --ssh_host={{ backup_hostname }} --ssh_port={{ backup_port }} --remote_dir={{ backup_server_remote_target_directory }} --replicas=1 >> /var/log/opencrvs-backup.log 2>&1'
job: 'bash {{ crontab_user_home }}/backup.sh --passphrase={{ backup_encryption_passphrase }} --ssh_user={{ backup_server_user }} --ssh_host={{ backup_hostname }} --ssh_port={{ backup_port }} --remote_dir={{ backup_server_remote_target_directory }} --replicas=1 >> /var/log/opencrvs-backup.log 2>> /var/log/opencrvs-backup.error.log'
state: "{{ 'present' if (backup_hostname is defined and backup_encryption_passphrase and (enable_backups | default(false))) else 'absent' }}"

##
Expand Down
Loading