diff --git a/collectors/beegfsmetaMetric.go b/collectors/beegfsmetaMetric.go index 2b86ee9..530e322 100644 --- a/collectors/beegfsmetaMetric.go +++ b/collectors/beegfsmetaMetric.go @@ -4,6 +4,7 @@ import ( "bufio" "bytes" "encoding/json" + "errors" "fmt" "io/ioutil" "os" @@ -18,8 +19,6 @@ import ( lp "github.com/ClusterCockpit/cc-metric-collector/internal/ccMetric" ) -const BEEGFS_CMD = "beegfs-ctl" - // Struct for the collector-specific JSON config type BeegfsMetaCollectorConfig struct { Beegfs string `json:"beegfs_path"` @@ -132,9 +131,7 @@ func (m *BeegfsMetaCollector) Read(interval time.Duration, output chan lp.CCMetr } if len(mountpoints) == 0 { - cclog.ComponentError( - m.name, - "Read(): Failed to find BeeGFS on Demand FS.") + return errors.New("Could not find any BeeGFS mountpoint") } for _, mountpoint := range mountpoints { diff --git a/collectors/beegfsstorageMetric.go b/collectors/beegfsstorageMetric.go index a0e4ec4..4439a98 100644 --- a/collectors/beegfsstorageMetric.go +++ b/collectors/beegfsstorageMetric.go @@ -4,6 +4,7 @@ import ( "bufio" "bytes" "encoding/json" + "errors" "fmt" "io/ioutil" "os" @@ -124,9 +125,7 @@ func (m *BeegfsStorageCollector) Read(interval time.Duration, output chan lp.CCM } } if len(mountpoints) == 0 { - cclog.ComponentError( - m.name, - "Read(): Failed to find BeeGFS on Demand FS.") + return errors.New("Could not find any BeeGFS mountpoint") } // collects stats for each BeeGFS on Demand FS for _, mountpoint := range mountpoints {