예제 #1
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.leases_path = self.configuration.get(
         'leases_path', '/var/lib/dhcp/dhcpd.leases')
     self.order = ORDER
     self.definitions = CHARTS
     self.pools = dict()
예제 #2
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.ntpq = self.find_binary('ntpq')
     self.associd_list = list()
     self.peer_dict = dict()
     self.rgx_sys = re.compile(
             r'.*stratum=(?P<stratum>[0-9.-]+)'
             r'.*precision=(?P<precision>[0-9.-]+)'
             r'.*rootdelay=(?P<rootdelay>[0-9.-]+)'
             r'.*rootdisp=(?P<rootdisp>[0-9.-]+)'
             r'.*tc=(?P<tc>[0-9.-]+)'
             r'.*mintc=(?P<mintc>[0-9.-]+)'
             r'.*offset=(?P<offset>[0-9.-]+)'
             r'.*frequency=(?P<frequency>[0-9.-]+)'
             r'.*sys_jitter=(?P<sys_jitter>[0-9.-]+)'
             r'.*clk_jitter=(?P<clk_jitter>[0-9.-]+)'
             r'.*clk_wander=(?P<clk_wander>[0-9.-]+)')
     self.rgx_peer = re.compile(
             r'.*associd=(?P<associd>[0-9.-]+)'
             r'.*srcadr=(?P<srcadr>[a-z0-9.-]+)'
             r'.*stratum=(?P<stratum>[0-9.-]+)'
             r'.*precision=(?P<precision>[0-9.-]+)'
             r'.*rootdelay=(?P<rootdelay>[0-9.-]+)'
             r'.*rootdisp=(?P<rootdisp>[0-9.-]+)'
             r'.*hmode=(?P<hmode>[0-9.-]+)'
             r'.*pmode=(?P<pmode>[0-9.-]+)'
             r'.*hpoll=(?P<hpoll>[0-9.-]+)'
             r'.*ppoll=(?P<ppoll>[0-9.-]+)'
             r'.*headway=(?P<headway>[0-9.-]+)'
             r'.*offset=(?P<offset>[0-9.-]+)'
             r'.*delay=(?P<delay>[0-9.-]+)'
             r'.*dispersion=(?P<dispersion>[0-9.-]+)'
             r'.*jitter=(?P<jitter>[0-9.-]+)'
             r'.*xleave=(?P<xleave>[0-9.-]+)')
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.couch_url = configuration['couch_url']
     self.resource = configuration['resource']
     if len(self.couch_url) == 0:
         raise Exception('Invalid couch_url')
     self.order = ORDER
     self.definitions = CHARTS
     self.data = {
         'save_documents': 0,
         'update_documents': 0,
         'workers_count': 0,
         'resource_items_queue_size': 0,
         'free_api_clients': 0,
         'exceptions_count': 0,
         'add_to_resource_items_queue': 0,
         'skiped': 0,
         'droped': 0,
         'retry_resource_items_queue_size': 0,
         'filter_workers_count': 0,
         'not_found_count': 0,
         'add_to_retry': 0,
         'retry_workers_count': 0,
         'not_actual_docs_count': 0,
         'timeshift': 0
     }
     self.last_time = ''
예제 #4
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.regex = r_compile(r'(\d+);(\d+);(\d+)')
     self.log_path = self.configuration.get('log_path', '/var/log/smartd')
     self.raw_values = self.configuration.get('raw_values')
     self.attr = self.configuration.get('smart_attributes', [])
     self.previous_data = dict()
예제 #5
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self._parse_config(configuration)
     self.order = ORDER
     self.definitions = CHARTS
     self.connection = None
     self.do_slave = -1
예제 #6
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self._parse_config(configuration)
     self.order = ORDER
     self.definitions = CHARTS
     self.connection = None
     self.do_slave = -1
예제 #7
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.regex = r_compile(r'(\d+);(\d+);(\d+)')
     self.log_path = self.configuration.get('log_path', '/var/log/smartd')
     self.raw_values = self.configuration.get('raw_values')
     self.attr = self.configuration.get('smart_attributes', [])
     self.previous_data = dict()
예제 #8
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = []
     self.definitions = {}
     self.celsius = ('Celsius', lambda x: x)
     self.fahrenheit = ('Fahrenheit', lambda x: x * 9 / 5 + 32)  if self.configuration.get('fahrenheit') else False
     self.choice = (choice for choice in [self.fahrenheit, self.celsius] if choice)
     self.chips = []
