Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
553648e10d | |||
64dba890dd | |||
c05cf671cf |
@ -67,10 +67,6 @@ steps:
|
||||
environment:
|
||||
KUBE_CONFIG_CONTENT:
|
||||
from_secret: kube_config
|
||||
ENCRYPTION_KEY:
|
||||
from_secret: encryption_key
|
||||
MD5_CHECKSUM:
|
||||
from_secret: secrets_checksum
|
||||
commands:
|
||||
- export IMAGE_TAG=$CI_COMMIT_TAG
|
||||
- printf "$KUBE_CONFIG_CONTENT" > /tmp/kubeconfig
|
||||
|
@ -3,6 +3,7 @@ package tsmq
|
||||
import (
|
||||
"log"
|
||||
"time"
|
||||
"strconv"
|
||||
"encoding/json"
|
||||
|
||||
"tsm/config"
|
||||
@ -12,14 +13,15 @@ import (
|
||||
)
|
||||
|
||||
type variable_t struct {
|
||||
Name string `json:"variable"`
|
||||
Value float64 `json:"value"`
|
||||
Label string `json:"label"`
|
||||
Variable string `json:"variable"`
|
||||
Value string `json:"value"`
|
||||
Unit string `json:"unit"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
|
||||
type message_t struct {
|
||||
Server string `json:"server"`
|
||||
Device string `json:"device"`
|
||||
Label string `json:"label"`
|
||||
Variables map[string]variable_t `json:"variables"`
|
||||
}
|
||||
@ -32,7 +34,7 @@ func Start() {
|
||||
log.Println("Polling server " + server.Name)
|
||||
|
||||
message := message_t {
|
||||
Server: server.Name,
|
||||
Device: server.Name,
|
||||
Label: server.Label,
|
||||
Variables: make(map[string]variable_t),
|
||||
}
|
||||
@ -48,8 +50,9 @@ func Start() {
|
||||
}
|
||||
|
||||
v := variable_t {
|
||||
Name: label,
|
||||
Value: value,
|
||||
Label: label,
|
||||
Variable: "",
|
||||
Value: strconv.FormatFloat(value, 'f', 4, 64)
|
||||
Unit: "ms",
|
||||
Status: status,
|
||||
}
|
||||
|
Reference in New Issue
Block a user