A minimalistic AMQP server ping tool. It tries to ping the AMQP server, then exits with zero status. If the server isn't responding it exits with nonzero status after making a configured number of attempts.
This may be used as a stage image to get the statically linked binary from.
FROM argentoff/ocamqping as ocamqping
FROM other_base_image
RUN something important
WORKDIR /app
COPY --from=ocamqping /ocamqping /sbin/
COPY . .
RUN something also important
$ git clone https://github.com/argent-smith/ocamqping.git
$ cd ocamqping
$ opam install -y .
ocamqping [OPTION]...
-
-P
,--log-process
(absentLOG_PROCESS
env) Whether to add process info (name & pid) to log messages. -
-T, --log-times (absent LOG_TIMES env) Whether to timestamp log messages.
-
--help[=FMT]
(default=auto
) Show this help in format FMT. The value FMT must be one ofauto
,pager
,groff
orplain
. Withauto
, the format ispager
orplain
whenever the TERM env var isdumb
or undefined. -
-i VAL
,--retry-interval=VAL
(absent=1
orOCAMQPING_RETRY_INTERVAL
env) Ping retry interval in seconds -
-q
,--quiet
Be quiet. Takes over--verbosity
. -
-r VAL
,--retry-count=VAL
(absent=255
orOCAMQPING_RETRY_COUNT
env) Ping retry count -
-u VAL
,--amqp-uri=VAL
(absent=amqp://localhost/
orAMQP_URI
env) AMQP server URI -
--verbosity=LEVEL
(absent=info
orLOG_VERBOSITY
env) Be more or less verbose. LEVEL must be one ofquiet
,error
,warning
,info
ordebug
. -
--version
Show version information.
These environment variables affect the execution of ocamqping:
-
OCAMQPING_RETRY_COUNT
See option--retry-count
. -
OCAMQPING_RETRY_INTERVAL
— See option--retry-interval
. -
AMQP_URI
— See option--amqp-uri
. -
LOG_PROCESS
— See option--log-process
. -
LOG_TIMES
— See option--log-times
. -
LOG_VERBOSITY
- See option ----verbosity
Feel free to clone and contribute to this program.