예제 #9
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.baseurl = self.configuration.get('url')
     # self.baseurl = 'http://10.0.0.10:5984'
     self.stats_url = '{}/_stats/'.format(self.baseurl)
     self.order = ORDER
     self.definitions = CHARTS
     self.data = {}
예제 #10
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = list()
     self.definitions = dict()
     self.timeout = self.configuration.get('response_timeout', 4)
     self.aggregate = self.configuration.get('aggregate', True)
     self.domains = self.configuration.get('domains')
     self.server_list = self.configuration.get('dns_servers')
예제 #11
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self.log_path = self.configuration.get('log_path')
     self.regex = dict(tls=r_compile(r'\d{1,3}(?:\.\d{1,3}){3}(?::\d+)? (?P<bytes_in>\d+) (?P<bytes_out>\d+)'),
                       static_key=r_compile(r'TCP/[A-Z]+ (?P<direction>(?:read|write)) bytes,(?P<bytes>\d+)'))
     self.to_netdata = dict(bytes_in=0, bytes_out=0)
예제 #12
0
 def __init__(self, configuration=None, name=None):
     self.sys_dir = "/sys/devices"
     self.filename = "scaling_cur_freq"
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self._orig_name = ""
     self.assignment = {}
     self.paths = []
예제 #13
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self.log_path = self.configuration.get('log_path')
     self.regex_data_inter = r_compile(r'(?<=Since ).*?(?=.ROUTING)')
     self.regex_data_final = r_compile(r'\d{1,3}(?:\.\d{1,3}){3}[:0-9,. ]*')
     self.regex_users = r_compile(r'\d{1,3}(?:\.\d{1,3}){3}:\d+')
     self.regex_traffic = r_compile(r'(?<=(?:,| ))\d+(?=(?:,| ))')
예제 #14
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = []
     self.definitions = {}
     self.fake_name = "gpu"
     self.nvidia_smi = find_binary('nvidia-smi')
     self.assignment = {}
     self.poller = Poller([self.nvidia_smi, '-x', '-q', '-l', '1'],
                          lambda x: '</nvidia_smi_log>' in x)
예제 #15
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self.log_path = self.configuration.get('log_path')
     self.regex_data_inter = compile(r'(?<=Since ).*?(?=.ROUTING)')
     self.regex_data_final = compile(r'\d{1,3}(?:\.\d{1,3}){3}[:0-9,. ]*')
     self.regex_users = compile(r'\d{1,3}(?:\.\d{1,3}){3}:\d+')
     self.regex_traffic = compile(r'(?<=(?:,| ))\d+(?=(?:,| ))')
예제 #16
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = []
     self.definitions = {}
     self.fake_name = "cpu"
     self.assignment = {}
     self.last_turbostat = None
     self.last_turbostat_time = 0
     self.rapl = {}
예제 #17
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.named_stats_path = self.configuration.get('named_stats_path', '/var/log/bind/named.stats')
     self.regex_values = compile(r'([0-9]+) ([^\n]+)')
     # self.options = ['Incoming Requests', 'Incoming Queries', 'Outgoing Queries',
     # 'Name Server Statistics', 'Zone Maintenance Statistics', 'Resolver Statistics',
     # 'Cache DB RRsets', 'Socket I/O Statistics']
     self.options = ['Name Server Statistics', 'Incoming Queries', 'Outgoing Queries']
     self.regex_options = [r'(%s(?= \+\+)) \+\+([^\+]+)' % option for option in self.options]
     self.rndc = self.find_binary('rndc')
예제 #18
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = ['agr_health']
     self.definitions = {'agr_health':
                             {'options':
                                  [None, 'Faulty devices in MD', 'failed disks', 'health', 'md.health', 'line'],
                              'lines': []}}
     self.proc_mdstat = '/proc/mdstat'
     self.regex_disks = compile(r'((?<=\ )[a-zA-Z_0-9]+(?= : active)).*?((?<= \[)[0-9]+)/([0-9]+(?=\] ))')
     self.regex_status = compile(r'([a-zA-Z_0-9]+)( : active)[^:]*?([a-z]+) = ([0-9.]+(?=%)).*?((?<=finish=)[0-9.]+)min speed=([0-9]+)')
