Git Product home page Git Product logo

check_docker's People

Contributors

didip avatar melissaklein24 avatar relistan avatar zoni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

check_docker's Issues

No ability to check separate containers with same image name

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.

Connect to docker over unix domain socket

It would be nice if the check_docker was able to connect to the docker service over the unix domain socket; /var/run/docker.sock.

By default docker does not listen to a port, but uses the more secure connection through unix domain socket.

check does not timeout

Hi,

Sometime docker does not respond (unix socket in my scenario). When this happens, check_docker hangs forever. As we would like it to be a critical, for now we have to use a small wrapper to detect the timeout and raise the CRITICAL :

#!/bin/sh

timeout 5 /opt/check_docker/check_docker --base-url='unix:///var/run/docker.sock' --crit-data-space=90 --warn-data-space=85 --crit-meta-space=90 --warn-meta-space=85
R=$?
if [ "$R" = '124' ]; then
  echo "CRITICAL docker timeout"
  exit 2
fi

exit $R

I think it is a must-have for a check. We are using sensu here, but timeout is also a guideline for nagios checks https://nagios-plugins.org/doc/guidelines.html#RUNTIME

Check returns incorrect Metaspace utilisation due to human readable units

When checking against our docker systems check_docker is returning the following:
CRITICAL: 17 containers - Meta Space Used: 818% - Meta Space Used: 818%
Docker info reports the following:

    Data Space Used: 6.124 GB
    Data Space Total: 107.4 GB
    Metadata Space Used: 17.56 MB
    Metadata Space Total: 2.147 GB

this is likely due to the docker devmapper/driver.go converting to human friendly units as per below:

        status := [][2]string{
        {"Pool Name", s.PoolName},
        {"Pool Blocksize", fmt.Sprintf("%s", units.HumanSize(float64(s.SectorSize)))},
        {"Backing Filesystem", backingFs},
        {"Data file", s.DataFile},
        {"Metadata file", s.MetadataFile},
        {"Data Space Used", fmt.Sprintf("%s", units.HumanSize(float64(s.Data.Used)))},
        {"Data Space Total", fmt.Sprintf("%s", units.HumanSize(float64(s.Data.Total)))},
        {"Data Space Available", fmt.Sprintf("%s", units.HumanSize(float64(s.Data.Available)))},
        {"Metadata Space Used", fmt.Sprintf("%s", units.HumanSize(float64(s.Metadata.Used)))},
        {"Metadata Space Total", fmt.Sprintf("%s", units.HumanSize(float64(s.Metadata.Total)))},
        {"Metadata Space Available", fmt.Sprintf("%s", units.HumanSize(float64(s.Metadata.Available)))},
        {"Udev Sync Supported", fmt.Sprintf("%v", s.UdevSyncSupported)},

Given that human readability is hard coded in the driver, it seems that the plugin needs to take this into account and normalise all units for comparison.

Doesn't build with go 1.3 or 1.6 on Debian 8.3

I tried to build check_docker with go 1.3 standard Debian wheezy package installed and it failed. I downloaded and installed go 1.6 from golang.org and got the same result, as below.

$ go get github.com/newrelic/check_docker
# github.com/newrelic/check_docker
src/github.com/newrelic/check_docker/check_docker.go:68: cannot assign *docker.DockerInfo to cd.dockerInfoData (type *docker.Env) in multiple assignment

The line is part of the 5 Feb 2015 refactor and there are binary downloads after that, so clearly it (used to) build for others.

https support

Our docker host is secured by TLS as mentioned here. When using curl to access this secured docker daemon, these additional switches are required:

$ curl --insecure --cert ~/.docker/cert.pem --key ~/.docker/key.pem https://dockerhost:2376/images/json

I'm no go expert, but scanning the check_docker I see no way to provide a TLS certificate and key. Additionally, here is the result of a naive attempt:

$ /tmp/check_docker/check_docker-linux -base-url="https://dockerhost:2376"
CRITICAL: Get https://dockerhost:2376/v1.10/info: x509: certificate signed by unknown authority

Does check_docker need additional support added in order to connect to a TLS-secured docker daemon?

base-url flag doesn't work properly

Looks like the base-url flag isn't parsed properly making it impossible to override the default. Also, the program actually fails if the docker daemon isn't listening on the default endpoint (http://localhost:2375).

expected:

$ ./check_docker -base-url="https://$(boot2docker ip):2376"
CRITICAL: Get https://192.168.59.103:2376/containers/json: x509: certificate signed by unknown authority

actual:

$ ./check_docker -base-url="https://$(boot2docker ip):2376"
CRITICAL: cannot connect to Docker endpoint

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.