Exemplo n.º 1
0
 def add_options(self):
     self.add_hostoption(default_host=self.default_host, default_port=self.default_port)
     self.add_useroption(default_user=self.default_user, default_password=self.default_password)
     self.add_opt('-S', '--use-ssl', action='store_true', help='Use SSL connection')
     self.add_opt('-O', '--vhost', default=getenvs('RABBITMQ_VHOST', default=self.default_vhost),
                  help='{name} Vhost to connect to ($RABBITMQ_VHOST, default: {default_vhost})'\
                       .format(name=self.name, default_vhost=self.default_vhost))
     self.add_opt('-E', '--exchange', default=getenvs('RABBITMQ_EXCHANGE', default=self.default_exchange),
                  help='Exchange to use ($RABBITMQ_EXCHANGE, default: {default_exchange}, '\
                       .format(default_exchange=self.default_exchange) + "blank uses the nameless exchange)")
     self.add_opt('-T', '--exchange-type', default=getenvs('RABBITMQ_EXCHANGE_TYPE',
                                                           default=self.default_exchange_type),
                  help='Exchange type to use ($RABBITMQ_EXCHANGE_TYPE, default: {default_exchange_type})'\
                       .format(default_exchange_type=self.default_exchange_type))
     self.add_opt('-Q', '--queue', default=getenvs('RABBITMQ_QUEUE', default=self.default_queue),
                  help='Queue to create and bind to exchange ($RABBITMQ_QUEUE, ' + \
                       'default: {default_queue}, auto-generated if not supplied)'.\
                       format(default_queue=self.default_queue))
     self.add_opt('-R', '--routing-key', default=getenvs('RABBITMQ_ROUTING_KEY', default=None),
                  help='Routing Key to use when publishing unique test message ' + \
                       'to exchange ($RABBITMQ_ROUTING_KEY, defaults to same as queue name if not supplied)')
     #self.add_opt('-N', '--no-ack', action='store_true', default=self.default_no_ack,
     #             help='Do not use acknowledgements')
     self.add_opt('--non-durable', action='store_true',
                  help='Publish message as non-persistent / create queue as non-durable')
     self.add_opt('--use-transactions', action='store_true',
                  help='Use AMQP transactions instead of RabbitMQ confirmation (transactions are ~250x slower')
     self.add_opt('-C', '--connection-attempts', default=self.default_conn_attempts,
                  help='Number of connection attempts (default: {default_conn_attempts})'\
                       .format(default_conn_attempts=self.default_conn_attempts))
     self.add_opt('-r', '--retry-delay', default=self.default_retry_delay,
                  help='Retry delay between connection attempts (default: {default_retry_delay})')
     self.add_opt('-s', '--sleep', metavar='secs',
                  help='Sleep in seconds between producing and consuming from given exchange (optional)')
     self.add_thresholds(default_warning=1, default_critical=2)
Exemplo n.º 2
0
 def add_options(self):
     self.add_hostoption(default_host=self.default_host, default_port=self.default_port)
     self.add_useroption(default_user=self.default_user, default_password=self.default_password)
     self.add_opt('-S', '--use-ssl', action='store_true', help='Use SSL connection')
     self.add_opt('-O', '--vhost', default=getenvs('RABBITMQ_VHOST', default=self.default_vhost),
                  help='{name} Vhost to connect to ($RABBITMQ_VHOST, default: {default_vhost})'\
                       .format(name=self.name, default_vhost=self.default_vhost))
     self.add_opt('-E', '--exchange', default=getenvs('RABBITMQ_EXCHANGE', default=self.default_exchange),
                  help='Exchange to use ($RABBITMQ_EXCHANGE, default: {default_exchange}, '\
                       .format(default_exchange=self.default_exchange) + "blank uses the nameless exchange)")
     self.add_opt('-T', '--exchange-type', default=getenvs('RABBITMQ_EXCHANGE_TYPE',
                                                           default=self.default_exchange_type),
                  help='Exchange type to use ($RABBITMQ_EXCHANGE_TYPE, default: {default_exchange_type})'\
                       .format(default_exchange_type=self.default_exchange_type))
     self.add_opt('-Q', '--queue', default=getenvs('RABBITMQ_QUEUE', default=self.default_queue),
                  help='Queue to create and bind to exchange ($RABBITMQ_QUEUE, ' + \
                       'default: {default_queue}, auto-generated if not supplied)'.\
                       format(default_queue=self.default_queue))
     self.add_opt('-R', '--routing-key', default=getenvs('RABBITMQ_ROUTING_KEY', default=None),
                  help='Routing Key to use when publishing unique test message ' + \
                       'to exchange ($RABBITMQ_ROUTING_KEY, defaults to same as queue name if not supplied)')
     #self.add_opt('-N', '--no-ack', action='store_true', default=self.default_no_ack,
     #             help='Do not use acknowledgements')
     self.add_opt('--non-durable', action='store_true',
                  help='Publish message as non-persistent / create queue as non-durable')
     self.add_opt('--use-transactions', action='store_true',
                  help='Use AMQP transactions instead of RabbitMQ confirmation (transactions are ~250x slower')
     self.add_opt('-C', '--connection-attempts', default=self.default_conn_attempts,
                  help='Number of connection attempts (default: {default_conn_attempts})'\
                       .format(default_conn_attempts=self.default_conn_attempts))
     self.add_opt('-r', '--retry-delay', default=self.default_retry_delay,
                  help='Retry delay between connection attempts (default: {default_retry_delay})')
     self.add_opt('-s', '--sleep', metavar='secs',
                  help='Sleep in seconds between producing and consuming from given exchange (optional)')
     self.add_thresholds(default_warning=1, default_critical=2)
 def add_options(self):
     super(CheckRabbitMQQueue, self).add_options()
     self.add_opt('-Q', '--queue', default=getenvs('RABBITMQ_QUEUE'),
                  help='RabbitMQ queue to check ($RABBITMQ_QUEUE)')
     self.add_opt('-O', '--vhost', default=getenvs('RABBITMQ_VHOST', default=self.default_vhost),
                  help='RabbitMQ vhost for queue ($RABBITMQ_VHOST, default: /)')
     self.add_opt('-U', '--durable',
                  help="Check queue durable (optional, arg must be: 'true' / 'false')")
     self.add_opt('-l', '--list-queues', action='store_true', help='List queues on given vhost and exit')