예제 #19
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = ['agr_health']
     self.definitions = {'agr_health':
                             {'options':
                                  [None, 'Faulty devices in MD', 'failed disks', 'health', 'md.health', 'line'],
                              'lines': []}}
     self.proc_mdstat = '/proc/mdstat'
     self.regex_disks = compile(r'((?<=\ )[a-zA-Z_0-9]+(?= : active)).*?((?<= \[)[0-9]+)/([0-9]+(?=\] ))')
     self.regex_status = compile(r'([a-zA-Z_0-9]+)( : active)[^:]*?([a-z]+) = ([0-9.]+(?=%)).*?((?<=finish=)[0-9.]+)min speed=([0-9]+)')
예제 #20
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.named_stats_path = self.configuration.get('named_stats_path', '/var/log/bind/named.stats')
     self.regex_values = compile(r'([0-9]+) ([^\n]+)')
     # self.options = ['Incoming Requests', 'Incoming Queries', 'Outgoing Queries',
     # 'Name Server Statistics', 'Zone Maintenance Statistics', 'Resolver Statistics',
     # 'Cache DB RRsets', 'Socket I/O Statistics']
     self.options = ['Name Server Statistics', 'Incoming Queries', 'Outgoing Queries']
     self.regex_options = [r'(%s(?= \+\+)) \+\+([^\+]+)' % option for option in self.options]
     self.rndc = self.find_binary('rndc')
예제 #21
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.regex = dict(disks=re_compile(r' (?P<array>[a-zA-Z_0-9]+) : active .+\['
                                        r'(?P<total_disks>[0-9]+)/'
                                        r'(?P<inuse_disks>[0-9])\]'),
                       status=re_compile(r' (?P<array>[a-zA-Z_0-9]+) : active .+ '
                                         r'(?P<operation>[a-z]+) = '
                                         r'(?P<operation_status>[0-9.]+).+finish='
                                         r'(?P<finish>([0-9.]+))min speed='
                                         r'(?P<speed>[0-9]+)'))
예제 #22
0
 def __init__(self, configuration=None, name=None):
     prefix = os.getenv('NETDATA_HOST_PREFIX', "")
     if prefix.endswith('/'):
         prefix = prefix[:-1]
     self.sys_dir = prefix + "/sys/devices"
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self._orig_name = ""
     self.assignment = {}
     self.accurate = True
예제 #23
0
 def __init__(self, configuration=None, name=None):
     prefix = os.getenv('NETDATA_HOST_PREFIX', "")
     if prefix.endswith('/'):
         prefix = prefix[:-1]
     self.sys_dir = prefix + "/sys/devices/system/cpu"
     self.schedstat_path = prefix + "/proc/schedstat"
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = []
     self.definitions = {}
     self._orig_name = ""
     self.assignment = {}
예제 #24
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.regex = dict(
         disks=re_compile(r' (?P<array>[a-zA-Z_0-9]+) : active .+\['
                          r'(?P<total_disks>[0-9]+)/'
                          r'(?P<inuse_disks>[0-9])\]'),
         status=re_compile(r' (?P<array>[a-zA-Z_0-9]+) : active .+ '
                           r'(?P<operation>[a-z]+) = '
                           r'(?P<operation_status>[0-9.]+).+finish='
                           r'(?P<finish>([0-9.]+))min speed='
                           r'(?P<speed>[0-9]+)'))
예제 #25
0
 def __init__(self, configuration=None, name=None):
     prefix = os.getenv('NETDATA_HOST_PREFIX', "")
     if prefix.endswith('/'):
         prefix = prefix[:-1]
     self.sys_dir = prefix + "/sys/devices"
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self._orig_name = ""
     self.assignment = {}
     self.accurate_exists = True
     self.accurate_last = {}
예제 #26
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.host = self.configuration.get('host', 'localhost')
     self.port = self.configuration.get('port', '18121')
     self.secret = self.configuration.get('secret', 'adminsecret')
     self.acct = self.configuration.get('acct', False)
     self.proxy_auth = self.configuration.get('proxy_auth', False)
     self.proxy_acct = self.configuration.get('proxy_acct', False)
     self.echo = self.find_binary('echo')
     self.radclient = self.find_binary('radclient')
     self.sub_echo = [self.echo, 'Message-Authenticator = 0x00, FreeRADIUS-Statistics-Type = 15, Response-Packet-Type = Access-Accept']
     self.sub_radclient = [self.radclient, '-r', '1', '-t', '1', ':'.join([self.host, self.port]), 'status', self.secret]
