Skip to content
Snippets Groups Projects
Unverified Commit 296b62ac authored by Matt Layher's avatar Matt Layher
Browse files

netstat: return nothing when /proc/net/snmp6 not found

parent 0eecaa95
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment