File tree 1 file changed +7
-10
lines changed
1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,6 @@ class Connections(Plugin):
37
37
WHERE (backend_type NOT IN ('{0}'));
38
38
""" .format ("', '" .join (default_backend_types ))
39
39
40
- Max_connections = None
41
-
42
40
query_agent = """
43
41
SELECT count(*)
44
42
FROM pg_catalog.pg_stat_activity
@@ -125,14 +123,13 @@ def run(self, zbx):
125
123
"(backend_type = 'client backend' OR backend_type = 'parallel worker')" if Pooler .server_version_greater (
126
124
"10.0" ) else "state IS NOT NULL" ))
127
125
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 ]))
136
133
137
134
if Pooler .server_version_greater ("10.0" ):
138
135
result = Pooler .query (self .query_other_connections )
You can’t perform that action at this time.
0 commit comments