File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 6
6
7
7
NUMBER_NON_ACTIVE_SLOTS = 0
8
8
9
+
9
10
class Xlog (Plugin ):
10
11
DEFAULT_CONFIG = {'lag_more_than_in_sec' : str (60 * 5 )}
11
12
@@ -31,7 +32,7 @@ class Xlog(Plugin):
31
32
key_wall = 'pgsql.wal.write{0}'
32
33
key_count_wall = "pgsql.wal.count{0}"
33
34
key_replication = "pgsql.replication_lag{0}"
34
- key_non_active_slots = "pgsql.replication.non_active_slots"
35
+ key_non_active_slots = "pgsql.replication.non_active_slots{0} "
35
36
AgentPluginType = 'pg'
36
37
37
38
def run (self , zbx ):
@@ -136,10 +137,11 @@ def triggers(self, template):
136
137
'on {HOSTNAME} (value={ITEM.LASTVALUE})' ,
137
138
'expression' : '{#TEMPLATE:' + self .right_type (self .key_replication , "sec" ) + '.last()}>' +
138
139
self .plugin_config ('lag_more_than_in_sec' )
139
- }) + template .trigger ({
140
+ })
141
+ triggers += template .trigger ({
140
142
'name' : 'PostgreSQL number of non-active replication slots '
141
143
'on {HOSTNAME} (value={ITEM.LASTVALUE})' ,
142
- 'expression' : '{#TEMPLATE:' + self .right_type (self .key_replication , "sec" ) + '.last()}≠' +
144
+ 'expression' : '{#TEMPLATE:' + self .right_type (self .key_non_active_slots ) + '.last()}≠' +
143
145
str (NUMBER_NON_ACTIVE_SLOTS )
144
146
})
145
147
return triggers
You can’t perform that action at this time.
0 commit comments