예제 #1
0
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self.config = {
         "instances": [{
             'url': 'http://localhost:3835/stats',
             'username': '******',
             'password': '******',
             'status_check': True,
             'collect_aggregates_only': False,
             'tag_service_check_by_host': True,
         }]
     }
     self.config_open = {
         'instances': [{
             'url': 'http://localhost:3836/stats',
             'collect_aggregates_only': False,
         }]
     }
     self.unixsocket_path = os.path.join(os.environ['VOLATILE_DIR'], 'datadog-haproxy-stats.sock')
     self.unixsocket_url = 'unix://{0}'.format(self.unixsocket_path)
     self.config_unixsocket = {
         'instances': [{
             'url': self.unixsocket_url,
             'collect_aggregates_only': False,
         }]
     }
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self.config = {"instances": [{
         "host": "127.0.0.1",
         "port": "8082",
         "api_key": "pdns_api_key"
     }]}
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self.config = {
         "instances": [
             {
                 "monitor_agent_url": "http://localhost:24220/api/plugins.json",
                 "plugin_ids": ["plg1"],
             }
         ]
     }
예제 #4
0
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self.config = {
         'instances': [
             {
                 'lighttpd_status_url': 'http://localhost:9449/server-status',
                 'tags': ['instance:first'],
             }
         ]
     }
예제 #5
0
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self.config = {
         "instances": [
             {
                 "expvar_url": "http://localhost:8079/debug/vars",
                 "tags": ["my_tag"],
                 "metrics": [{"path": "last_user"}, {"path": "num_calls", "type": "rate"}],
             }
         ]
     }
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self.config = {
         "instances": [{
             "expvar_url": 'http://localhost:8079',
             'tags': ['my_tag'],
             'metrics': [
                 {
                     'path': 'num_calls',
                     "type": "rate"
                 },
             ]
         }]
     }
예제 #7
0
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self.config = {
         "instances": [{
             "expvar_url":
             'http://localhost:8079/debug/vars',
             'tags': ['my_tag'],
             'metrics': [
                 {
                     'path': 'last_user'
                 },
                 {
                     'path': 'num_calls',
                     "type": "rate"
                 },
             ]
         }]
     }
예제 #8
0
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self.config = {
         "instances": [{
             'url': 'http://localhost:3835/stats',
             'username': '******',
             'password': '******',
             'status_check': True,
             'collect_aggregates_only': False,
             'tag_service_check_by_host': True,
         }]
     }
     self.config_open = {
         'instances': [{
             'url': 'http://localhost:3836/stats',
             'collect_aggregates_only': False,
         }]
     }
예제 #9
0
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self.config = {
         "instances": [{
             'url': 'http://localhost:3835/stats',
             'username': '******',
             'password': '******',
             'status_check': True,
             'collect_aggregates_only': False,
             'tag_service_check_by_host': True,
         }]
     }
     self.config_open = {
         'instances': [{
             'url': 'http://localhost:3836/stats',
             'collect_aggregates_only': False,
         }]
     }
예제 #10
0
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self._expvar_url = Fixtures.file('expvar_output')
     self.mock_config = {
         "instances": [{
             "expvar_url": self._expvar_url,
             "tags": ["optionaltag1", "optionaltag2"],
             "metrics": [
                 {
                     # Contains list traversal and default values
                     "path": "memstats/BySize/1/Mallocs",
                 },
                 {
                     "path": "memstats/PauseTotalNs",
                     "alias": "go_expvar.gc.pause",
                     "type": "rate"
                 },
                 {
                     "path": "random_walk",
                     "alias": "go_expvar.gauge1",
                     "type": "gauge",
                     "tags": ["metric_tag1:metric_value1", "metric_tag2:metric_value2"]
                 }
             ]
         }]
     }
     self.mocks = {
         '_get_data': _get_data_mock,
     }
     self.config = {
         "instances": [{
             "expvar_url": 'http://localhost:8079/debug/vars',
             'tags': ['my_tag'],
             'metrics': [
                 {
                     'path': 'last_user'
                 },
                 {
                     'path': 'num_calls',
                     "type": "rate"
                 },
             ]
         }]
     }
