postgrespro/mamonsu

Backup?

killmasta93 opened this issue · 8 comments

Hi,
I was wondering if the mamonsu template monitors backups? I was checking on the READ me file it seems that it has it but cant seemed to activate
Thank you

Hi ! We have a pgprobackup plugin
In order to enable it, in the agent.conf in the [pgprobackup] section change enabled to True and edit backup_dirs and pg_probackup_path

thanks for the reply, i didnt find that part not sure if i need to add it?

root@postgre:~# cat /etc/mamonsu/agent.conf
[postgres]
enabled = True
user = zabbix
password = mypassword
database = zabbix
host = localhost
port = 5432
application_name = mamonsu
query_timeout = 10

[system]
enabled = True

[sender]
queue = 2048

[agent]
enabled = True
host = 127.0.0.1
port = 10052

[plugins]
enabled = False
directory = /etc/mamonsu/plugins

[zabbix]
enabled = True
client = Zabbix server
address = 192.168.3.132
port = 10051

[metric_log]
enabled = False
directory = /var/log/mamonsu
max_size_mb = 1024

[log]
file = None
level = INFO
format = [%(levelname)s] %(asctime)s - %(name)s	-	%(message)s

[health]
max_memory_usage = 41943040
interval = 60

[bgwriter]
interval = 60

[connections]
percent_connections_tr = 90
interval = 60

[databases]
bloat_scale = 0.2
min_rows = 50
interval = 300

[pghealth]
uptime = 600
cache = 80
interval = 60

[instance]
interval = 60

[xlog]
lag_more_then_in_sec = 300
interval = 60

[pgstatstatement]
interval = 60

[pgbuffercache]
interval = 60

[pgwaitsampling]
interval = 60

[checkpoint]
max_checkpoint_by_wal_in_hour = 12
interval = 300

[oldest]
max_transaction_time = 18000
max_xid_age = 18000000
max_query_time = 18000
interval = 60

[pglocks]
interval = 60

[cfs]
force_enable = False
interval = 60

[archivecommand]
max_count_files = 2
interval = 60

[procstat]
interval = 60

[diskstats]
interval = 60

[disksizes]
vfs_percent_free = 10
vfs_inode_percent_free = 10
interval = 60

[memory]
interval = 60

[systemuptime]
up_time = 300
interval = 60

[openfiles]
interval = 60

[net]
interval = 60

[la]
interval = 60

[zbxsender]
interval = 10

[logsender]
interval = 2

[agentapi]
interval = 60

You can add this section to the file /etc/mamonsu/agent.conf

# Get size of backup catalogs stroring all WAL and backup files using pg_probackup
# (https://github.com/postgrespro/pg_probackup)
# Trigger fires if some backup has bad status e.g. (ERROR,CORRUPT,ORPHAN).
[pgprobackup]
enabled = True
interval = 300
backup_dirs = /backup_dir1,/backup_dir2
pg_probackup_path = /usr/bin/pg_probackup-11

thanks for the reply, so i added and restart the service and how can i run it?
as for the interval is it every 300 mins?

You need to update template in zabbix server and restart mamonsu.

Mamonsu has item "Pg_probackup dir {#BACKUPDIR}: size" (key pg_probackup.dir.size[#BACKUPDIR]) - size of backup dir
and trigger. If the command pg_probackup show -B dir has error ('ERROR', 'CORRUPT', 'ORPHAN') then the trigger starts.

interval = 300 - in second.

thanks for the reply, i tried running the command but couldnt find it

root@postgre:~# pg_
pg_archivecleanup  pg_buildext        pg_conftool        pg_ctlcluster      pg_dump            pg_isready         pg_receivewal      pg_recvlogical     pg_restore         pg_updatedicts     pg_virtualenv      
pg_basebackup      pg_config          pg_createcluster   pg_dropcluster     pg_dumpall         pg_lsclusters      pg_receivexlog     pg_renamecluster   pg_top             pg_upgradecluster 

Sorry for long answer.
This utility does not come with postgresql.

You can download and install pg_probackup from github https://github.com/postgrespro/pg_probackup
Documentation - https://postgrespro.com/docs/postgrespro/13/app-pgprobackup

thanks again for the reply, so i configured the pg_probackup, just having trouble configuring it i will post backup once i have it configured correctly