Compare commits

..

1 Commits

Author SHA1 Message Date
00524c0a3f label in snmp measurements
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2024-01-26 14:44:23 +01:00
2 changed files with 11 additions and 1 deletions

View File

@ -87,3 +87,11 @@ create or replace view locative_v as
values->'Trigger'->>'value' as direction
from measurements
where application = 'Locative';
create or replace view router_v as
select time,
device,
cast(values->'wan-in'->>'value' as int) as wanInOctetsPerSeconds,
cast(values->'wan-out'->>'value' as int) as wanOutOctetsPerSeconds
from measurements
where application = 'SNMP' and device = '172.16.3.1';

View File

@ -52,7 +52,9 @@ func (self *SnmpHandler) Handle(message handler.MessageT) {
measurement.Application = "SNMP"
measurement.Device = observation.Device
measurement.Attributes = make(map[string]interface{})
measurement.Attributes = map[string]interface{} {
"Label": observation.Label,
}
measurement.Values = make(map[string]database.VariableType)
for k, v := range observation.Variables {