File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,6 @@ class Connections(Plugin):
3737 WHERE (backend_type NOT IN ('{0}'));
3838 """ .format ("', '" .join (default_backend_types ))
3939
40- Max_connections = None
41-
4240 query_agent = """
4341 SELECT count(*)
4442 FROM pg_catalog.pg_stat_activity
@@ -125,14 +123,13 @@ def run(self, zbx):
125123 "(backend_type = 'client backend' OR backend_type = 'parallel worker')" if Pooler .server_version_greater (
126124 "10.0" ) else "state IS NOT NULL" ))
127125 zbx .send ("pgsql.connections[waiting]" , int (result [0 ][0 ]))
128- if self .Max_connections is None :
129- result = Pooler .query ("""
130- SELECT setting
131- FROM pg_settings
132- WHERE name = 'max_connections';
133- """ )
134- self .Max_connections = result [0 ][0 ]
135- zbx .send ("pgsql.connections[max_connections]" , int (self .Max_connections ))
126+
127+ result = Pooler .query ("""
128+ SELECT setting
129+ FROM pg_settings
130+ WHERE name = 'max_connections';
131+ """ )
132+ zbx .send ("pgsql.connections[max_connections]" , int (result [0 ][0 ]))
136133
137134 if Pooler .server_version_greater ("10.0" ):
138135 result = Pooler .query (self .query_other_connections )
You can’t perform that action at this time.
0 commit comments