| Server IP : 61.19.30.66 / Your IP : 216.73.216.15 Web Server : Apache/2.2.22 (Ubuntu) System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64 User : www-data ( 33) PHP Version : 5.3.10-1ubuntu3.48 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /usr/share/pyshared/landscape/monitor/ |
Upload File : |
"""The Landscape monitor plugin system."""
import os
from landscape.broker.client import BrokerClient
class Monitor(BrokerClient):
"""The central point of integration in the Landscape monitor."""
name = "monitor"
def __init__(self, reactor, config, persist, persist_filename=None,
step_size=5 * 60):
super(Monitor, self).__init__(reactor)
self.reactor = reactor
self.config = config
self.persist = persist
self.persist_filename = persist_filename
if persist_filename and os.path.exists(persist_filename):
self.persist.load(persist_filename)
self._plugins = []
self.step_size = step_size
self.reactor.call_every(self.config.flush_interval, self.flush)
def flush(self):
"""Flush data to disk."""
if self.persist_filename:
self.persist.save(self.persist_filename)
def exchange(self):
"""Call C{exchange} on all plugins."""
super(Monitor, self).exchange()
self.flush()