[release] v0.12.0-unstable6

This commit is contained in:
Yann Stepienik 2023-10-28 15:05:12 +01:00
parent 33590ce369
commit 5e26d6ad90
3 changed files with 8 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{
"name": "cosmos-server",
"version": "0.12.0-unstable5",
"version": "0.12.0-unstable6",
"description": "",
"main": "test-server.js",
"bugs": {

View file

@ -166,6 +166,8 @@ func Run() {
utils.Error("Metrics - Cannot start monitoring the server if you don't mount /mnt/host to /. Check the documentation for more information.", nil)
return
} else {
utils.Log("Metrics - Monitoring the server at /mnt/host")
os.Setenv("HOST_PROC", "/mnt/host/proc")
os.Setenv("HOST_SYS", "/mnt/host/sys")
os.Setenv("HOST_ETC", "/mnt/host/etc")

View file

@ -53,6 +53,11 @@ func GetSystemMetrics() {
// Get Network Usage
netIO, err := net.IOCounters(false)
netIOTest, _ := net.IOCounters(true)
for _, v := range netIOTest {
utils.Debug("Metrics - Network", v.Name, v.BytesRecv, v.BytesSent, v.Errin, v.Errout, v.Dropin, v.Dropout)
}
PushSetMetric("system.netRx", int(netIO[0].BytesRecv), DataDef{
Max: 0,