newrelic/check_docker

No ability to check separate containers with same image name

intjonathan opened this issue · 1 comments

Given a docker ps like this:

CONTAINER ID        IMAGE                                                        COMMAND             CREATED             STATUS              PORTS                  NAMES
edefe9ea93f8        foo/baz:59977daa1075abda15d7495781c1cf458e0cd863   script/run          3 days ago          Up 3 days           0.0.0.0:8485->80/tcp   dreamy_archimedes
3e656b925a5c        foo/baz:59977daa1075abda15d7495781c1cf458e0cd863   script/run          3 days ago          Up 3 days           0.0.0.0:80->80/tcp     romantic_albattani

There's no way to write a check that validates both of these containers are up. Passing -image-id="foo/baz" returns OK: 2 containers up, but would return OK even if only one was.

zoni commented

#10 solves this if you're willing to explicitly name your containers (the other solution I could think of would be to add the abilty to specify that a certain image is expected to have at least x number of containers running).