@@ -34,7 +34,7 @@ def items(self, template):
3434 delay = self .plugin_config ('interval' )
3535 value_type = Plugin .VALUE_TYPE .numeric_unsigned
3636 else :
37- delay = 5 # TODO check delay
37+ delay = 5 # TODO check delay
3838 value_type = Plugin .VALUE_TYPE .numeric_float
3939 result += template .item ({
4040 'name' : 'PostgreSQL: ping' ,
@@ -44,7 +44,7 @@ def items(self, template):
4444 'delay' : delay
4545 }) + template .item ({
4646 'name' : 'PostgreSQL: cache hit ratio' ,
47- 'key' : self .right_type (self .key_cache , "hit" ),
47+ 'key' : self .right_type (self .key_cache , "hit" ),
4848 'value_type' : value_type ,
4949 'delay' : self .plugin_config ('interval' ),
5050 'units' : Plugin .UNITS .percent
@@ -68,12 +68,12 @@ def graphs(self, template):
6868 def triggers (self , template ):
6969 result = template .trigger ({
7070 'name' : 'PostgreSQL service was restarted on '
71- '{HOSTNAME} (uptime={ITEM.LASTVALUE})' ,
71+ '{HOSTNAME} (uptime={ITEM.LASTVALUE})' ,
7272 'expression' : '{#TEMPLATE:' + self .right_type (self .key_uptime ) + '.last()}<' +
7373 str (self .plugin_config ('uptime' ))
7474 }) + template .trigger ({
7575 'name' : 'PostgreSQL cache hit ratio too low on '
76- '{HOSTNAME} ({ITEM.LASTVALUE})' ,
76+ '{HOSTNAME} ({ITEM.LASTVALUE})' ,
7777 'expression' : '{#TEMPLATE:' + self .right_type (self .key_cache , "hit" ) + '.last()}<' +
7878 str (self .plugin_config ('cache' ))
7979 }) + template .trigger ({
@@ -84,8 +84,7 @@ def triggers(self, template):
8484 return result
8585
8686 def keys_and_queries (self , template_zabbix ):
87- result = []
88- result .append ('{0}[*],$2 $1 -c "{1}"' .format (self .key_ping .format ('' ), self .query_health ))
89- result .append ('{0}[*],$2 $1 -c "{1}"' .format (self .key_uptime .format ('' ), self .query_uptime ))
90- result .append ('{0}[*],$2 $1 -c "{1}"' .format (self .key_cache .format ('.hit' ), self .query_cache ))
91- return template_zabbix .key_and_query (result )
87+ result = ['{0}[*],$2 $1 -c "{1}"' .format (self .key_ping .format ('' ), self .query_health ),
88+ '{0}[*],$2 $1 -c "{1}"' .format (self .key_uptime .format ('' ), self .query_uptime ),
89+ '{0}[*],$2 $1 -c "{1}"' .format (self .key_cache .format ('.hit' ), self .query_cache )]
90+ return template_zabbix .key_and_query (result )
0 commit comments