mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
puppet: Rename check_postgres_backup to check_postgresql_backup.
This commit is contained in:
committed by
Tim Abbott
parent
45f6c79c4a
commit
53e59a0a13
@@ -177,7 +177,7 @@ PostgreSQL server to add:
|
|||||||
`/home/zulip/deployments/current/scripts/zulip-puppet-apply`. You
|
`/home/zulip/deployments/current/scripts/zulip-puppet-apply`. You
|
||||||
can (and should) monitor that backups are running regularly via
|
can (and should) monitor that backups are running regularly via
|
||||||
the Nagios plugin installed into
|
the Nagios plugin installed into
|
||||||
`/usr/lib/nagios/plugins/zulip_postgres_backups/check_postgres_backup`.
|
`/usr/lib/nagios/plugins/zulip_postgresql_backups/check_postgresql_backup`.
|
||||||
|
|
||||||
* Any user-uploaded files. If you're using S3 as storage for file
|
* Any user-uploaded files. If you're using S3 as storage for file
|
||||||
uploads, this is backed up in S3. But if you have instead set
|
uploads, this is backed up in S3. But if you have instead set
|
||||||
@@ -226,7 +226,7 @@ installation from one server to another.
|
|||||||
We recommend running a disaster recovery after setting up your backups to
|
We recommend running a disaster recovery after setting up your backups to
|
||||||
confirm that your backups are working. You may also want to monitor
|
confirm that your backups are working. You may also want to monitor
|
||||||
that they are up to date using the Nagios plugin at:
|
that they are up to date using the Nagios plugin at:
|
||||||
`puppet/zulip/files/nagios_plugins/zulip_postgres_backups/check_postgres_backup`.
|
`puppet/zulip/files/nagios_plugins/zulip_postgresql_backups/check_postgresql_backup`.
|
||||||
|
|
||||||
## Postgres streaming replication
|
## Postgres streaming replication
|
||||||
|
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ Database monitoring:
|
|||||||
* `check_fts_update_log`: Checks whether full-text search updates are
|
* `check_fts_update_log`: Checks whether full-text search updates are
|
||||||
being processed properly or getting backlogged.
|
being processed properly or getting backlogged.
|
||||||
* `check_postgres`: General checks for database health.
|
* `check_postgres`: General checks for database health.
|
||||||
* `check_postgres_backup`: Checks status of Postgres backups.
|
* `check_postgresql_backup`: Checks status of Postgres backups.
|
||||||
* `check_postgres_replication_lag`: Checks whether Postgres streaming
|
* `check_postgres_replication_lag`: Checks whether Postgres streaming
|
||||||
replication is up to date.
|
replication is up to date.
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ if subprocess.check_output(['psql', '-v', 'ON_ERROR_STOP=1',
|
|||||||
report('OK', 'this is not the primary')
|
report('OK', 'this is not the primary')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with open('/var/lib/nagios_state/last_postgres_backup') as f:
|
with open('/var/lib/nagios_state/last_postgresql_backup') as f:
|
||||||
last_backup = dateutil.parser.parse(f.read())
|
last_backup = dateutil.parser.parse(f.read())
|
||||||
except OSError:
|
except OSError:
|
||||||
report('UNKNOWN', 'could not determine completion time of last Postgres backup')
|
report('UNKNOWN', 'could not determine completion time of last Postgres backup')
|
||||||
@@ -41,7 +41,7 @@ pg_data_path = pg_data_paths[0]
|
|||||||
run(['env-wal-g', 'backup-push', pg_data_path])
|
run(['env-wal-g', 'backup-push', pg_data_path])
|
||||||
|
|
||||||
now = datetime.now(tz=timezone.utc)
|
now = datetime.now(tz=timezone.utc)
|
||||||
with open('/var/lib/nagios_state/last_postgres_backup', 'w') as f:
|
with open('/var/lib/nagios_state/last_postgresql_backup', 'w') as f:
|
||||||
f.write(now.isoformat())
|
f.write(now.isoformat())
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
|
|
||||||
|
|||||||
@@ -50,13 +50,13 @@ class zulip::postgresql_backups {
|
|||||||
require => File['/usr/local/bin/pg_backup_and_purge'],
|
require => File['/usr/local/bin/pg_backup_and_purge'],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "${zulip::common::nagios_plugins_dir}/zulip_postgres_backups":
|
file { "${zulip::common::nagios_plugins_dir}/zulip_postgresql_backups":
|
||||||
require => Package[$zulip::common::nagios_plugins],
|
require => Package[$zulip::common::nagios_plugins],
|
||||||
recurse => true,
|
recurse => true,
|
||||||
purge => true,
|
purge => true,
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
mode => '0755',
|
mode => '0755',
|
||||||
source => 'puppet:///modules/zulip/nagios_plugins/zulip_postgres_backups',
|
source => 'puppet:///modules/zulip/nagios_plugins/zulip_postgresql_backups',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,8 +162,8 @@ define command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
define command {
|
define command {
|
||||||
command_name check_postgres_backup
|
command_name check_postgresql_backup
|
||||||
command_line /usr/lib/nagios/plugins/check_by_ssh -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_postgres_backups/check_postgres_backup'
|
command_line /usr/lib/nagios/plugins/check_by_ssh -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_postgresql_backups/check_postgresql_backup'
|
||||||
}
|
}
|
||||||
|
|
||||||
define command {
|
define command {
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ define service{
|
|||||||
define service {
|
define service {
|
||||||
use generic-service
|
use generic-service
|
||||||
service_description Check last Postgres backup time
|
service_description Check last Postgres backup time
|
||||||
check_command check_postgres_backup
|
check_command check_postgresql_backup
|
||||||
hostgroup postgresql
|
hostgroup postgresql
|
||||||
contact_groups admins
|
contact_groups admins
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user