コード例 #1
0
    def setUp(self):
        username = collectd.Config('Username', ('admin',))
        password = collectd.Config('Password', ('admin',))
        realm = collectd.Config('Realm', ('RabbitMQ Management',))
        host = collectd.Config('Host', ('localhost',))
        port = collectd.Config('Port', ('15672',))
        schema = collectd.Config('Scheme', ('http',))
        vhost_prefix = collectd.Config('VHostPrefix', ('',))

        ignore_queues = [
            collectd.Config('Regex', ('amq-gen-.*',)),
            collectd.Config('Regex', ('tmp-.*',)),
        ]
        ignore_exchanges = [
            collectd.Config('Regex', ('amq.*',)),
        ]
        ignore_queue = collectd.Config('Ignore', ('queue',), ignore_queues)
        ignore_exchange = collectd.Config('Ignore', ('exchange',),
                                          ignore_exchanges)
        config_data = [username,
                       password,
                       host,
                       port,
                       realm,
                       schema,
                       ignore_queue,
                       ignore_exchange,
                       vhost_prefix
                       ]
        self.test_config = collectd.Config(
            'Module', ('rabbitmq',), config_data)

        collectd_plugin.configure(self.test_config)
        self.collectd_plugin = collectd_plugin.CollectdPlugin(
            collectd_plugin.CONFIGS[0])
コード例 #2
0
 def setUp(self):
     username = collectd.Config('Username', ('admin', ))
     password = collectd.Config('Password', ('admin', ))
     realm = collectd.Config('Realm', ('RabbitMQ Management', ))
     host = collectd.Config('Host', ('localhost', ))
     port = collectd.Config('Port', ('15672', ))
     ignore_queues = [
         collectd.Config('Regex', ('amq-gen-.*', )),
         collectd.Config('Regex', ('tmp-.*', )),
     ]
     ignore_exchanges = [
         collectd.Config('Regex', ('amq.*', )),
     ]
     ignore_queue = collectd.Config('Ignore', ('queue', ), ignore_queues)
     ignore_exchange = collectd.Config('Ignore', ('exchange', ),
                                       ignore_exchanges)
     self.module = collectd.Config('Module', ('rabbitmq', ), [
         username, password, host, port, realm, ignore_queue,
         ignore_exchange
     ])
     collectd_plugin.configure(self.module)
     self.collectd_plugin = collectd_plugin.CollectdPlugin()