Skip to content

Commit

Permalink
mgr/zabbix: Improve logging of Zabbix module
Browse files Browse the repository at this point in the history
Just to make sure more logging can be done when needed.

Signed-off-by: Wido den Hollander <wido@42on.com>
  • Loading branch information
wido committed Dec 12, 2017
1 parent 5b114c8 commit bf614e9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/pybind/mgr/zabbix/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def __init__(self, *args, **kwargs):

def init_module_config(self):
self.fsid = self.get('mon_map')['fsid']
self.log.debug('Found Ceph fsid %s', self.fsid)

for key, default in self.config_keys.items():
self.set_config_option(key, self.get_config(key, default))

Expand All @@ -108,6 +110,8 @@ def set_config_option(self, option, value):
self.log.error('interval should be set to at least 10 seconds')
return False

self.log.debug('Setting in-memory config option %s to: %s', option,
value)
self.config[option] = value
return True

Expand Down Expand Up @@ -219,7 +223,7 @@ def send(self):
return

try:
self.log.debug(
self.log.info(
'Sending data to Zabbix server %s as host/identifier %s',
self.config['zabbix_host'], identifier)
self.log.debug(data)
Expand Down Expand Up @@ -270,14 +274,11 @@ def shutdown(self):
self.event.set()

def serve(self):
self.log.debug('Zabbix module starting up')
self.log.info('Zabbix module starting up')
self.run = True

self.init_module_config()

for key, value in self.config.items():
self.log.debug('%s: %s', key, value)

while self.run:
self.log.debug('Waking up for new iteration')

Expand Down

0 comments on commit bf614e9

Please sign in to comment.