Skip to content

Commit 4335724

Browse files
committed
fix: temporary excluded some metrics from config file for zabbix native agent
1 parent 1829502 commit 4335724

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

mamonsu/plugins/pgsql/autovacuum.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,18 @@ def graphs(self, template, dashboard=False):
9999
def keys_and_queries(self, template_zabbix):
100100
result = []
101101
if LooseVersion(self.VersionPG) >= LooseVersion("10"):
102-
result.append("{0},$2 $1 -Aqtc \"{1}\"".format(self.key_count.format("[*]"),
103-
Pooler.SQL["count_autovacuum"][0].format(
104-
"backend_type = 'autovacuum worker'")))
102+
# TODO: define another metric key because it duplicates native zabbix agents keys
103+
# result.append("{0},$2 $1 -Aqtc \"{1}\"".format(self.key_count.format("[*]"),
104+
# Pooler.SQL["count_autovacuum"][0].format(
105+
# "backend_type = 'autovacuum worker'")))
105106
result.append("{0},$2 $1 -Aqtc \"{1}\"".format(self.key_utilization.format("[*]"),
106107
Pooler.SQL["autovacuum_utilization"][0].format(
107108
"backend_type = 'autovacuum worker'")))
108109
else:
109-
result.append("{0},$2 $1 -Aqtc \"{1}\"".format(self.key_count.format("[*]"),
110-
Pooler.SQL["count_autovacuum"][0].format(
111-
"query LIKE '%%autovacuum%%' AND state <> 'idle' AND pid <> pg_catalog.pg_backend_pid()")))
110+
# TODO: define another metric key because it duplicates native zabbix agents keys
111+
# result.append("{0},$2 $1 -Aqtc \"{1}\"".format(self.key_count.format("[*]"),
112+
# Pooler.SQL["count_autovacuum"][0].format(
113+
# "query LIKE '%%autovacuum%%' AND state <> 'idle' AND pid <> pg_catalog.pg_backend_pid()")))
112114
result.append("{0},$2 $1 -Aqtc \"{1}\"".format(self.key_utilization.format("[*]"),
113115
Pooler.SQL["autovacuum_utilization"][0].format(
114116
"query LIKE '%%autovacuum%%' AND state <> 'idle' AND pid <> pg_catalog.pg_backend_pid()")))

mamonsu/plugins/pgsql/health.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ def triggers(self, template, dashboard=False):
122122
return result
123123

124124
def keys_and_queries(self, template_zabbix):
125-
result = ["{0}[*],$2 $1 -Aqtc \"{1}\"".format(self.key_ping.format(""), self.query_health),
126-
"{0}[*],$2 $1 -Aqtc \"{1}\"".format(self.key_uptime.format(""), self.query_uptime),
127-
"{0}[*],$2 $1 -Aqtc \"{1}\"".format(self.key_version.format(""), self.query_version)]
125+
# TODO: define another metric key because it duplicates native zabbix agents keys
126+
# result = ["{0}[*],$2 $1 -Aqtc \"{1}\"".format(self.key_ping.format(""), self.query_health),
127+
# "{0}[*],$2 $1 -Aqtc \"{1}\"".format(self.key_uptime.format(""), self.query_uptime),
128+
# "{0}[*],$2 $1 -Aqtc \"{1}\"".format(self.key_version.format(""), self.query_version)]
129+
result = ["{0}[*],$2 $1 -Aqtc \"{1}\"".format(self.key_version.format(""), self.query_version)]
128130
return template_zabbix.key_and_query(result)

mamonsu/plugins/system/linux/uptime.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def triggers(self, template, dashboard=False):
4444
}
4545
)
4646

47-
def keys_and_queries(self, template_zabbix):
48-
result = ["system.uptime,{0}".format(self.query_agent)]
49-
return template_zabbix.key_and_query(result)
47+
# TODO: define another metric key because it duplicates native zabbix agents keys
48+
# def keys_and_queries(self, template_zabbix):
49+
# result = ["system.uptime,{0}".format(self.query_agent)]
50+
# return template_zabbix.key_and_query(result)

0 commit comments

Comments
 (0)