github.com/Rookout/GoSDK@v0.1.48/pkg/information/system.go (about)

     1  package information
     2  
     3  import (
     4  	pb "github.com/Rookout/GoSDK/pkg/protobuf"
     5  	"github.com/go-errors/errors"
     6  	"os"
     7  	"runtime"
     8  )
     9  
    10  func collectSystem(information *AgentInformation) error {
    11  	hostname, err := os.Hostname()
    12  	if err != nil {
    13  		return errors.New(err)
    14  	}
    15  
    16  	information.System = &pb.SystemInformation{
    17  		Hostname: hostname,
    18  		Os:       runtime.GOOS,
    19  		Arch:     runtime.GOARCH,
    20  	}
    21  
    22  	return nil
    23  
    24  }