Exemplo n.º 1
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     self.url = self.configuration.get(
         'url', "http://127.0.0.1:8080/manager/status?XML=true")
     self.connector_name = self.configuration.get('connector_name', None)
     self.order = ORDER
     self.definitions = CHARTS
Exemplo n.º 2
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self.host = self.configuration.get('host', '127.0.0.1')
     self.port = self.configuration.get('port', 15672)
     self.scheme = self.configuration.get('scheme', 'http')
Exemplo n.º 3
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self.host = self.configuration.get('host', '127.0.0.1')
     self.port = self.configuration.get('port', 15672)
     self.scheme = self.configuration.get('scheme', 'http')
Exemplo n.º 4
0
    def __init__(self, configuration=None, name=None):
        self.ERROR = False
        UrlService.__init__(self, configuration=configuration, name=name)
        self.order = []
        self.definitions = {}

        # config parsing
        self.monitoring_dbs = self.configuration.get('monitoring_dbs')
        # self.monitoring_dbs = ['one']
        self.untrack_dbs = self.configuration.get('untrack_dbs',
                                                  ['_replicator', '_users'])

        # urls
        self.baseurl = str(self.configuration.get('url'))
        # self.baseurl = 'http://10.0.0.10:5984/'
        self.active_tasks_url = str(self.baseurl + '_active_tasks/')
        self.all_dbs_url = str(self.baseurl + '_all_dbs/')

        # auth
        self.user = self.configuration.get('couch_username') or None
        # self.user = '******'
        self.password = self.configuration.get('couch_password') or None
        # self.password = '******'
        if self.user:
            self.base64string = base64.encodestring(
                '%s:%s' % (self.user, self.password)).replace('\n', '')

        self.data = {}
Exemplo n.º 5
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     if len(self.url) == 0:
         self.url = "http://localhost:8080/manager/status?XML=true"
     self.order = ORDER
     self.definitions = CHARTS
     self.port = 8080
Exemplo n.º 6
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     if len(self.url) == 0:
         self.url = "http://localhost:8080/manager/status?XML=true"
     self.order = ORDER
     self.definitions = CHARTS
     self.port = 8080
Exemplo n.º 7
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     try:
         self.baseurl = str(self.configuration['url'])
     except (KeyError, TypeError):
         self.baseurl = 'http://localhost:9090'
     self.order = ORDER
     self.definitions = CHARTS
Exemplo n.º 8
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     try:
         self.baseurl = str(self.configuration['url'])
     except (KeyError, TypeError):
         self.baseurl = 'http://localhost:9090'
     self.order = ORDER
     self.definitions = CHARTS
Exemplo n.º 9
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self.host = self.configuration.get('host')
     self.port = self.configuration.get('port')
     self.user = self.configuration.get('user')
     self.password = self.configuration.get('pass')
     self.latency = dict()
Exemplo n.º 10
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self.host = self.configuration.get('host')
     self.port = self.configuration.get('port', 9200)
     self.scheme = self.configuration.get('scheme', 'http')
     self.latency = dict()
     self.methods = list()
Exemplo n.º 11
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self.host = self.configuration.get('host')
     self.port = self.configuration.get('port')
     self.user = self.configuration.get('user')
     self.password = self.configuration.get('pass')
     self.latency = dict()
Exemplo n.º 12
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self.host = self.configuration.get('host')
     self.port = self.configuration.get('port', 9200)
     self.scheme = self.configuration.get('scheme', 'http')
     self.latency = dict()
     self.methods = list()
Exemplo n.º 13
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     self.url = self.configuration.get('url', 'http://localhost/status?full&json')
     self.order = ORDER
     self.definitions = CHARTS
     self.regex = re.compile(r'([a-z][a-z ]+): ([\d.]+)')
     self.json = '&json' in self.url or '?json' in self.url
     self.json_full = self.url.endswith(('?full&json', '?json&full'))
     self.if_all_processes_running = dict([(c_name + p_name, 0) for c_name, func in CALC
                                           for metric, p_name in PER_PROCESS_INFO])
Exemplo n.º 14
0
 def __init__(self, configuration=None, name=None):
     if 'socket' in configuration:
         SocketService.__init__(self, configuration=configuration, name=name)
         self.poll = SocketService
         self.options_ = dict(regex=REGEX['socket'], stat='show stat\n', info='show info\n')
     else:
         UrlService.__init__(self, configuration=configuration, name=name)
         self.poll = UrlService
         self.options_ = dict(regex=REGEX['url'], stat=self.url, info=url_remove_params(self.url))
     self.order = ORDER
     self.definitions = CHARTS
