@@ -52,7 +52,7 @@ def items(self, template, dashboard=False):
5252 "value_type" : Plugin .VALUE_TYPE .numeric_float ,
5353 "units" : Plugin .UNITS .percent ,
5454 "type" : Plugin .TYPE .CALCULATED ,
55- "params" : "avg({item}, 5m)" .format (item = self .key_utilization . format ( "[]" )),
55+ "params" : "avg(// {item}, 5m)" .format (item = self .right_type ( self . key_utilization )),
5656 "delay" : self .plugin_config ("interval" )
5757 }))
5858 result += (template .item ({
@@ -61,7 +61,7 @@ def items(self, template, dashboard=False):
6161 "value_type" : Plugin .VALUE_TYPE .numeric_float ,
6262 "units" : Plugin .UNITS .percent ,
6363 "type" : Plugin .TYPE .CALCULATED ,
64- "params" : "avg({item}, 15m)" .format (item = self .key_utilization . format ( "[]" )),
64+ "params" : "avg(// {item}, 15m)" .format (item = self .right_type ( self . key_utilization )),
6565 "delay" : self .plugin_config ("interval" )
6666 }))
6767 result += (template .item ({
@@ -70,7 +70,7 @@ def items(self, template, dashboard=False):
7070 "value_type" : Plugin .VALUE_TYPE .numeric_float ,
7171 "units" : Plugin .UNITS .percent ,
7272 "type" : Plugin .TYPE .CALCULATED ,
73- "params" : "avg({item}, 30m)" .format (item = self .key_utilization . format ( "[]" )),
73+ "params" : "avg(// {item}, 30m)" .format (item = self .right_type ( self . key_utilization )),
7474 "delay" : self .plugin_config ("interval" )
7575 }))
7676 return result
@@ -100,18 +100,18 @@ def keys_and_queries(self, template_zabbix):
100100 result = []
101101 if LooseVersion (self .VersionPG ) >= LooseVersion ("10" ):
102102 # 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("[*]"),
103+ # result.append("{0},$2 $1 -c \"{1}\"".format(self.key_count.format("[*]"),
104104 # Pooler.SQL["count_autovacuum"][0].format(
105105 # "backend_type = 'autovacuum worker'")))
106- result .append ("{0},$2 $1 -Aqtc \" {1}\" " .format (self .key_utilization .format ("[*]" ),
106+ result .append ("{0},$2 $1 -c \" {1}\" " .format (self .key_utilization .format ("[*]" ),
107107 Pooler .SQL ["autovacuum_utilization" ][0 ].format (
108108 "backend_type = 'autovacuum worker'" )))
109109 else :
110110 # 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("[*]"),
111+ # result.append("{0},$2 $1 -c \"{1}\"".format(self.key_count.format("[*]"),
112112 # Pooler.SQL["count_autovacuum"][0].format(
113113 # "query LIKE '%%autovacuum%%' AND state <> 'idle' AND pid <> pg_catalog.pg_backend_pid()")))
114- result .append ("{0},$2 $1 -Aqtc \" {1}\" " .format (self .key_utilization .format ("[*]" ),
114+ result .append ("{0},$2 $1 -c \" {1}\" " .format (self .key_utilization .format ("[*]" ),
115115 Pooler .SQL ["autovacuum_utilization" ][0 ].format (
116116 "query LIKE '%%autovacuum%%' AND state <> 'idle' AND pid <> pg_catalog.pg_backend_pid()" )))
117117 return template_zabbix .key_and_query (result )
0 commit comments