skip diff value
This commit is contained in:
parent
11e63155bc
commit
4222e19573
@ -114,15 +114,15 @@ func Start() {
|
||||
convertedValue = fmt.Sprintf("%d", gosnmp.ToBigInt(variable.Value))
|
||||
}
|
||||
|
||||
diffValue := "-"
|
||||
if oidTopic.Diff == "true" {
|
||||
log.Println("Calculate difference to last value")
|
||||
key := endpoint.Endpoint + ":" + oidTopic.OID
|
||||
diff, err := calculateDifference(key, convertedValue)
|
||||
if err != nil {
|
||||
log.Printf("Error when building difference: %v", err)
|
||||
convertedValue = "-1"
|
||||
} else {
|
||||
diffValue = diff
|
||||
convertedValue = diff
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,7 +131,6 @@ func Start() {
|
||||
Label: oidTopic.Label,
|
||||
Variable: oidTopic.OID,
|
||||
Value: convertedValue,
|
||||
DiffValue: diffValue,
|
||||
}
|
||||
message.Variables[oidTopic.Label] = v
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user