Skip to content

Commit 4a86453

Browse files
committed
fix: edit query typing
1 parent 0e349e0 commit 4a86453

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

mamonsu/plugins/pgsql/xlog.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)