bosun.org@v0.0.0-20210513094433-e25bc3e69a1f/cmd/scollector/conf/conf_windows.go (about)

     1  package conf
     2  
     3  import (
     4  	"bosun.org/slog"
     5  	"github.com/StackExchange/wmi"
     6  )
     7  
     8  type ProcessParams struct {
     9  	Name string
    10  }
    11  
    12  type ServiceParams struct {
    13  	Name      string
    14  	WatchProc bool
    15  }
    16  
    17  func (c *Conf) InitializeSWbemServices() {
    18  	slog.Infof("Initializing SWbemServices")
    19  	s, err := wmi.InitializeSWbemServices(wmi.DefaultClient)
    20  	if err != nil {
    21  		slog.Fatal(err)
    22  	}
    23  	wmi.DefaultClient.SWbemServicesClient = s
    24  }