Skip to content

Commit 5a3b231

Browse files
committed
Merge branch 'dev'
2 parents 5c73081 + 3d3506a commit 5a3b231

37 files changed

+292
-264
lines changed

.github/workflows/mamonsu-tests-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
echo "::set-output name=zabbix_address::$(hostname -I | awk '{print $1}')"
6060
id: zabbix_address
6161
- name: Edit Zabbix address in agent.conf
62-
run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.0.conf
62+
run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.4.0.conf
6363

6464
- name: Copy test scripts to container
6565
run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) mkdir -p -m 755 /mamonsu/

.github/workflows/mamonsu-tests-master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
echo "::set-output name=zabbix_address::$(hostname -I | awk '{print $1}')"
6464
id: zabbix_address
6565
- name: Edit Zabbix address in agent.conf
66-
run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.5.0.conf
66+
run: sed -i "s/\(address *= *\).*/\1 ${{ steps.zabbix_address.outputs.zabbix_address }}/" ${{ env.MAMONSU_PATH }}/github-actions-tests/sources/agent_3.4.0.conf
6767

6868
- name: Copy test scripts to container
6969
run: docker exec $( echo "${{ matrix.docker_os }}" | sed 's/://' | sed 's/\.//' ) mkdir -p -m 755 /mamonsu/

github-actions-tests/mamonsu_build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if [ "${OS%:*}" = "centos" ]; then
4545
chmod -R 777 /var/log/mamonsu/
4646
sudo mkdir -p /etc/mamonsu
4747
sudo touch /etc/mamonsu/agent.conf
48-
cat /mamonsu/github-actions-tests/sources/agent_3.5.0.conf > /etc/mamonsu/agent.conf
48+
cat /mamonsu/github-actions-tests/sources/agent_3.4.0.conf > /etc/mamonsu/agent.conf
4949
chmod -R 777 /etc/mamonsu/
5050
sudo yum -y install ./mamonsu*.rpm
5151
systemctl daemon-reload
@@ -74,7 +74,7 @@ elif [ "${OS%:*}" = "ubuntu" ]; then
7474
chmod -R 777 /var/log/mamonsu/
7575
sudo mkdir -p /etc/mamonsu
7676
sudo touch /etc/mamonsu/agent.conf
77-
cat /mamonsu/github-actions-tests/sources/agent_3.5.0.conf > /etc/mamonsu/agent.conf
77+
cat /mamonsu/github-actions-tests/sources/agent_3.4.0.conf > /etc/mamonsu/agent.conf
7878
chmod -R 777 /etc/mamonsu/
7979
sudo apt-get -y install ./mamonsu*.deb
8080
service mamonsu restart

github-actions-tests/sources/agent_3.5.0.conf renamed to github-actions-tests/sources/agent_3.4.0.conf

Lines changed: 66 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -81,29 +81,17 @@ format = [%(levelname)s] %(asctime)s - %(name)s - %(message)s
8181
max_memory_usage = 41943040
8282
interval = 15
8383

84-
[archivecommand]
85-
max_count_files = 2
86-
interval = 15
87-
8884
[bgwriter]
8985
interval = 15
9086

91-
[cfs]
92-
force_enable = False
93-
interval = 15
94-
95-
[checkpoint]
96-
max_checkpoint_by_wal_in_hour = 12
97-
interval = 300
98-
9987
[connections]
10088
percent_connections_tr = 90
10189
interval = 15
10290

10391
[databases]
10492
bloat_scale = 0.2
10593
min_rows = 50
106-
interval = 300
94+
interval = 15
10795

10896
[pghealth]
10997
uptime = 600
@@ -113,84 +101,82 @@ interval = 15
113101
[instance]
114102
interval = 15
115103

116-
# This plugin allows detects possible memory leaks while working with PostgreSQL using /proc/pid/status and /proc/pid/statm
117-
# We use RES and SHR difference to calculate approximate volume of private anonymous backend memory.
118-
# If it exceeds private_anon_mem_threshold then that pid will be added to a message. An example is presented below
119-
# statm - 'pid: {pid}, RES {RES} - SHR {SHR} more then {private_anon_mem_threshold}\n'
120-
# Since Linux 4.5 RssAnon, RssFile and RssShmem have been added.
121-
# They allows to distinguish types of memory such as private anonymous, file-backed, and shared anonymous memory.
122-
# We are interested in RssAnon. If its value exceeds private_anon_mem_threshold then that pid will also be added to a message.
123-
# By default this plugin disabled. To enable this plugin - set bellow "enabled = False"
124-
# #interval - (onitoring frequency in seconds. 60 seconds by default
125-
# private_anon_mem_threshold - memory volume threshold after which we need an investigation about memory leak. 1GB by default.
126-
# Possible values MB, GB, TB. For example 1GB
127-
[memoryleakdiagnostic]
128-
enabled = True
104+
[xlog]
105+
lag_more_than_in_sec = 300
129106
interval = 15
130-
private_anon_mem_threshold = 1GB
131107

