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):
83
83
result = Pooler .run_sql_type ('count_xlog_files' )
84
84
zbx .send (self .key_count_wall .format ("[]" ), int (result [0 ][0 ]))
85
85
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';"" " )
87
87
zbx .send (self .key_non_active_slots .format ("[]" ), int (non_active_slots [0 ][0 ]))
88
88
89
89
def items (self , template ):
@@ -137,11 +137,10 @@ def triggers(self, template):
137
137
'on {HOSTNAME} (value={ITEM.LASTVALUE})' ,
138
138
'expression' : '{#TEMPLATE:' + self .right_type (self .key_replication , "sec" ) + '.last()}>' +
139
139
self .plugin_config ('lag_more_than_in_sec' )
140
- })
141
- triggers += template .trigger ({
140
+ }) + template .trigger ({
142
141
'name' : 'PostgreSQL number of non-active replication slots '
143
142
'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()}# ' +
145
144
str (NUMBER_NON_ACTIVE_SLOTS )
146
145
})
147
146
return triggers
You can’t perform that action at this time.
0 commit comments