Skip to content

Commit 420b4da

Browse files
committed
fix: add platform check for linux only method
1 parent cd9ca5e commit 420b4da

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mamonsu/plugins/pgsql/connections.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from mamonsu.plugins.pgsql.plugin import PgsqlPlugin as Plugin
44
from distutils.version import LooseVersion
5+
import mamonsu.lib.platform as platform
56
from .pool import Pooler
67

78

@@ -82,9 +83,10 @@ def run(self, zbx):
8283
zbx.send('pgsql.connections[max_connections]', int(self.Max_connections))
8384

8485
# get number of child pids of ppid
85-
num_of_children_pids = self.get_num_of_children_pids()
86-
key = self.Item_ppid_children[0][0].format('[]')
87-
zbx.send(key, num_of_children_pids+1)
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)
8890

8991
def items(self, template):
9092
result = template.item({

0 commit comments

Comments
 (0)