예제 #27
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.varnish = self.find_binary('varnishstat')
     self.rgx_all = compile(r'([A-Z]+\.)?([\d\w_.]+)\s+(\d+)')
     # Could be
     # VBE.boot.super_backend.pipe_hdrbyte (new)
     # or
     # VBE.default2(127.0.0.2,,81).bereq_bodybytes (old)
     # Regex result: [('super_backend', 'beresp_hdrbytes', '0'), ('super_backend', 'beresp_bodybytes', '0')]
     self.rgx_bck = (compile(r'VBE.([\d\w_.]+)\(.*?\).(beresp[\w_]+)\s+(\d+)'),
                     compile(r'VBE\.[\d\w-]+\.([\w\d_]+).(beresp[\w_]+)\s+(\d+)'))
     self.cache_prev = list()
예제 #28
0
 def __init__(self, configuration=None, name=None):
     prefix = os.getenv('NETDATA_HOST_PREFIX', "")
     if prefix.endswith('/'):
         prefix = prefix[:-1]
     self.sys_dir = prefix + "/sys/devices"
     self.filename = "scaling_cur_freq"
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self._orig_name = ""
     self.assignment = {}
     self.paths = []
예제 #29
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER[:]
     self.definitions = deepcopy(CHARTS)
     self.user = self.configuration.get('user')
     self.password = self.configuration.get('pass')
     self.host = self.configuration.get('host', '127.0.0.1')
     self.port = self.configuration.get('port', 27017)
     self.timeout = self.configuration.get('timeout', 100)
     self.metrics_to_collect = deepcopy(DEFAULT_METRICS)
     self.connection = None
     self.do_replica = None
     self.databases = list()
예제 #30
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self.log_path = self.configuration.get('log_path')
     self.regex = dict(
         tls=r_compile(
             r'\d{1,3}(?:\.\d{1,3}){3}(?::\d+)? (?P<bytes_in>\d+) (?P<bytes_out>\d+)'
         ),
         static_key=r_compile(
             r'TCP/[A-Z]+ (?P<direction>(?:read|write)) bytes,(?P<bytes>\d+)'
         ))
     self.to_netdata = dict(bytes_in=0, bytes_out=0)
예제 #31
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     # We MUST have reasonably small timeout
     self.serial_params = dict(baudrate=9600,
                               parity=serial.PARITY_NONE,
                               stopbits=1,
                               bytesize=serial.EIGHTBITS,
                               timeout=10,
                               write_timeout=5)
     self.devname = self.configuration.get('devname')
     self.data = dict()
예제 #32
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER[:]
     self.definitions = deepcopy(CHARTS)
     self.user = self.configuration.get('user')
     self.password = self.configuration.get('pass')
     self.host = self.configuration.get('host', '127.0.0.1')
     self.port = self.configuration.get('port', 27017)
     self.timeout = self.configuration.get('timeout', 100)
     self.metrics_to_collect = deepcopy(DEFAULT_METRICS)
     self.connection = None
     self.do_replica = None
     self.databases = list()
예제 #33
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.host = 'localhost'
     self.port = 'ntp'
     addrinfo = socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_DGRAM)[0]
     self.family = addrinfo[0]
     self.sockaddr = addrinfo[4]
     self.peer = None
     self.request_systemvars = None
     self.regex_srcadr = re.compile(r'srcadr=([A-Za-z0-9.-]+)')
     self.regex_refid = re.compile(r'refid=([A-Za-z]+)')
     self.regex_data = re.compile(r'([a-z_]+)=([0-9-]+(?:\.[0-9]+)?)(?=,)')
     self.order = None
     self.definitions = None
예제 #34
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.named_stats_path = self.configuration.get('named_stats_path', '/var/log/bind/named.stats')
     self.regex_values = compile(r'([0-9]+) ([^\n]+)')
     # self.options = ['Incoming Requests', 'Incoming Queries', 'Outgoing Queries',
     # 'Name Server Statistics', 'Zone Maintenance Statistics', 'Resolver Statistics',
     # 'Cache DB RRsets', 'Socket I/O Statistics']
     self.options = ['Name Server Statistics', 'Incoming Queries', 'Outgoing Queries']
     self.regex_options = [r'(%s(?= \+\+)) \+\+([^\+]+)' % option for option in self.options]
     try:
         self.rndc = [''.join([directory, 'rndc']) for directory in DIRECTORIES
                      if isfile(''.join([directory, 'rndc']))][0]
     except IndexError:
         self.rndc = False
