adjust message and variable with snmp-mqtt
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
c05cf671cf
commit
64dba890dd
@ -12,14 +12,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type variable_t struct {
|
type variable_t struct {
|
||||||
Name string `json:"variable"`
|
Label string `json:"label"`
|
||||||
|
Variable string `json:"variable"`
|
||||||
Value float64 `json:"value"`
|
Value float64 `json:"value"`
|
||||||
Unit string `json:"unit"`
|
Unit string `json:"unit"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type message_t struct {
|
type message_t struct {
|
||||||
Server string `json:"server"`
|
Device string `json:"device"`
|
||||||
Label string `json:"label"`
|
Label string `json:"label"`
|
||||||
Variables map[string]variable_t `json:"variables"`
|
Variables map[string]variable_t `json:"variables"`
|
||||||
}
|
}
|
||||||
@ -32,7 +33,7 @@ func Start() {
|
|||||||
log.Println("Polling server " + server.Name)
|
log.Println("Polling server " + server.Name)
|
||||||
|
|
||||||
message := message_t {
|
message := message_t {
|
||||||
Server: server.Name,
|
Device: server.Name,
|
||||||
Label: server.Label,
|
Label: server.Label,
|
||||||
Variables: make(map[string]variable_t),
|
Variables: make(map[string]variable_t),
|
||||||
}
|
}
|
||||||
@ -48,7 +49,8 @@ func Start() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
v := variable_t {
|
v := variable_t {
|
||||||
Name: label,
|
Label: label,
|
||||||
|
Variable: "",
|
||||||
Value: value,
|
Value: value,
|
||||||
Unit: "ms",
|
Unit: "ms",
|
||||||
Status: status,
|
Status: status,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user