132-
[oldest]
133-
max_xid_age = 18000000
134-
max_query_time = 18000
108+
[statements]
135109
interval = 15
136110

137111
[pgbuffercache]
138112
interval = 15
139113

140-
[pglocks]
114+
[waitsampling]
141115
interval = 15
142116

143-
# Get age (in seconds) of the oldest running prepared transaction and number of all prepared transactions for two-phase commit.
144-
# https://www.postgresql.org/docs/current/sql-prepare-transaction.html
145-
# https://www.postgresql.org/docs/12/view-pg-prepared-xacts.html
146-
# max_prepared_transaction_time - age of prepared transaction in seconds.
147-
# If pgsql.prepared.oldest exceeds max_prepared_transaction_time the trigger fires.
148-
[preparedtransaction]
149-
max_prepared_transaction_time = 60
117+
[checkpoint]
118+
max_checkpoint_by_wal_in_hour = 12
150119
interval = 15
151120

152-
# Get size of relations defined in this section
153-
# Relations - comma separated list of objects - tables and endexes (database_name.schema.relation) used to calculate relations size.
154-
# Example:
155-
# relations=postgres.pg_catalog.pg_class,postgres.pg_catalog.pg_user
156-
# If the relation is blocked by some process such as vacuum full or create index, the result will be -1
157-
# by default this plugin disabled. To enable this plugin - set bellow "enabled = False" and define a list of relations.
158-
[relationssize]
159-
enabled = True
160-
relations=postgres.pg_catalog.pg_class,mamonsu_test_db.mamonsu.config
161-
interval = 300
121+
[oldest]
122+
max_xid_age = 18000000
123+
max_query_time = 18000
124+
interval = 15
162125

163-
[replication]
164-
lag_more_than_in_sec = 300
126+
[pglocks]
165127
interval = 15
166128

167-
[statstatements]
129+
[cfs]
130+
force_enable = False
168131
interval = 15
169132

170-
[waitsampling]
133+
[archivecommand]
134+
max_count_files = 2
135+
interval = 15
136+
137+
[procstat]
171138
interval = 15
172139

173-
[wal]
140+
[diskstats]
174141
interval = 15
175142

176143
[disksizes]
177144
vfs_percent_free = 10
178145
vfs_inode_percent_free = 10
179146
interval = 15
180147

181-
[diskstats]
148+
[memory]
182149
interval = 15
183150

184-
[la]
151+
[systemuptime]
152+
up_time = 300
185153
interval = 15
186154

187-
[memory]
155+
[openfiles]
188156
interval = 15
189157

190158
[net]
191159
interval = 15
192160

193-
[openfiles]
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
194180
interval = 15
195181

196182
# Get size of backup catalogs stroring all WAL and backup files using pg_probackup
@@ -202,18 +188,29 @@ interval = 300
202188
backup_dirs = /backup_dir1,/backup_dir2
203189
pg_probackup_path = /usr/bin/pg_probackup-11
204190

205-
[procstat]
206-
interval = 15
207-
208-
[systemuptime]
209-
up_time = 300
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
210200
interval = 15
211201

212-
[agentapi]
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
213215
interval = 15
214-
215-
[logsender]
216-
interval = 2
217-
218-
[zbxsender]
219-
interval = 10
216+
private_anon_mem_threshold = 1GB

mamonsu/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__author__ = 'Dmitry Vasilyev'
22
__author_email__ = '[email protected]'
33
__description__ = 'Monitoring agent for PostgreSQL'
4-
__version__ = '3.5.0'
4+
__version__ = '3.4.0'
55
__licence__ = 'BSD'
66

77
__url__ = 'https://github.com/postgrespro/mamonsu'

mamonsu/lib/zbx_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class ZbxTemplate(object):
9191

9292
graph_items_defaults = [
9393
('sortorder', None), ('drawtype', 0),
94-
('color', '578159'), ('yaxisside', 0),
94+
('color', '00CC00'), ('yaxisside', 0),
9595
('calc_fnc', 2), ('type', Template.GRAPH_TYPE.normal)
9696
]
9797

