diff --git a/collector/gmond.go b/collector/gmond.go index be7c82b3..8279c343 100644 --- a/collector/gmond.go +++ b/collector/gmond.go @@ -60,7 +60,7 @@ func (c *gmondCollector) Update(ch chan<- prometheus.Metric) (err error) { conn, err := net.Dial(gangliaProto, gangliaAddress) log.Debugf("gmondCollector Update") if err != nil { - return fmt.Errorf("Can't connect to gmond: %s", err) + return fmt.Errorf("can't connect to gmond: %s", err) } conn.SetDeadline(time.Now().Add(gangliaTimeout)) @@ -70,7 +70,7 @@ func (c *gmondCollector) Update(ch chan<- prometheus.Metric) (err error) { err = decoder.Decode(&ganglia) if err != nil { - return fmt.Errorf("Couldn't parse xml: %s", err) + return fmt.Errorf("couldn't parse xml: %s", err) } for _, cluster := range ganglia.Clusters { diff --git a/collector/helper.go b/collector/helper.go index 9a986702..64205de3 100644 --- a/collector/helper.go +++ b/collector/helper.go @@ -23,7 +23,7 @@ func splitToInts(str string, sep string) (ints []int, err error) { for _, part := range strings.Split(str, sep) { i, err := strconv.Atoi(part) if err != nil { - return nil, fmt.Errorf("Could not split '%s' because %s is no int: %s", str, part, err) + return nil, fmt.Errorf("could not split '%s' because %s is no int: %s", str, part, err) } ints = append(ints, i) } diff --git a/collector/interrupts_linux.go b/collector/interrupts_linux.go index 9db4e985..58fc738f 100644 --- a/collector/interrupts_linux.go +++ b/collector/interrupts_linux.go @@ -53,13 +53,13 @@ func NewInterruptsCollector() (Collector, error) { func (c *interruptsCollector) Update(ch chan<- prometheus.Metric) (err error) { interrupts, err := getInterrupts() if err != nil { - return fmt.Errorf("Couldn't get interrupts: %s", err) + return fmt.Errorf("couldn't get interrupts: %s", err) } for name, interrupt := range interrupts { for cpuNo, value := range interrupt.values { fv, err := strconv.ParseFloat(value, 64) if err != nil { - return fmt.Errorf("Invalid value %s in interrupts: %s", value, err) + return fmt.Errorf("invalid value %s in interrupts: %s", value, err) } labels := prometheus.Labels{ "CPU": strconv.Itoa(cpuNo), diff --git a/collector/lastlogin_linux.go b/collector/lastlogin_linux.go index dd38d88e..76ac9955 100644 --- a/collector/lastlogin_linux.go +++ b/collector/lastlogin_linux.go @@ -53,7 +53,7 @@ func NewLastLoginCollector() (Collector, error) { func (c *lastLoginCollector) Update(ch chan<- prometheus.Metric) (err error) { last, err := getLastLoginTime() if err != nil { - return fmt.Errorf("Couldn't get last seen: %s", err) + return fmt.Errorf("couldn't get last seen: %s", err) } log.Debugf("Set node_last_login_time: %f", last) c.metric.Set(last) @@ -92,12 +92,12 @@ func getLastLoginTime() (float64, error) { dateParts, err := splitToInts(lastDate, "-") // 2013-04-16 if err != nil { - return 0, fmt.Errorf("Couldn't parse date in line '%s': %s", fields, err) + return 0, fmt.Errorf("couldn't parse date in line '%s': %s", fields, err) } timeParts, err := splitToInts(lastTime, ":") // 11:33 if err != nil { - return 0, fmt.Errorf("Couldn't parse time in line '%s': %s", fields, err) + return 0, fmt.Errorf("couldn't parse time in line '%s': %s", fields, err) } last_t := time.Date(dateParts[0], time.Month(dateParts[1]), dateParts[2], timeParts[0], timeParts[1], 0, 0, time.UTC) diff --git a/collector/loadavg.go b/collector/loadavg.go index f9a49fcc..93d5d1c9 100644 --- a/collector/loadavg.go +++ b/collector/loadavg.go @@ -50,7 +50,7 @@ func NewLoadavgCollector() (Collector, error) { func (c *loadavgCollector) Update(ch chan<- prometheus.Metric) (err error) { load, err := getLoad1() if err != nil { - return fmt.Errorf("Couldn't get load: %s", err) + return fmt.Errorf("couldn't get load: %s", err) } log.Debugf("Set node_load: %f", load) c.metric.Set(load) diff --git a/collector/loadavg_linux.go b/collector/loadavg_linux.go index 3f9a001c..8f02abe9 100644 --- a/collector/loadavg_linux.go +++ b/collector/loadavg_linux.go @@ -48,7 +48,7 @@ func NewLoadavgCollector() (Collector, error) { func (c *loadavgCollector) Update(ch chan<- prometheus.Metric) (err error) { load, err := getLoad1() if err != nil { - return fmt.Errorf("Couldn't get load: %s", err) + return fmt.Errorf("couldn't get load: %s", err) } log.Debugf("Set node_load: %f", load) c.metric.Set(load) @@ -68,7 +68,7 @@ func parseLoad(data string) (float64, error) { parts := strings.Fields(data) load, err := strconv.ParseFloat(parts[0], 64) if err != nil { - return 0, fmt.Errorf("Could not parse load '%s': %s", parts[0], err) + return 0, fmt.Errorf("could not parse load '%s': %s", parts[0], err) } return load, nil } diff --git a/collector/meminfo_linux.go b/collector/meminfo_linux.go index 66c2d626..17eca941 100644 --- a/collector/meminfo_linux.go +++ b/collector/meminfo_linux.go @@ -51,7 +51,7 @@ func NewMeminfoCollector() (Collector, error) { func (c *meminfoCollector) Update(ch chan<- prometheus.Metric) (err error) { memInfo, err := getMemInfo() if err != nil { - return fmt.Errorf("Couldn't get meminfo: %s", err) + return fmt.Errorf("couldn't get meminfo: %s", err) } log.Debugf("Set node_mem: %#v", memInfo) for k, v := range memInfo { @@ -91,14 +91,14 @@ func parseMemInfo(r io.Reader) (map[string]float64, error) { parts := strings.Fields(string(line)) fv, err := strconv.ParseFloat(parts[1], 64) if err != nil { - return nil, fmt.Errorf("Invalid value in meminfo: %s", err) + return nil, fmt.Errorf("invalid value in meminfo: %s", err) } switch len(parts) { case 2: // no unit case 3: // has unit, we presume kB fv *= 1024 default: - return nil, fmt.Errorf("Invalid line in meminfo: %s", line) + return nil, fmt.Errorf("invalid line in meminfo: %s", line) } key := parts[0][:len(parts[0])-1] // remove trailing : from key // Active(anon) -> Active_anon diff --git a/collector/ntp.go b/collector/ntp.go index 2266fe36..65d523db 100644 --- a/collector/ntp.go +++ b/collector/ntp.go @@ -41,7 +41,7 @@ func init() { // the offset between ntp and the current system time. func NewNtpCollector() (Collector, error) { if *ntpServer == "" { - return nil, fmt.Errorf("No NTP server specifies, see --ntpServer") + return nil, fmt.Errorf("no NTP server specifies, see --ntpServer") } return &ntpCollector{ @@ -56,7 +56,7 @@ func NewNtpCollector() (Collector, error) { func (c *ntpCollector) Update(ch chan<- prometheus.Metric) (err error) { t, err := ntp.Time(*ntpServer) if err != nil { - return fmt.Errorf("Couldn't get ntp drift: %s", err) + return fmt.Errorf("couldn't get ntp drift: %s", err) } drift := t.Sub(time.Now()) log.Debugf("Set ntp_drift_seconds: %f", drift.Seconds())