Exemplo n.º 4
0
 def add_options(self):
     super(CheckRabbitMQExchange, self).add_options()
     self.add_opt('-E', '--exchange', default=getenvs('RABBITMQ_EXCHANGE'),
                  help='RabbitMQ exchange to check ($RABBITMQ_EXCHANGE)')
     self.add_opt('-O', '--vhost', default=getenvs('RABBITMQ_VHOST', default=self.default_vhost),
                  help='RabbitMQ vhost for exchange ($RABBITMQ_VHOST, default: /)')
     self.add_opt('-T', '--type', help='Check exchange is of given type (optional, must be one of: {0})'\
                                       .format(', '.join(self.valid_exchange_types)))
     self.add_opt('-U', '--durable', help="Check exchange durable (optional, arg must be: 'true' / 'false')")
     self.add_opt('-l', '--list-exchanges', action='store_true', help='List exchanges on given vhost and exit')
Exemplo n.º 5
0
 def add_options(self):
     super(CheckRabbitMQAliveness, self).add_options()
     self.add_opt(
         '-O',
         '--vhost',
         default=getenvs('RABBITMQ_VHOST', default=self.default_vhost),
         help='RabbitMQ vhost to check ($RABBITMQ_VHOST, default: /)')
 def add_options(self):
     super(CheckRabbitMQVhost, self).add_options()
     self.add_opt('-O', '--vhost', default=getenvs('RABBITMQ_VHOST', default=self.default_vhost),
                  help='RabbitMQ vhost to check ($RABBITMQ_VHOST, default: /)')
     self.add_opt('--no-tracing', action='store_true', default=False,
                  help='Check vhost does not have tracing enabled')
     self.add_opt('-l', '--list-vhosts', action='store_true', help='List vhosts and exit')
Exemplo n.º 7
0
 def add_options(self):
     super(CheckRabbitMQAliveness, self).add_options()
     self.add_opt(
         "-O",
         "--vhost",
         default=getenvs("RABBITMQ_VHOST", default=self.default_vhost),
         help="RabbitMQ vhost to check ($RABBITMQ_VHOST, default: /)",
     )
Exemplo n.º 8
0
 def add_options(self):
     super(CheckRabbitMQQueue, self).add_options()
     self.add_opt('-Q',
                  '--queue',
                  default=getenvs('RABBITMQ_QUEUE'),
                  help='RabbitMQ queue to check ($RABBITMQ_QUEUE)')
     self.add_opt(
         '-O',
         '--vhost',
         default=getenvs('RABBITMQ_VHOST', default=self.default_vhost),
         help='RabbitMQ vhost for queue ($RABBITMQ_VHOST, default: /)')
     self.add_opt(
         '-U',
         '--durable',
         help="Check queue durable (optional, arg must be: 'true' / 'false')"
     )
     self.add_opt('-l',
                  '--list-queues',
                  action='store_true',
                  help='List queues on given vhost and exit')
 def add_options(self):
     super(CheckRabbitMQVhost, self).add_options()
     self.add_opt(
         '-O',
         '--vhost',
         default=getenvs('RABBITMQ_VHOST', default=self.default_vhost),
         help='RabbitMQ vhost to check ($RABBITMQ_VHOST, default: /)')
     self.add_opt('--no-tracing',
                  action='store_true',
                  default=False,
                  help='Check vhost does not have tracing enabled')
     self.add_opt('-l',
                  '--list-vhosts',
                  action='store_true',
                  help='List vhosts and exit')