mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-11-23 20:36:21 +01:00
netstat: return nothing when /proc/net/snmp6 not found
This commit is contained in:
parent
0eecaa9547
commit
296b62acb7
@ -121,6 +121,12 @@ func parseNetStats(r io.Reader, fileName string) (map[string]map[string]string,
|
||||
func getSNMP6Stats(fileName string) (map[string]map[string]string, error) {
|
||||
file, err := os.Open(fileName)
|
||||
if err != nil {
|
||||
// On systems with IPv6 disabled, this file won't exist.
|
||||
// Do nothing.
|
||||
if os.IsNotExist(err) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return nil, err
|
||||
}
|
||||
defer file.Close()
|
||||
|
Loading…
Reference in New Issue
Block a user