diff --git a/.gitignore b/.gitignore index ff2f3e46..02c9aa4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.pyc *.egg-info +*.swp __pycache__ tags diff --git a/mamonsu/lib/zbx.py b/mamonsu/lib/zbx.py index 85c1a97c..3598e146 100644 --- a/mamonsu/lib/zbx.py +++ b/mamonsu/lib/zbx.py @@ -6,6 +6,7 @@ import struct import socket import json +import logging import mamonsu.lib.platform as platform from mamonsu.lib.plugin import Plugin @@ -25,6 +26,8 @@ def __init__(self, config): self.max_queue_size = config.fetch('sender', 'queue', int) self.fqdn = config.fetch('zabbix', 'client') self.queue = Queue() + self.log = logging.getLogger( + 'ZBX-{0}:{1}'.format(self.host, self.port)) def json(self, val): return json.dumps(val) @@ -75,6 +78,10 @@ def _send_data(self, data): resp_body_len = struct.unpack('