Skip to content

Commit

Permalink
fix for macs and ips
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricve committed Feb 14, 2023
1 parent 6f8745d commit c59d511
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions machinery/src/cloud/Cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ func HandleHeartBeat(configuration *models.Configuration, communication *models.
isEnterprise = true
}

// Congert to string
macs, _ := json.Marshal(system.MACs)
ips, _ := json.Marshal(system.IPs)

var object = fmt.Sprintf(`{
"key" : "%s",
"version" : "3.0.0",
Expand All @@ -235,8 +239,8 @@ func HandleHeartBeat(configuration *models.Configuration, communication *models.
"totalMemory" : "%d",
"usedMemory" : "%d",
"freeMemory" : "%d",
"macs" : "%v",
"ips" : "%v",
"macs" : %s,
"ips" : %s,
"board" : "",
"disk1size" : "%s",
"disk3size" : "%s",
Expand All @@ -250,7 +254,7 @@ func HandleHeartBeat(configuration *models.Configuration, communication *models.
"docker" : true,
"kios" : false,
"raspberrypi" : false
}`, config.Key, system.Version, system.CPUId, username, key, name, isEnterprise, system.Hostname, system.Architecture, system.TotalMemory, system.UsedMemory, system.FreeMemory, system.MACs, system.IPs, "0", "0", "0", uptimeString, config.HubSite, onvifEnabled)
}`, config.Key, system.Version, system.CPUId, username, key, name, isEnterprise, system.Hostname, system.Architecture, system.TotalMemory, system.UsedMemory, system.FreeMemory, ips, macs, "0", "0", "0", uptimeString, config.HubSite, onvifEnabled)

var jsonStr = []byte(object)
buffy := bytes.NewBuffer(jsonStr)
Expand Down

0 comments on commit c59d511

Please sign in to comment.