Ejemplo n.º 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()
Ejemplo n.º 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 = ''
Ejemplo n.º 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()
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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()
Ejemplo n.º 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 = []
Ejemplo n.º 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 = {}
Ejemplo n.º 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')
Ejemplo n.º 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)
Ejemplo n.º 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 = []
Ejemplo n.º 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+(?=(?:,| ))')
Ejemplo n.º 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)
Ejemplo n.º 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+(?=(?:,| ))')
Ejemplo n.º 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 = {}
Ejemplo n.º 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')
Ejemplo n.º 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]+)')
Ejemplo n.º 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]+)')
Ejemplo n.º 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')
Ejemplo n.º 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]+)'))
Ejemplo n.º 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
Ejemplo n.º 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 = {}
Ejemplo n.º 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]+)'))
Ejemplo n.º 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 = {}
Ejemplo n.º 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]
Ejemplo n.º 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()
Ejemplo n.º 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 = []
Ejemplo n.º 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()
Ejemplo n.º 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)
Ejemplo n.º 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()
Ejemplo n.º 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()
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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]
Ejemplo n.º 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]
Ejemplo n.º 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 = {}
Ejemplo n.º 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
        }
Ejemplo n.º 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
     ]
Ejemplo n.º 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)
Ejemplo n.º 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()
Ejemplo n.º 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
Ejemplo n.º 43
0
 def __init__(self, configuration=None, name=None):
     SimpleService.__init__(self, configuration=configuration, name=name)
     self.order = []
     self.definitions = {}
     self.chips = []
Ejemplo n.º 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')
Ejemplo n.º 45
0
 def update(self, interval):
     self.chart_name = "cpu"
     status = SimpleService.update(self, interval=interval)
     self.chart_name = self._orig_name
     return status
Ejemplo n.º 46
0
 def update(self, interval):
     self.chart_name = "cpu"
     status = SimpleService.update(self, interval=interval)
     self.chart_name = self._orig_name
     return status
Ejemplo n.º 47
0
 def create(self):
     self.chart_name = "cpu"
     status = SimpleService.create(self)
     self.chart_name = self._orig_name
     return status
Ejemplo n.º 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()