예제 #35
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.host = self.configuration.get('host', 'localhost')
     self.port = self.configuration.get('port', '18121')
     self.secret = self.configuration.get('secret', 'adminsecret')
     self.acct = self.configuration.get('acct', False)
     self.proxy_auth = self.configuration.get('proxy_auth', False)
     self.proxy_acct = self.configuration.get('proxy_acct', False)
     try:
         self.echo = [''.join([directory, 'echo']) for directory in directories if isfile(''.join([directory, 'echo']))][0]
         self.radclient = [''.join([directory, 'radclient']) for directory in directories if isfile(''.join([directory, 'radclient']))][0]
     except IndexError:
         self.echo = []
         self.radclient = []
     self.sub_echo = [self.echo, 'Message-Authenticator = 0x00, FreeRADIUS-Statistics-Type = 15, Response-Packet-Type = Access-Accept']
     self.sub_radclient = [self.radclient, '-r', '1', '-t', '1', ':'.join([self.host, self.port]), 'status', self.secret]
예제 #36
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.host = self.configuration.get('host', 'localhost')
     self.port = self.configuration.get('port', '18121')
     self.secret = self.configuration.get('secret', 'adminsecret')
     self.acct = self.configuration.get('acct', False)
     self.proxy_auth = self.configuration.get('proxy_auth', False)
     self.proxy_acct = self.configuration.get('proxy_acct', False)
     try:
         self.echo = [''.join([directory, 'echo']) for directory in directories if isfile(''.join([directory, 'echo']))][0]
         self.radclient = [''.join([directory, 'radclient']) for directory in directories if isfile(''.join([directory, 'radclient']))][0]
     except IndexError:
         self.echo = []
         self.radclient = []
     self.sub_echo = [self.echo, 'Message-Authenticator = 0x00, FreeRADIUS-Statistics-Type = 15, Response-Packet-Type = Access-Accept']
     self.sub_radclient = [self.radclient, '-r', '1', '-t', '1', ':'.join([self.host, self.port]), 'status', self.secret]
예제 #37
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.monitoring_dbs = self.configuration.get('monitoring_dbs')
     self.monitoring_dbs = ['one', 'two']
     # self.untrack_dbs = self.configuration.get('untrack_dbs', ['_replicator', '_users'])
     # self.baseurl = self.configuration.get('url')
     self.baseurl = 'http://10.0.0.10:5984'
     self.active_tasks_url = '{}/_active_tasks/'.format(self.baseurl)
     self.user = self.configuration.get('couch_username') or None
     self.password = self.configuration.get('couch_password') or None
     self.encoded_auth = None
     if self.user and self.password:
         self.encoded_auth = base64.encodestring(
             '%s:%s' % (self.user, self.password)).replace('\n', '')
     self.repl_order = []
     self.repl_definitions = {}
     self.data = {}
예제 #38
0
    def __init__(self, configuration=None, name=None):
        SimpleService.__init__(self, configuration=configuration, name=name)

        self.couch_url = configuration['url']
        # self.couch_url = 'http://127.0.0.1:5984/'
        self.couch_stats_url = self.couch_url + '_stats'
        if len(self.couch_stats_url) == 0: raise Exception('Invalid couch')
        self.couch_stats = 0

        self.order = ORDER
        self.definitions = CHARTS

        self.data = {
            '200': 0,
            '201': 0,
            '202': 0,
            '301': 0,
            '304': 0,
            '400': 0,
            '401': 0,
            '403': 0,
            '404': 0,
            '405': 0,
            '409': 0,
            '412': 0,
            '500': 0,
            'cache_hits': 0,
            'cache_misses': 0,
            'COPY': 0,
            'DELETE': 0,
            'GET': 0,
            'HEAD': 0,
            'POST': 0,
            'PUT': 0,
            'db_reads_delta': 0,
            'db_writes_delta': 0,
            'db_reads': 0,
            'db_writes': 0,
            'clients': 0,
            'requests': 0,
            'bulk_requests': 0,
            'view_reads': 0,
            'temporary_view_reads': 0,
            'files': 0,
            'dbs': 0
        }
