Skip to content

Commit 7e97bcc

Browse files
committed
Merge branch 'dev'
2 parents 5a3b231 + b916b50 commit 7e97bcc

File tree

8 files changed

+8
-41
lines changed

8 files changed

+8
-41
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
matrix:
2727
docker_os: ['centos:7']
28-
zabbix_version: ['6.0.2']
28+
zabbix_version: ['6.0.4']
2929
pg_version: ['10', '11', '12', '13', '14']
3030

3131
steps:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
strategy:
2626
matrix:
2727
docker_os: ['ubuntu:20.04', 'centos:7']
28-
zabbix_version: ['4.0.39', '5.0.22', '5.4.12', '6.0.2']
28+
zabbix_version: ['4.0.40', '5.0.23', '5.4.12', '6.0.4']
2929
pg_version: ['10', '11', '12', '13', '14']
3030
exclude:
3131
# excludes PG 9.6 on CentOS 8

documentation/metrics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ Default config:
13041304

13051305
### Triggers
13061306

1307-
1. **Process fork-rate to frequently on {HOSTNAME}**
1307+
1. **Process fork-rate too frequently on {HOSTNAME}**
13081308
Triggers if *Processes: forkrate* greater than 500.
13091309

13101310
2. **System was restarted on {HOSTNAME} (up_time={ITEM.LASTVALUE})**
@@ -2240,7 +2240,7 @@ Default config:
22402240

22412241
### Triggers
22422242

2243-
1. **PostgreSQL required checkpoints occurs to frequently on {HOSTNAME}**
2243+
1. **PostgreSQL required checkpoints occurs too frequently on {HOSTNAME}**
22442244
Triggers if *PostgreSQL checkpoints: by wal (in hour)* exceeds `max_checkpoint_by_wal_in_hour`.
22452245

22462246
### Connections

github-actions-tests/zbx_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ sudo unzip ${ZBX_VERSION}.zip
2424
cd zabbix-docker-${ZBX_VERSION} 2>&1 1>/dev/null
2525
echo "---> Setting up docker with Zabbix ${ZBX_VERSION}..."
2626
# docker-compose dirty hack: it uses only file named 'docker-compose.yml'
27-
yes | sudo cp docker-compose_v3_ubuntu_mysql_latest.yaml docker-compose.yml
27+
yes | sudo cp docker-compose_v3_alpine_mysql_latest.yaml docker-compose.yml
2828
docker-compose -f ./docker-compose.yml up -d
2929
# wait for full set up
3030
sleep 1m

mamonsu/plugins/pgsql/checkpoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def graphs(self, template, dashboard=False):
121121

