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 66
77NUMBER_NON_ACTIVE_SLOTS = 0
88
9+
910class Xlog (Plugin ):
1011 DEFAULT_CONFIG = {'lag_more_than_in_sec' : str (60 * 5 )}
1112
@@ -31,7 +32,7 @@ class Xlog(Plugin):
3132 key_wall = 'pgsql.wal.write{0}'
3233 key_count_wall = "pgsql.wal.count{0}"
3334 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} "
3536 AgentPluginType = 'pg'
3637
3738 def run (self , zbx ):
@@ -136,10 +137,11 @@ def triggers(self, template):
136137 'on {HOSTNAME} (value={ITEM.LASTVALUE})' ,
137138 'expression' : '{#TEMPLATE:' + self .right_type (self .key_replication , "sec" ) + '.last()}>' +
138139 self .plugin_config ('lag_more_than_in_sec' )
139- }) + template .trigger ({
140+ })
141+ triggers += template .trigger ({
140142 'name' : 'PostgreSQL number of non-active replication slots '
141143 '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()}≠' +
143145 str (NUMBER_NON_ACTIVE_SLOTS )
144146 })
145147 return triggers
You can’t perform that action at this time.
0 commit comments