Skip to content

Commit 6cce782

Browse files
committed
2 parents a8e3265 + 8dbd030 commit 6cce782

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

client/controller.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,12 @@ func (hosts *HostsController) sendMetric(host config.Host, client *Client) {
103103
log.Error(errorContent)
104104
hosts.resetDriver(host)
105105
message := &SendMessage{
106-
Message: errorContent,
107-
Error: true,
106+
Message: ErrorMessage{
107+
Error: errorContent,
108+
Host: host.Address,
109+
Name: metric,
110+
},
111+
Error: true,
108112
}
109113
client.Send <- message
110114
}

client/messages.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ type SendMessage struct {
55
Message interface{}
66
}
77

8+
type ErrorMessage struct {
9+
Host string
10+
Error string
11+
Name string
12+
}
13+
814
type Message struct {
915
Host string
1016
Name string

inspector/disk.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,15 +222,15 @@ func NewDF(driver *driver.Driver, _ ...string) (Inspector, error) {
222222
// always reported in posix standard of 1K-blocks
223223
Command: `df -a -k`,
224224
RawByteSize: `KB`,
225-
DisplayByteSize: `GB`,
225+
DisplayByteSize: `MB`,
226226
}
227227
} else {
228228
df = &DFWin{
229229
// Using format to account for weird spacing
230230
// issues that arise on windows
231231
Command: `wmic logicaldisk list brief /format:csv`,
232232
RawByteSize: `B`,
233-
DisplayByteSize: `GB`,
233+
DisplayByteSize: `MB`,
234234
}
235235
}
236236
df.SetDriver(driver)

inspector/docker_stats.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ func NewDockerStats(driver *driver.Driver, _ ...string) (Inspector, error) {
126126
return nil, errors.New("Cannot use LoadAvgDarwin on drivers outside (linux, darwin, windows)")
127127
}
128128
dockerstats = &DockerStats{
129-
Command: `docker stats --no-stream`,
129+
Command: `docker stats --no-stream`,
130+
DisplayByteSize: `MB`,
130131
}
131132
dockerstats.SetDriver(driver)
132133
return dockerstats, nil

0 commit comments

Comments
 (0)