122122
def triggers(self, template, dashboard=False):
123123
return template.trigger({
124-
"name": "PostgreSQL Checkpoints: required checkpoints occurs to frequently on {HOSTNAME}",
124+
"name": "PostgreSQL Checkpoints: required checkpoints occurs too frequently on {HOSTNAME}",
125125
"expression": "{#TEMPLATE:" + self.right_type(self.key,
126126
self.Items[1][1]) + ".last()}>" + self.plugin_config(
127127
"max_checkpoint_by_wal_in_hour")

mamonsu/plugins/pgsql/databases.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ class Databases(Plugin):
3737
AND l.relation IS NULL;
3838
"""
3939

40-
# PG 14+ queries
41-
query_sessions = """
42-
SELECT {0}
43-
FROM pg_catalog.pg_stat_database
44-
WHERE datname = '{1}';
45-
"""
46-
4740
# queries for zabbix agent
4841
query_agent_discovery = """
4942
SELECT json_build_object ('data',json_agg(json_build_object('{#DATABASE}',d.datname)))
@@ -60,15 +53,6 @@ class Databases(Plugin):
6053
key_autovacumm = "pgsql.autovacumm.count{0}"
6154
key_invalid_indexes = "pgsql.database.invalid_indexes{0}"
6255

63-
# PG 14+ keys
64-
key_db_sessions = [("sessions", "pgsql.database.sessions[{0}]", "Total Number of Sessions", Plugin.UNITS.none, Plugin.VALUE_TYPE.numeric_unsigned),
65-
("sessions_abandoned", "pgsql.database.sessions_abandoned[{0}]", "Client Lost Connection Terminated Sessions", Plugin.UNITS.none, Plugin.VALUE_TYPE.numeric_unsigned),
66-
("sessions_fatal", "pgsql.database.sessions_fatal[{0}]", "Fatal Errors Terminated Sessions", Plugin.UNITS.none, Plugin.VALUE_TYPE.numeric_unsigned),
67-
("sessions_killed", "pgsql.database.sessions_killed[{0}]", "Operator Intervention Terminated Sessions", Plugin.UNITS.none, Plugin.VALUE_TYPE.numeric_unsigned),
68-
("session_time", "pgsql.database.session_time[{0}]", "Time Spent by Sessions", Plugin.UNITS.ms, Plugin.VALUE_TYPE.numeric_float),
69-
("active_time", "pgsql.database.active_time[{0}]", "Time Spent Executing SQL Statements", Plugin.UNITS.ms, Plugin.VALUE_TYPE.numeric_float),
70-
("idle_in_transaction_time", "pgsql.database.idle_in_transaction_time[{0}]", "Time Spent Idling While in a Transaction", Plugin.UNITS.ms, Plugin.VALUE_TYPE.numeric_float)]
71-
7256
DEFAULT_CONFIG = {
7357
"min_rows": str(50),
7458
"bloat_scale": str(0.2)
@@ -94,12 +78,6 @@ def run(self, zbx):
9478
zbx.send("pgsql.database.bloating_tables[{0}]".format(info[0]), int(bloat_count))
9579
invalid_indexes_count = Pooler.query(self.query_invalid_indexes, info[0])[0][0]
9680
zbx.send("pgsql.database.invalid_indexes[{0}]".format(info[0]), int(invalid_indexes_count))
97-
98-
if Pooler.server_version_greater("14"):
99-
for session_item in self.key_db_sessions:
100-
session_result = Pooler.query(self.query_sessions.format(session_item[0], info[0]), info[0])[0][0]
101-
zbx.send(session_item[1].format(info[0]), int(session_result))
102-
10381
zbx.send("pgsql.database.discovery[]", zbx.json({"data": dbs}))
10482
del dbs, bloat_count, invalid_indexes_count
10583

@@ -173,17 +151,6 @@ def discovery_rules(self, template, dashboard=False):
173151
"name": "PostgreSQL Databases: Count of Invalid Indexes in {#DATABASE}",
174152
"delay": self.plugin_config("interval")}
175153
]
176-
177-
if Pooler.server_version_greater("14"):
178-
for session_item in self.key_db_sessions:
179-
items.append({
180-
"key": self.right_type(session_item[1], var_discovery="{#DATABASE},"),
181-
"name": "PostgreSQL Databases {{#DATABASE}}: {0}".format(session_item[2]),
182-
"units": session_item[3],
183-
"value_type": session_item[4],
184-
"delay": self.plugin_config("interval")
185-
})
186-
187154
graphs = [{
188155
"name": "PostgreSQL Databases: {#DATABASE} size",
189156
"type": 1,

mamonsu/plugins/pgsql/wal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def items(self, template, dashboard=False):
129129
"value_type": Plugin.VALUE_TYPE.numeric_float,
130130
"units": Plugin.UNITS.percent,
131131
"type": Plugin.TYPE.CALCULATED,
132-
"params": "last(" + self.key_wal_sync_time + ")/10/" + self.plugin_config("interval")
132+
"params": "last(" + self.key_wal_sync_time + ")/10"
133133
})
134134
if not dashboard:
135135
return result

mamonsu/plugins/system/linux/proc_stat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def graphs(self, template, dashboard=False):
142142
def triggers(self, template, dashboard=False):
143143
return template.trigger(
144144
{
145-
"name": "Process fork-rate to frequently on {HOSTNAME}",
145+
"name": "Process fork-rate too frequently on {HOSTNAME}",
146146
"expression": "{#TEMPLATE:" + self.right_type("system.processes{0}", "forkrate") +
147147
".min(5m)}>" + str(self.ForkRate)
148148
}

0 commit comments

Comments
 (0)