Skip to content

Commit

Permalink
Merge pull request #779 from bosun-monitor/quickfix
Browse files Browse the repository at this point in the history
cmd/scollector: fix issues with c_network_team_windows and NETCLRMemory
  • Loading branch information
maddyblue committed Mar 11, 2015
2 parents f035538 + 3b1d0e0 commit d028444
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cmd/scollector/collectors/network_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,25 @@ import (
func init() {
collectors = append(collectors, &IntervalCollector{F: c_network_windows, init: winNetworkInit})

c := &IntervalCollector{
c_winnetteam := &IntervalCollector{
F: c_network_team_windows,
}
// Make sure MSFT_NetImPlatAdapter and MSFT_NetAdapterStatisticsSettingData
// are valid WMI classes when initializing c_network_team_windows
c.init = func() {
c_winnetteam.init = func() {
var dstTeamNic []MSFT_NetLbfoTeamNic
var dstStats []MSFT_NetAdapterStatisticsSettingData
queryTeamAdapter = wmi.CreateQuery(&dstTeamNic, "")
queryTeamStats = wmi.CreateQuery(&dstStats, "")
c.Enable = func() bool {
c_winnetteam.Enable = func() bool {
errTeamNic := queryWmiNamespace(queryTeamAdapter, &dstTeamNic, namespaceStandardCimv2)
errStats := queryWmiNamespace(queryTeamStats, &dstStats, namespaceStandardCimv2)
return errTeamNic == nil && errStats == nil
result := errTeamNic == nil && errStats == nil
return result
}
}
collectors = append(collectors, c)
c = &IntervalCollector{
collectors = append(collectors, c_winnetteam)
c := &IntervalCollector{
F: c_network_windows_tcp,
}
c.init = wmiInit(c, func() interface{} { return &[]Win32_PerfRawData_Tcpip_TCPv4{} }, "", &winNetTCPQuery)
Expand Down

0 comments on commit d028444

Please sign in to comment.