mamonsu/plugins/pgsql/archive_command.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ class ArchiveCommand(Plugin):
5757
key = "pgsql.archive_command{0}"
5858
Items = [
5959
# key, desc, color, side, graph, delta, units
60-
("count_files_to_archive", "Files in archive_status Need to Archive Count", "9C8A4E", 0, 1, Plugin.DELTA.as_is, Plugin.UNITS.none),
60+
("count_files_to_archive", "Files in archive_status Need to Archive Count", "006AAE", 0, 1, Plugin.DELTA.as_is, Plugin.UNITS.none),
6161
("size_files_to_archive", "Files Need to Archive Size", "793F5D", 0, 0, Plugin.DELTA.as_is, Plugin.UNITS.bytes),
62-
("archived_files", "Archived Files Count", "578159", 0, 1, Plugin.DELTA.simple_change, Plugin.UNITS.none),
63-
("failed_trying_to_archive", "Attempts to Archive Files Count", "E57862", 0, 1, Plugin.DELTA.simple_change, Plugin.UNITS.none),
62+
("archived_files", "Archived Files Count", "00CC00", 0, 1, Plugin.DELTA.simple_change, Plugin.UNITS.none),
63+
("failed_trying_to_archive", "Attempts to Archive Files Count", "FF5656", 0, 1, Plugin.DELTA.simple_change, Plugin.UNITS.none),
6464
]
6565
old_archived_count = None
6666
old_failed_count = None

mamonsu/plugins/pgsql/bgwriter.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,32 @@ class BgWriter(Plugin):
1818

1919
("buffers_checkpoint", "bgwriter[buffers_checkpoint]",
2020
"Buffers Written During Checkpoints",
21-
("PostgreSQL bgwriter", "793F5D", 1),
21+
("PostgreSQL bgwriter", "006AAE", 1),
2222
Plugin.DELTA.simple_change),
2323

2424
("buffers_clean", "bgwriter[buffers_clean]",
2525
"Buffers Written",
26-
("PostgreSQL bgwriter", "9C8A4E", 1),
26+
("PostgreSQL bgwriter", "00CC00", 1),
2727
Plugin.DELTA.simple_change),
2828

2929
("maxwritten_clean", "bgwriter[maxwritten_clean]",
3030
"Number of bgwriter Stopped by Max Write Count",
31-
("PostgreSQL bgwriter", "00B0B8", 0),
31+
("PostgreSQL bgwriter", "FF5656", 0),
3232
Plugin.DELTA.simple_change),
3333

3434
("buffers_backend", "bgwriter[buffers_backend]",
3535
"Buffers Written Directly by a Backend",
36-
("PostgreSQL bgwriter", "7EB29B", 1),
36+
("PostgreSQL bgwriter", "9C8A4E", 1),
3737
Plugin.DELTA.simple_change),
3838

3939
("buffers_backend_fsync", "bgwriter[buffers_backend_fsync]",
4040
"Times a Backend Execute Its Own Fsync",
41-
("PostgreSQL bgwriter", "9C8A4E", 0),
41+
("PostgreSQL bgwriter", "00CC00", 0),
4242
Plugin.DELTA.simple_change),
4343

4444
("buffers_alloc", "bgwriter[buffers_alloc]",
4545
"Buffers Allocated",
46-
("PostgreSQL bgwriter", "3B415A", 1),
46+
("PostgreSQL bgwriter", "FF5656", 1),
4747
Plugin.DELTA.simple_change)
4848
]
4949

mamonsu/plugins/pgsql/cfs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def discovery_rules(self, template, dashboard=False):
155155
"name": "PostgreSQL CFS: Relation {#COMPRESSED_RELATION} Compress Ratio",
156156
"delay": self.timeRatioInterval,
157157
"items": [{
158-
"color": "8B817C",
158+
"color": "A39B98",
159159
"key": "pgsql.cfs.compress_ratio[{#COMPRESSED_RELATION}]"
160160
}]
161161
}]

mamonsu/plugins/pgsql/checkpoint.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@ class Checkpoint(Plugin):
2929

3030
("checkpoints_timed", "count_timed",
3131
"by Timeout (in hour)",
32-
("PostgreSQL: checkpoint", "578159", 0),
32+
("PostgreSQL: checkpoint", "00CC00", 0),
3333
Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60),
3434

3535
("checkpoints_req", "count_wal",
3636
"by WAL (in hour)",
37-
("PostgreSQL: Checkpoint", "793F5D", 0),
37+
("PostgreSQL: Checkpoint", "FF5656", 0),
3838
Plugin.UNITS.none, Plugin.DELTA.speed_per_second, 60 * 60),
3939

4040
("checkpoint_write_time", "write_time",
4141
"Write Time",
42-
("PostgreSQL: Checkpoints", "00B0B8", 1),
42+
("PostgreSQL: Checkpoints", "00CC00", 1),
4343
Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1),
4444

4545
("checkpoint_sync_time", "checkpoint_sync_time",
4646
"Sync Time",
47-
("PostgreSQL: checkpoints", "9C8A4E", 1),
47+
("PostgreSQL: checkpoints", "FF5656", 1),
4848
Plugin.UNITS.ms, Plugin.DELTA.speed_per_second, 1)
4949
]
5050

0 commit comments

Comments
 (0)