当前位置: 首页>>代码示例>>Python>>正文


Python base.SimpleService类代码示例

本文整理汇总了Python中base.SimpleService的典型用法代码示例。如果您正苦于以下问题:Python SimpleService类的具体用法?Python SimpleService怎么用?Python SimpleService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SimpleService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

 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
开发者ID:acecommerce,项目名称:netdata,代码行数:7,代码来源:mysql.chart.py

示例2: __init__

 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()
开发者ID:darrentangdt,项目名称:netdata,代码行数:7,代码来源:smartd_log.chart.py

示例3: __init__

 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 = []
开发者ID:acecommerce,项目名称:netdata,代码行数:8,代码来源:sensors.chart.py

示例4: __init__

 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)
开发者ID:darrentangdt,项目名称:netdata,代码行数:8,代码来源:ovpn_status_log.chart.py

示例5: __init__

 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+(?=(?:,| ))')
开发者ID:acecommerce,项目名称:netdata,代码行数:9,代码来源:ovpn_status_log.chart.py

示例6: __init__

 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]+)'))
开发者ID:mitchelldavis44,项目名称:netdata,代码行数:10,代码来源:mdstat.chart.py

示例7: __init__

 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]+)')
开发者ID:acecommerce,项目名称:netdata,代码行数:10,代码来源:mdstat.chart.py

示例8: __init__

 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')
开发者ID:rlugojr,项目名称:netdata,代码行数:10,代码来源:bind_rndc.chart.py

示例9: __init__

 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 = {}
开发者ID:acecommerce,项目名称:netdata,代码行数:11,代码来源:cpuidle.chart.py

示例10: __init__

 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 = {}
开发者ID:darrentangdt,项目名称:netdata,代码行数:12,代码来源:cpufreq.chart.py

示例11: __init__

 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]
开发者ID:darrentangdt,项目名称:netdata,代码行数:12,代码来源:freeradius.chart.py

示例12: __init__

 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()
开发者ID:darrentangdt,项目名称:netdata,代码行数:12,代码来源:varnish.chart.py

示例13: __init__

 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 = []
开发者ID:178518,项目名称:netdata,代码行数:12,代码来源:cpufreq.chart.py

示例14: __init__

 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()
开发者ID:dvigne,项目名称:netdata,代码行数:13,代码来源:mongodb.chart.py

示例15: __init__

 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
开发者ID:acecommerce,项目名称:netdata,代码行数:14,代码来源:bind_rndc.chart.py


注:本文中的base.SimpleService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。