Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle case where we can't read docker storage info #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,17 @@ func (c *CheckStorage) eval() bool {
}
promDockerDataStorageFree.Set(float64(dataSpaceFree))
logrus.Debugf("Found 'Data Space Available' value of ", item[1])
}

if item[0] == "Metadata Space Available" {
} else if item[0] == "Metadata Space Available" {
metadataSpaceFree, err = humanize.ParseBytes(item[1])
if err != nil {
panic(err)
}
promDockerMetadataStorageFree.Set(float64(metadataSpaceFree))
logrus.Debugf("Found 'Metadata Space Available' value of ", item[1])
} else {
// we didn't find any of our storage keys
logrus.Error("Didn't find storage information from Docker API. Skipping storage evaluation")
return true
}
}

Expand Down
7 changes: 5 additions & 2 deletions vendor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
github.com/wjimenez5271/cowcheck

github.com/Sirupsen/logrus v0.10.0
github.com/urfave/cli v1.18.0
github.com/davecgh/go-spew 346938d642f2ec3594ed81d874461961cd0faa76
github.com/miekg/dns 113c7538ea6d8f429071f901bd26af59cc9676fe
github.com/miekg/dns 113c7538ea6d8f429071f901bd26af59cc9676fe
github.com/docker/docker/client v17.03.2-ce
github.com/dustin/go-humanize bb3d318650d48840a39aa21a027c6630e198e626
github.com/prometheus/client_golang/prometheus 661e31bf844dfca9aeba15f27ea8aa0d485ad212
github.com/prometheus/client_golang/prometheus/promhttp 661e31bf844dfca9aeba15f27ea8aa0d485ad212