| 1234567891011121314151617181920212223242526272829303132 |
- package containers
- import (
- "fmt"
- . "github.com/coroot/coroot-node-agent/utils/modelse"
- "runtime"
- )
- func (r *Registry) RegisterHost() error {
- // 注册
- nodeInfo := r.nodeInfo.GetNodeInfo()
- if nodeInfo == nil {
- return fmt.Errorf("could not find node info")
- }
- req := RegisterHostReq{
- LicenseKey: nodeInfo.LicenseKey,
- HostId: nodeInfo.HostID,
- HostIp: nodeInfo.HostIp,
- HostName: "smartagent",
- HostNameAlias: nodeInfo.Hostname,
- HostType: 1,
- Version: "0.0.1",
- SysVersion: runtime.GOOS + " " + runtime.GOARCH,
- SystemUuid: nodeInfo.SystemUUID,
- Ebpf: true,
- }
- err := r.connServer.RegisterHost(req)
- if err != nil {
- return err
- }
- return nil
- }
|