예제 #39
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.host = self.configuration.get('host', 'localhost')
     self.port = self.configuration.get('port', '18121')
     self.secret = self.configuration.get('secret', 'adminsecret')
     self.acct = self.configuration.get('acct', False)
     self.proxy_auth = self.configuration.get('proxy_auth', False)
     self.proxy_acct = self.configuration.get('proxy_acct', False)
     self.echo = self.find_binary('echo')
     self.radclient = self.find_binary('radclient')
     self.sub_echo = [
         self.echo,
         'Message-Authenticator = 0x00, FreeRADIUS-Statistics-Type = 15, Response-Packet-Type = Access-Accept'
     ]
     self.sub_radclient = [
         self.radclient, '-r', '1', '-t', '1',
         ':'.join([self.host, self.port]), 'status', self.secret
     ]
예제 #40
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self.named_stats_path = self.configuration.get(
         'named_stats_path', '/var/log/bind/named.stats')
     self.rndc = self.find_binary('rndc')
     self.data = dict(nms_requests=0,
                      nms_responses=0,
                      nms_failure=0,
                      nms_auth=0,
                      nms_non_auth=0,
                      nms_nxrrset=0,
                      nms_success=0,
                      nms_nxdomain=0,
                      nms_recursion=0,
                      nms_duplicate=0,
                      nms_rejected_queries=0,
                      nms_dropped_queries=0)
예제 #41
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     try:
         self.varnish = [
             ''.join([directory, 'varnishstat'])
             for directory in DIRECTORIES
             if is_executable(''.join([directory, 'varnishstat']), X_OK)
         ][0]
     except IndexError:
         self.varnish = False
     self.rgx_all = compile(r'([A-Z]+\.)([\d\w_.]+)\s+(\d+)')
     # Could be
     # VBE.boot.super_backend.pipe_hdrbyte (new)
     # or
     # VBE.default2(127.0.0.2,,81).bereq_bodybytes (old)
     # Regex result: [('super_backend', 'beresp_hdrbytes', '0'), ('super_backend', 'beresp_bodybytes', '0')]
     self.rgx_bck = (
         compile(r'VBE.([\d\w_.]+)\(.*?\).(beresp[\w_]+)\s+(\d+)'),
         compile(r'VBE\.[\d\w-]+\.([\w\d_]+).(beresp[\w_]+)\s+(\d+)'))
     self.cache_prev = list()
예제 #42
0
    def __init__(self, configuration=None, name=None):
        SimpleService.__init__(self, configuration=configuration, name=name)
        # todo: parce threw config
        self.monitoring_tasks = [
            'indexer', 'database_compaction', 'view_compaction', 'replication'
        ]
        self.order = ORDER
        self.definitions = CHARTS
        self.baseurl = self.configuration.get('url')
        # self.baseurl = 'http://10.0.0.10:5984'
        self.active_tasks_url = '{}/_active_tasks/'.format(self.baseurl)
        self.untrack_dbs = self.configuration.get('untrack_dbs',
                                                  ['_replicator', '_users'])
        self.user = self.configuration.get('couch_username') or None
        self.password = self.configuration.get('couch_password') or None
        self.encoded_auth = None
        if self.user and self.password:
            self.encoded_auth = base64.encodestring(
                '%s:%s' % (self.user, self.password)).replace('\n', '')
        self.data = {}

        for task in self.monitoring_tasks:
            self.data['{}_task'.format(task)] = 0
예제 #43
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = []
     self.definitions = {}
     self.chips = []
예제 #44
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.leases_path = self.configuration.get('leases_path', '/var/lib/dhcp/dhcpd.leases')
     self.pools = self.configuration.get('pools')
예제 #45
0
 def update(self, interval):
     self.chart_name = "cpu"
     status = SimpleService.update(self, interval=interval)
     self.chart_name = self._orig_name
     return status
예제 #46
0
 def update(self, interval):
     self.chart_name = "cpu"
     status = SimpleService.update(self, interval=interval)
     self.chart_name = self._orig_name
     return status
예제 #47
0
 def create(self):
     self.chart_name = "cpu"
     status = SimpleService.create(self)
     self.chart_name = self._orig_name
     return status
예제 #48
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.leases_path = self.configuration.get('leases_path', '/var/lib/dhcp/dhcpd.leases')
     self.order = ORDER
     self.definitions = CHARTS
     self.pools = dict()