Skip to content
This repository was archived by the owner on Apr 21, 2020. It is now read-only.
Open
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
14 changes: 4 additions & 10 deletions check_docker.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"encoding/json"
"errors"
"flag"
"fmt"
Expand Down Expand Up @@ -39,7 +38,7 @@ type CheckDocker struct {
TLSKeyPath string
TLSCAPath string
dockerclient *dockerlib.Client
dockerInfoData *dockerlib.Env
dockerInfoData *dockerlib.DockerInfo
dockerContainersData []dockerlib.APIContainers
}

Expand Down Expand Up @@ -91,13 +90,8 @@ func (cd *CheckDocker) GetData() error {
}

func (cd *CheckDocker) getByteSizeDriverStatus(key string) (bytesize.ByteSize, error) {
var statusInArray [][]string

err := json.Unmarshal([]byte(cd.dockerInfoData.Get("DriverStatus")), &statusInArray)

if err != nil {
return -1, errors.New("Unable to extract DriverStatus info.")
}
var statusInArray [][2]string
statusInArray = cd.dockerInfoData.DriverStatus

for _, status := range statusInArray {
if status[0] == key {
Expand Down Expand Up @@ -276,7 +270,7 @@ func main() {

statuses := make([]*nagios.NagiosStatus, 0)

driver := cd.dockerInfoData.Get("Driver")
driver := cd.dockerInfoData.Driver

// Unfortunately, Metadata Space and Data Space information is only available on devicemapper
if driver == "devicemapper" {
Expand Down