當前位置: 首頁>>代碼示例>>Python>>正文


Python SimpleService.__init__方法代碼示例

本文整理匯總了Python中base.SimpleService.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python SimpleService.__init__方法的具體用法?Python SimpleService.__init__怎麽用?Python SimpleService.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在base.SimpleService的用法示例。


在下文中一共展示了SimpleService.__init__方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from base import SimpleService [as 別名]
# 或者: from base.SimpleService import __init__ [as 別名]
 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,代碼行數:9,代碼來源:smartd_log.chart.py

示例2: __init__

# 需要導入模塊: from base import SimpleService [as 別名]
# 或者: from base.SimpleService import __init__ [as 別名]
 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,代碼行數:9,代碼來源:mysql.chart.py

示例3: __init__

# 需要導入模塊: from base import SimpleService [as 別名]
# 或者: from base.SimpleService import __init__ [as 別名]
 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,代碼行數:10,代碼來源:sensors.chart.py

示例4: __init__

# 需要導入模塊: from base import SimpleService [as 別名]
# 或者: from base.SimpleService import __init__ [as 別名]
 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,代碼行數:10,代碼來源:ovpn_status_log.chart.py

示例5: __init__

# 需要導入模塊: from base import SimpleService [as 別名]
# 或者: from base.SimpleService import __init__ [as 別名]
 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,代碼行數:11,代碼來源:ovpn_status_log.chart.py

示例6: __init__

# 需要導入模塊: from base import SimpleService [as 別名]
# 或者: from base.SimpleService import __init__ [as 別名]
 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,代碼行數:12,代碼來源:mdstat.chart.py

示例7: __init__

# 需要導入模塊: from base import SimpleService [as 別名]
# 或者: from base.SimpleService import __init__ [as 別名]
 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,代碼行數:12,代碼來源:bind_rndc.chart.py

示例8: __init__

# 需要導入模塊: from base import SimpleService [as 別名]
# 或者: from base.SimpleService import __init__ [as 別名]
 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,代碼行數:12,代碼來源:mdstat.chart.py

示例9: __init__

# 需要導入模塊: from base import SimpleService [as 別名]
# 或者: from base.SimpleService import __init__ [as 別名]
 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,代碼行數:13,代碼來源:cpuidle.chart.py

示例10: __init__

# 需要導入模塊: from base import SimpleService [as 別名]
# 或者: from base.SimpleService import __init__ [as 別名]
 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,代碼行數:14,代碼來源:cpufreq.chart.py

示例11: __init__

# 需要導入模塊: from base import SimpleService [as 別名]
# 或者: from base.SimpleService import __init__ [as 別名]
 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,代碼行數:14,代碼來源:cpufreq.chart.py

示例12: __init__

# 需要導入模塊: from base import SimpleService [as 別名]
# 或者: from base.SimpleService import __init__ [as 別名]
 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,代碼行數:14,代碼來源:freeradius.chart.py

示例13: __init__

# 需要導入模塊: from base import SimpleService [as 別名]
# 或者: from base.SimpleService import __init__ [as 別名]
 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,代碼行數:14,代碼來源:varnish.chart.py

示例14: __init__

# 需要導入模塊: from base import SimpleService [as 別名]
# 或者: from base.SimpleService import __init__ [as 別名]
 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,代碼行數:15,代碼來源:mongodb.chart.py

示例15: __init__

# 需要導入模塊: from base import SimpleService [as 別名]
# 或者: from base.SimpleService import __init__ [as 別名]
 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,代碼行數:16,代碼來源:bind_rndc.chart.py


注:本文中的base.SimpleService.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。