File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ def run(self, zbx):
8383 result = Pooler .run_sql_type ('count_xlog_files' )
8484 zbx .send (self .key_count_wall .format ("[]" ), int (result [0 ][0 ]))
8585
86- non_active_slots = Pooler .run_sql_type ("select count(*) from pg_replication_slots where active = false; " )
86+ non_active_slots = Pooler .run_sql_type ("""SELECT count(*) FROM pg_replication_slots WHERE active = ' false';"" " )
8787 zbx .send (self .key_non_active_slots .format ("[]" ), int (non_active_slots [0 ][0 ]))
8888
8989 def items (self , template ):
@@ -137,11 +137,10 @@ def triggers(self, template):
137137 'on {HOSTNAME} (value={ITEM.LASTVALUE})' ,
138138 'expression' : '{#TEMPLATE:' + self .right_type (self .key_replication , "sec" ) + '.last()}>' +
139139 self .plugin_config ('lag_more_than_in_sec' )
140- })
141- triggers += template .trigger ({
140+ }) + template .trigger ({
142141 'name' : 'PostgreSQL number of non-active replication slots '
143142 'on {HOSTNAME} (value={ITEM.LASTVALUE})' ,
144- 'expression' : '{#TEMPLATE:' + self .right_type (self .key_non_active_slots ) + '.last()}≠ ' +
143+ 'expression' : '{#TEMPLATE:' + self .right_type (self .key_non_active_slots ) + '.last()}# ' +
145144 str (NUMBER_NON_ACTIVE_SLOTS )
146145 })
147146 return triggers
You can’t perform that action at this time.
0 commit comments