mirror of
				https://github.com/ClusterCockpit/cc-metric-collector.git
				synced 2025-11-04 10:45:06 +01:00 
			
		
		
		
	Skip mount points in DiskstatCollector if statfs() call does not work (bind mounts, ...)
This commit is contained in:
		@@ -3,7 +3,6 @@ package collectors
 | 
			
		||||
import (
 | 
			
		||||
	"bufio"
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"os"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"syscall"
 | 
			
		||||
@@ -81,8 +80,7 @@ func (m *DiskstatCollector) Read(interval time.Duration, output chan lp.CCMetric
 | 
			
		||||
		stat := syscall.Statfs_t{}
 | 
			
		||||
		err := syscall.Statfs(path, &stat)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			fmt.Println(err.Error())
 | 
			
		||||
			return
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
		tags := map[string]string{"type": "node", "device": linefields[0]}
 | 
			
		||||
		total := (stat.Blocks * uint64(stat.Bsize)) / uint64(1000000000)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user