mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2025-04-08 22:45:55 +02:00
changed error type
This commit is contained in:
parent
e08b1bd2bd
commit
40915c16ef
@ -4,6 +4,7 @@ import (
|
|||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
@ -18,8 +19,6 @@ import (
|
|||||||
lp "github.com/ClusterCockpit/cc-metric-collector/internal/ccMetric"
|
lp "github.com/ClusterCockpit/cc-metric-collector/internal/ccMetric"
|
||||||
)
|
)
|
||||||
|
|
||||||
const BEEGFS_CMD = "beegfs-ctl"
|
|
||||||
|
|
||||||
// Struct for the collector-specific JSON config
|
// Struct for the collector-specific JSON config
|
||||||
type BeegfsMetaCollectorConfig struct {
|
type BeegfsMetaCollectorConfig struct {
|
||||||
Beegfs string `json:"beegfs_path"`
|
Beegfs string `json:"beegfs_path"`
|
||||||
@ -132,9 +131,7 @@ func (m *BeegfsMetaCollector) Read(interval time.Duration, output chan lp.CCMetr
|
|||||||
}
|
}
|
||||||
|
|
||||||
if len(mountpoints) == 0 {
|
if len(mountpoints) == 0 {
|
||||||
cclog.ComponentError(
|
return errors.New("Could not find any BeeGFS mountpoint")
|
||||||
m.name,
|
|
||||||
"Read(): Failed to find BeeGFS on Demand FS.")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, mountpoint := range mountpoints {
|
for _, mountpoint := range mountpoints {
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
@ -124,9 +125,7 @@ func (m *BeegfsStorageCollector) Read(interval time.Duration, output chan lp.CCM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(mountpoints) == 0 {
|
if len(mountpoints) == 0 {
|
||||||
cclog.ComponentError(
|
return errors.New("Could not find any BeeGFS mountpoint")
|
||||||
m.name,
|
|
||||||
"Read(): Failed to find BeeGFS on Demand FS.")
|
|
||||||
}
|
}
|
||||||
// collects stats for each BeeGFS on Demand FS
|
// collects stats for each BeeGFS on Demand FS
|
||||||
for _, mountpoint := range mountpoints {
|
for _, mountpoint := range mountpoints {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user