|
| 1 | +# This is a configuration file for mamonsu |
| 2 | +# To get more information about mamonsu, visit https://postgrespro.ru/docs/postgrespro/12/mamonsu |
| 3 | + |
| 4 | +######### Connection parameters sections ############## |
| 5 | + |
| 6 | +# specify connection parameters for the Postgres cluster |
| 7 | +# in the user, password, and database fields, you must specify the mamonsu_user, mamonsu_password, |
| 8 | +# and the mamonsu_database used for bootstrap, respectively. |
| 9 | +# if you skipped the bootstrap, specify a superuser credentials and the database to connect to. |
| 10 | + |
| 11 | +[postgres] |
| 12 | +enabled = True |
| 13 | +user = mamonsu |
| 14 | +password = mamonsu |
| 15 | +database = mamonsu_test_db |
| 16 | +host = localhost |
| 17 | +port = 5432 |
| 18 | +application_name = mamonsu |
| 19 | +query_timeout = 10 |
| 20 | + |
| 21 | +# the address field must point to the running Zabbix server, while the client field must provide the name of |
| 22 | +# the Zabbix host. You can find the list of hosts available for your account in the Zabbix web |
| 23 | +# interface under Configuration > Hosts. |
| 24 | +# re_send - True - in case of transmission error, mamonsu repeats sending metrics one by one to look in log metrics with error |
| 25 | + |
| 26 | +[zabbix] |
| 27 | +enabled = True |
| 28 | +client = pg-master |
| 29 | +address = 127.0.0.1 |
| 30 | +port = 10051 |
| 31 | +timeout = 15 |
| 32 | +re_send = False |
| 33 | + |
| 34 | +######### General parameters sections ############ |
| 35 | + |
| 36 | +# enable or disable collection of system metrics. |
| 37 | + |
| 38 | +[system] |
| 39 | +enabled = True |
| 40 | + |
| 41 | +# control the queue size of the data to be sent to the Zabbix server |
| 42 | + |
| 43 | +[sender] |
| 44 | +queue = 2048 |
| 45 | + |
| 46 | +# specify the location of mamonsu and whether it is allowed to access metrics from the command line |
| 47 | + |
| 48 | +[agent] |
| 49 | +enabled = True |
| 50 | +host = 127.0.0.1 |
| 51 | +port = 10052 |
| 52 | + |
| 53 | +# specify custom plugins to be added for metrics collection |
| 54 | + |
| 55 | +[plugins] |
| 56 | +enabled = False |
| 57 | +directory = /etc/mamonsu/plugins |
| 58 | + |
| 59 | +# enable storing the collected metric data in text files locally. |
| 60 | + |
| 61 | +[metric_log] |
| 62 | +enabled = False |
| 63 | +directory = /var/log/mamonsu |
| 64 | +max_size_mb = 1024 |
| 65 | + |
| 66 | +# specify logging settings for mamonsu |
| 67 | + |
| 68 | +[log] |
| 69 | +file = /var/log/mamonsu/mamonsu.log |
| 70 | +level = DEBUG |
| 71 | +format = [%(levelname)s] %(asctime)s - %(name)s - %(message)s |
| 72 | + |
| 73 | +######### Individual Plugin Sections ############ |
| 74 | + |
| 75 | +# to disable any plugin set the enabled option to False. |
| 76 | +# modify collection interval for each plugin in the interval field. |
| 77 | +# set customer parameters for some plugins in the individual section. |
| 78 | +# below listed all available parameters for each plugin to modify. |
| 79 | + |
| 80 | +[health] |
| 81 | +max_memory_usage = 41943040 |
| 82 | +interval = 15 |
| 83 | + |
| 84 | +[bgwriter] |
| 85 | +interval = 15 |
| 86 | + |
| 87 | +[connections] |
| 88 | +percent_connections_tr = 90 |
| 89 | +interval = 15 |
| 90 | + |
| 91 | +[databases] |
| 92 | +bloat_scale = 0.2 |
| 93 | +min_rows = 50 |
| 94 | +interval = 15 |
| 95 | + |
| 96 | +[pghealth] |
| 97 | +uptime = 600 |
| 98 | +cache = 80 |
| 99 | +interval = 15 |
| 100 | + |
| 101 | +[instance] |
| 102 | +interval = 15 |
| 103 | + |
| 104 | +[xlog] |
| 105 | +lag_more_than_in_sec = 300 |
| 106 | +interval = 15 |
| 107 | + |
| 108 | +[statements] |
| 109 | +interval = 15 |
| 110 | + |
| 111 | +[pgbuffercache] |
| 112 | +interval = 15 |
| 113 | + |
| 114 | +[waitsampling] |
| 115 | +interval = 15 |
| 116 | + |
| 117 | +[checkpoint] |
| 118 | +max_checkpoint_by_wal_in_hour = 12 |
| 119 | +interval = 15 |
| 120 | + |
| 121 | +[oldest] |
| 122 | +max_xid_age = 18000000 |
| 123 | +max_query_time = 18000 |
| 124 | +interval = 15 |
| 125 | + |
| 126 | +[pglocks] |
| 127 | +interval = 15 |
| 128 | + |
| 129 | +[cfs] |
| 130 | +force_enable = False |
| 131 | +interval = 15 |
| 132 | + |
| 133 | +[archivecommand] |
| 134 | +max_count_files = 2 |
| 135 | +interval = 15 |
| 136 | + |
| 137 | +[procstat] |
| 138 | +interval = 15 |
| 139 | + |
| 140 | +[diskstats] |
| 141 | +interval = 15 |
| 142 | + |
| 143 | +[disksizes] |
| 144 | +vfs_percent_free = 10 |
| 145 | +vfs_inode_percent_free = 10 |
| 146 | +interval = 15 |
| 147 | + |
| 148 | +[memory] |
| 149 | +interval = 15 |
| 150 | + |
| 151 | +[systemuptime] |
| 152 | +up_time = 300 |
| 153 | +interval = 15 |
| 154 | + |
| 155 | +[openfiles] |
| 156 | +interval = 15 |
| 157 | + |
| 158 | +[net] |
| 159 | +interval = 15 |
| 160 | + |
| 161 | +[la] |
| 162 | +interval = 15 |
| 163 | + |
| 164 | +[zbxsender] |
| 165 | +interval = 10 |
| 166 | + |
| 167 | +[logsender] |
| 168 | +interval = 2 |
| 169 | + |
| 170 | +[agentapi] |
| 171 | +interval = 15 |
| 172 | + |
| 173 | +# Get age (in seconds) of the oldest running prepared transaction and number of all prepared transactions for two-phase commit. |
| 174 | +# https://www.postgresql.org/docs/current/sql-prepare-transaction.html |
| 175 | +# https://www.postgresql.org/docs/12/view-pg-prepared-xacts.html |
| 176 | +# max_prepared_transaction_time - age of prepared transaction in seconds. |
| 177 | +# If pgsql.prepared.oldest exceeds max_prepared_transaction_time the trigger fires. |
| 178 | +[preparedtransaction] |
| 179 | +max_prepared_transaction_time = 60 |
| 180 | +interval = 15 |
| 181 | + |
| 182 | +# Get size of backup catalogs stroring all WAL and backup files using pg_probackup |
| 183 | +# (https://github.com/postgrespro/pg_probackup) |
| 184 | +# Trigger fires if some backup has bad status e.g. (ERROR,CORRUPT,ORPHAN). |
| 185 | +[pgprobackup] |
| 186 | +enabled = False |
| 187 | +interval = 300 |
| 188 | +backup_dirs = /backup_dir1,/backup_dir2 |
| 189 | +pg_probackup_path = /usr/bin/pg_probackup-11 |
| 190 | + |
| 191 | +# Get size of relations defined in this section |
| 192 | +# Relations - comma separated list of objects - tables and endexes (database_name.schema.relation) used to calculate relations size. |
| 193 | +# Example: |
| 194 | +# relations=postgres.pg_catalog.pg_class,postgres.pg_catalog.pg_user |
| 195 | +# If the relation is blocked by some process such as vacuum full or create index, the result will be -1 |
| 196 | +# by default this plugin disabled. To enable this plugin - set bellow "enabled = False" and define a list of relations. |
| 197 | +[relationssize] |
| 198 | +enabled = True |
| 199 | +relations=postgres.pg_catalog.pg_class,mamonsu_test_db.mamonsu.config |
| 200 | +interval = 15 |
| 201 | + |
| 202 | +# This plugin allows detects possible memory leaks while working with PostgreSQL using /proc/pid/status and /proc/pid/statm |
| 203 | +# We use RES and SHR difference to calculate approximate volume of private anonymous backend memory. |
| 204 | +# If it exceeds private_anon_mem_threshold then that pid will be added to a message. An example is presented below |
| 205 | +# statm - 'pid: {pid}, RES {RES} - SHR {SHR} more then {private_anon_mem_threshold}\n' |
| 206 | +# Since Linux 4.5 RssAnon, RssFile and RssShmem have been added. |
| 207 | +# They allows to distinguish types of memory such as private anonymous, file-backed, and shared anonymous memory. |
| 208 | +# We are interested in RssAnon. If its value exceeds private_anon_mem_threshold then that pid will also be added to a message. |
| 209 | +# By default this plugin disabled. To enable this plugin - set bellow "enabled = False" |
| 210 | +# #interval - (onitoring frequency in seconds. 60 seconds by default |
| 211 | +# private_anon_mem_threshold - memory volume threshold after which we need an investigation about memory leak. 1GB by default. |
| 212 | +# Possible values MB, GB, TB. For example 1GB |
| 213 | +[memoryleakdiagnostic] |
| 214 | +enabled = True |
| 215 | +interval = 15 |
| 216 | +private_anon_mem_threshold = 1GB |
0 commit comments