2
2
3
3
from mamonsu .plugins .pgsql .plugin import PgsqlPlugin as Plugin
4
4
from distutils .version import LooseVersion
5
- import mamonsu .lib .platform as platform
6
5
from .pool import Pooler
7
6
8
7
@@ -24,12 +23,6 @@ class Connections(Plugin):
24
23
'number of disabled' ,
25
24
'00CCCC' )
26
25
]
27
- # ( key, name, graph)
28
- Item_ppid_children = [
29
- ('pgsql.count_all_pids{0}' ,
30
- 'Number of PostgreSQL parent pid children' ,
31
- ('PostgreSQL: count children of PostgreSQL parent pid' , 'BBB000' , 0 )),
32
- ]
33
26
Max_connections = None
34
27
35
28
query_agent = "select count(*) from pg_catalog.pg_stat_activity where state = '{0}';"
@@ -82,12 +75,6 @@ def run(self, zbx):
82
75
self .Max_connections = result [0 ][0 ]
83
76
zbx .send ('pgsql.connections[max_connections]' , int (self .Max_connections ))
84
77
85
- # get number of child pids of ppid
86
- if platform .LINUX :
87
- num_of_children_pids = self .get_num_of_children_pids ()
88
- key = self .Item_ppid_children [0 ][0 ].format ('[]' )
89
- zbx .send (key , num_of_children_pids + 1 )
90
-
91
78
def items (self , template ):
92
79
result = template .item ({
93
80
'name' : 'PostgreSQL: number of total connections' ,
@@ -111,11 +98,6 @@ def items(self, template):
111
98
'key' : self .right_type (self .key , item [1 ]),
112
99
'delay' : self .plugin_config ('interval' )
113
100
})
114
- result += template .item ({
115
- 'name' : 'PostgreSQL: number of child pids' ,
116
- 'key' : self .right_type (self .Item_ppid_children [0 ][0 ]),
117
- 'delay' : self .plugin_config ('interval' )
118
- })
119
101
return result
120
102
121
103
def graphs (self , template ):
@@ -137,10 +119,6 @@ def graphs(self, template):
137
119
'key' : self .right_type (self .key , "max_connections" ),
138
120
'color' : '00BB00'
139
121
})
140
- items .append ({
141
- 'key' : self .right_type (self .Item_ppid_children [0 ][0 ]),
142
- 'color' : '0BB000'
143
- })
144
122
graph = {'name' : 'PostgreSQL connections' , 'items' : items }
145
123
return template .graph (graph )
146
124
0 commit comments