예제 #11
0
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self.cluster_gauges = []
     self.by_db_gauges = []
     self.erlang_gauges = []
     self.replication_tasks_gauges = []
     self.compaction_tasks_gauges = []
     self.indexing_tasks_gauges = []
     self.view_compaction_tasks_gauges = []
     self.by_dd_gauges = []
     with open('couch/metadata.csv', 'rb') as csvfile:
         reader = csv.reader(csvfile)
         reader.next()  # This one skips the headers
         for row in reader:
             if row[0] in [
                     'couchdb.couchdb.request_time',
                     'couchdb.by_db.disk_size'
             ]:
                 # Skip CouchDB 1.x specific metrics
                 continue
             elif row[0].startswith("couchdb.by_db."):
                 self.by_db_gauges.append(row[0])
             elif row[0].startswith("couchdb.erlang"):
                 self.erlang_gauges.append(row[0])
             elif row[0] in [
                     'couchdb.active_tasks.replication.count',
                     'couchdb.active_tasks.db_compaction.count',
                     'couchdb.active_tasks.indexer.count',
                     'couchdb.active_tasks.view_compaction.count'
             ]:
                 self.cluster_gauges.append(row[0])
             elif row[0].startswith("couchdb.active_tasks.replication"):
                 self.replication_tasks_gauges.append(row[0])
             elif row[0].startswith("couchdb.active_tasks.db_compaction"):
                 self.compaction_tasks_gauges.append(row[0])
             elif row[0].startswith("couchdb.active_tasks.indexer"):
                 self.indexing_tasks_gauges.append(row[0])
             elif row[0].startswith("couchdb.active_tasks.view_compaction"):
                 self.view_compaction_tasks_gauges.append(row[0])
             elif row[0].startswith("couchdb.by_ddoc."):
                 self.by_dd_gauges.append(row[0])
             else:
                 self.cluster_gauges.append(row[0])
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self._expvar_url = Fixtures.file('expvar_output', sdk_dir=FIXTURE_DIR)
     self.mock_config = {
         "instances": [{
             "expvar_url": self._expvar_url,
             "tags": ["optionaltag1", "optionaltag2"],
             "metrics": [
                 {
                     # Contains list traversal and default values
                     "path": "memstats/BySize/1/Mallocs",
                 },
                 {
                     "path": "memstats/PauseTotalNs",
                     "alias": "go_expvar.gc.pause",
                     "type": "rate"
                 },
                 {
                     "path": "random_walk",
                     "alias": "go_expvar.gauge1",
                     "type": "gauge",
                     "tags": ["metric_tag1:metric_value1", "metric_tag2:metric_value2"]
                 }
             ]
         }]
     }
     self.mocks = {
         '_get_data': _get_data_mock,
     }
     self.config = {
         "instances": [{
             "expvar_url": 'http://localhost:8079/debug/vars',
             'tags': ['my_tag'],
             'metrics': [
                 {
                     'path': 'num_calls',
                     "type": "rate"
                 },
             ]
         }]
     }
예제 #13
0
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self.config = {"instances": [{"server": "http://localhost:5984"}]}
예제 #14
0
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self.config = {"init_config": {}, "instances": [{}]}
예제 #15
0
 def assertEvent(self, msg_text, alert_type=None, count=None, tags=None):
     AgentCheckTest.assertEvent(
         self, msg_text, alert_type=alert_type, count=count, tags=tags,
         aggregation_key='DDEVENTLOGTEST', event_type='win32_log_event',
         source_type_name='event viewer', msg_title='Application/DDEVENTLOGTEST'
     )
예제 #16
0
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self.config = {"instances": [{"url": "http://localhost:2379"}]}
예제 #17
0
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self.config = {"instances": [{"url": "http://localhost:4001"}]}
예제 #18
0
 def tearDown(self):
     AgentCheckTest.tearDown(self)
     if self.path and os.path.isfile(self.path):
         os.unlink(self.path)
예제 #19
0
 def setUp(self):
     AgentCheckTest.setUp(self)
     self.fd, self.path = mkstemp()
예제 #20
0
    def __init__(self, *args, **kwargs):
        AgentCheckTest.__init__(self, *args, **kwargs)
        self.config = {
	    "init_config": {},
	    "instances": [{}]
        }
예제 #21
0
 def __init__(self, *args, **kwargs):
     AgentCheckTest.__init__(self, *args, **kwargs)
     self.config = {"instances": [{"server": "http://localhost:5984"}]}