Skip to content

Commit

Permalink
先判断开关,再输出日志,避免windows上netstat输出无效日志 (#589)
Browse files Browse the repository at this point in the history
Co-authored-by: Allen ZHOU 周毅 <allen.zhou@nio.com>
  • Loading branch information
allenz92 and Allen ZHOU 周毅 committed Aug 7, 2023
1 parent 19d5ed5 commit faf8a99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inputs/netstat/netstat.go
Expand Up @@ -53,11 +53,11 @@ func (s *NetStats) Name() string {
}

func (s *NetStats) gatherSummary(slist *types.SampleList) {
if runtime.GOOS != "linux" {
log.Println("W! netstat_summary is only supported on linux")
if s.DisableSummaryStats {
return
}
if s.DisableSummaryStats {
if runtime.GOOS != "linux" {
log.Println("W! netstat_summary is only supported on linux")
return
}
tags := map[string]string{}
Expand Down

0 comments on commit faf8a99

Please sign in to comment.