Exemplo n.º 15
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     if len(self.url) == 0:
         self.url = "http://localhost/status"
     self.order = ORDER
     self.charts = CHARTS
     self.assignment = {"active processes": 'active',
                        "max active processes": 'maxActive',
                        "idle processes": 'idle',
                        "accepted conn": 'requests',
                        "max children reached": 'reached',
                        "slow requests": 'slow'}
Exemplo n.º 16
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     if len(self.url) == 0:
         self.url = "http://localhost/status"
     self.order = ORDER
     self.definitions = CHARTS
     self.assignment = {"active processes": 'active',
                        "max active processes": 'maxActive',
                        "idle processes": 'idle',
                        "accepted conn": 'requests',
                        "max children reached": 'reached',
                        "slow requests": 'slow'}
Exemplo n.º 17
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     self.url = self.configuration.get('url',
                                       'http://localhost/status?full&json')
     self.order = ORDER
     self.definitions = CHARTS
     self.regex = re.compile(r'([a-z][a-z ]+): ([\d.]+)')
     self.json = '&json' in self.url or '?json' in self.url
     self.json_full = self.url.endswith(('?full&json', '?json&full'))
     self.if_all_processes_running = dict([
         (c_name + p_name, 0) for c_name, func in CALC
         for metric, p_name in PER_PROCESS_INFO
     ])
 def __init__(self, configuration=None, name=None):
     if 'socket' in configuration:
         SocketService.__init__(self, configuration=configuration, name=name)
         self.poll_method = SocketService
         self.request = 'show stat\n'
     else:
         UrlService.__init__(self, configuration=configuration, name=name)
         self.poll_method = UrlService
     self.order = ORDER
     self.definitions = CHARTS
     self.order_front = [_ for _ in ORDER if _.startswith('f')]
     self.order_back = [_ for _ in ORDER if _.startswith('b')]
     self.charts = True
Exemplo n.º 19
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self.host = self.configuration.get('host', '127.0.0.1')
     self.port = self.configuration.get('port', 5984)
     self.node = self.configuration.get('node', '[email protected]')
     self.scheme = self.configuration.get('scheme', 'http')
     self.user = self.configuration.get('user')
     self.password = self.configuration.get('pass')
     try:
         self.dbs = self.configuration.get('databases').split(' ')
     except (KeyError, AttributeError):
         self.dbs = []
Exemplo n.º 20
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     if len(self.url) == 0:
         self.url = "http://localhost/status?full&json"
     self.order = ORDER
     self.definitions = CHARTS
     self.assignment = {"active processes": 'active',
                        "max active processes": 'maxActive',
                        "idle processes": 'idle',
                        "accepted conn": 'requests',
                        "max children reached": 'reached',
                        "slow requests": 'slow'}
     self.proc_assignment = {"request duration": 'ReqDur',
                             "last request cpu": 'ReqCPU',
                             "last request memory": 'ReqMem'}
Exemplo n.º 21
0
    def __init__(self, configuration=None, name=None):
        UrlService.__init__(self, configuration=configuration, name=name)

        # if memstats collection is enabled, add the charts and their order
        if self.configuration.get('collect_memstats'):
            self.definitions = MEMSTATS_CHARTS
            self.order = MEMSTATS_ORDER
        else:
            self.definitions = dict()
            self.order = list()

        # if extra charts are defined, parse their config
        extra_charts = self.configuration.get('extra_charts')
        if extra_charts:
            self._parse_extra_charts_config(extra_charts)
Exemplo n.º 22
0
    def __init__(self, configuration=None, name=None):
        UrlService.__init__(self, configuration=configuration, name=name)

        # if memstats collection is enabled, add the charts and their order
        if self.configuration.get('collect_memstats'):
            self.definitions = MEMSTATS_CHARTS
            self.order = MEMSTATS_ORDER
        else:
            self.definitions = dict()
            self.order = list()

        # if extra charts are defined, parse their config
        extra_charts = self.configuration.get('extra_charts')
        if extra_charts:
            self._parse_extra_charts_config(extra_charts)
