3 Commits
0.0.1 ... 0.0.3

Author SHA1 Message Date
553648e10d value shall be string
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/tag/woodpecker Pipeline failed
2025-02-10 14:18:19 +01:00
64dba890dd adjust message and variable with snmp-mqtt
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2025-02-10 13:54:08 +01:00
c05cf671cf fix, 4
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2025-02-10 13:03:41 +01:00
2 changed files with 9 additions and 10 deletions

View File

@ -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

View File

@ -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,
}