|
|
@ -15,6 +15,7 @@ import (
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"os/exec"
|
|
|
|
"os/exec"
|
|
|
|
"strings"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type MetricsCollector struct {
|
|
|
|
type MetricsCollector struct {
|
|
|
@ -90,8 +91,9 @@ func (mc *MetricsCollector) Run() error {
|
|
|
|
//go mc.Collect(&wg, device.WWN, device.DeviceName, device.DeviceType)
|
|
|
|
//go mc.Collect(&wg, device.WWN, device.DeviceName, device.DeviceType)
|
|
|
|
mc.Collect(device.WWN, device.DeviceName, device.DeviceType)
|
|
|
|
mc.Collect(device.WWN, device.DeviceName, device.DeviceType)
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: we may need to sleep for between each call to smartctl -a
|
|
|
|
if mc.config.GetInt("commands.metrics_smartctl_wait") > 0 {
|
|
|
|
//time.Sleep(30 * time.Millisecond)
|
|
|
|
time.Sleep(time.Duration(mc.config.GetInt("commands.metrics_smartctl_wait")) * time.Millisecond)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//mc.logger.Infoln("Main: Waiting for workers to finish")
|
|
|
|
//mc.logger.Infoln("Main: Waiting for workers to finish")
|
|
|
|