Exemplo n.º 23
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     if len(self.url) == 0:
         self.url = "http://localhost/server-status?auto"
     self.order = ORDER
     self.definitions = CHARTS
     self.assignment = {"BytesPerReq": 'size_req',
                        "IdleWorkers": 'idle',
                        "BusyWorkers": 'busy',
                        "ReqPerSec": 'requests_sec',
                        "BytesPerSec": 'size_sec',
                        "Total Accesses": 'requests',
                        "Total kBytes": 'sent',
                        "ConnsTotal": 'connections',
                        "ConnsAsyncKeepAlive": 'keepalive',
                        "ConnsAsyncClosing": 'closing',
                        "ConnsAsyncWriting": 'writing'}
Exemplo n.º 24
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     if len(self.url) == 0:
         self.url = "http://localhost:8080/manager/status?XML=true"
     self.order = ORDER
     self.definitions = CHARTS
     # get port from url
     self.port = 0
     for i in self.url.split('/'):
         try:
             int(i[-1])
             self.port = i.split(':')[-1]
             break
         except:
             pass
     if self.port == 0:
         self.port = 80
Exemplo n.º 25
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     if len(self.url) == 0:
         self.url = "http://localhost:8080/manager/status?XML=true"
     self.order = ORDER
     self.definitions = CHARTS
     # get port from url
     self.port = 0
     for i in self.url.split('/'):
         try:
             int(i[-1])
             self.port = i.split(':')[-1]
             break
         except:
             pass
     if self.port == 0:
         self.port = 80
Exemplo n.º 26
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     if len(self.url) == 0:
         self.url = "http://localhost/status?full&json"
     self.order = ORDER
     self.definitions = CHARTS
     self.assignment = {
         "active processes": 'active',
         "max active processes": 'maxActive',
         "idle processes": 'idle',
         "accepted conn": 'requests',
         "max children reached": 'reached',
         "slow requests": 'slow'
     }
     self.proc_assignment = {
         "request duration": 'ReqDur',
         "last request cpu": 'ReqCPU',
         "last request memory": 'ReqMem'
     }
Exemplo n.º 27
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     if len(self.url) == 0:
         self.url = "http://localhost/server-status?auto"
     self.order = ORDER
     self.charts = CHARTS
     self.assignment = {
         "BytesPerReq": 'size_req',
         "IdleWorkers": 'idle',
         "BusyWorkers": 'busy',
         "ReqPerSec": 'requests_sec',
         "BytesPerSec": 'size_sec',
         "Total Accesses": 'requests',
         "Total kBytes": 'sent',
         "ConnsTotal": 'connections',
         "ConnsAsyncKeepAlive": 'keepalive',
         "ConnsAsyncClosing": 'closing',
         "ConnsAsyncWriting": 'writing'
     }
Exemplo n.º 28
0
    def __init__(self, configuration=None, name=None):
        self.ERROR = False
        UrlService.__init__(self, configuration=configuration, name=name)
        # self.monitoring_tasks = ['indexer', 'database_compaction', 'view_compaction', 'replication']
        self.monitoring_tasks = self.configuration.get('monitoring_tasks')
        self.order = ORDER
        self.definitions = CHARTS

        self.baseurl = str(self.configuration.get('url'))
        # self.all_dbs_url = str(self.baseurl + '_all_dbs/')
        self.active_tasks_url = str(self.baseurl + '_active_tasks/')

        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
        if self.user:
            self.base64string = base64.encodestring('%s:%s' % (self.user, self.password)).replace('\n', '')

        # self.data = {'indexer_task': 0, 'database_compaction_task': 0, 'view_compaction_task': 0, 'replication_task': 0}
        self.data = {}
        for task in self.monitoring_tasks:
            self.data[task + '_task'] = 0
Exemplo n.º 29
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self.url = self.configuration.get('url', 'http://localhost/server-status?auto')
Exemplo n.º 30
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
Exemplo n.º 31
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     self.order = ORDER
     self.definitions = CHARTS
     self.url = self.configuration.get(
         'url', 'http://localhost/server-status?auto')
Exemplo n.º 32
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     if len(self.url) == 0:
         self.url = "http://localhost/stub_status"
     self.order = ORDER
     self.definitions = CHARTS
Exemplo n.º 33
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     if len(self.url) == 0:
         self.url = "http://localhost/stub_status"
     self.order = ORDER
     self.charts = CHARTS
Exemplo n.º 34
0
 def __init__(self, configuration=None, name=None):
     UrlService.__init__(self, configuration=configuration, name=name)
     self.url = self.configuration.get('url', "http://127.0.0.1:8080/manager/status?XML=true")
     self.order = ORDER
     self.definitions = CHARTS