Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
00524c0a3f
|
|||
3af9482880
|
@ -87,3 +87,11 @@ create or replace view locative_v as
|
|||||||
values->'Trigger'->>'value' as direction
|
values->'Trigger'->>'value' as direction
|
||||||
from measurements
|
from measurements
|
||||||
where application = 'Locative';
|
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';
|
||||||
|
@ -52,11 +52,12 @@ func (self *SnmpHandler) Handle(message handler.MessageT) {
|
|||||||
measurement.Application = "SNMP"
|
measurement.Application = "SNMP"
|
||||||
measurement.Device = observation.Device
|
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)
|
measurement.Values = make(map[string]database.VariableType)
|
||||||
for k, v := range observation.Variables {
|
for k, v := range observation.Variables {
|
||||||
var vv string
|
|
||||||
measurement.Values[k] = database.VariableType {
|
measurement.Values[k] = database.VariableType {
|
||||||
Label: v.Label,
|
Label: v.Label,
|
||||||
Variable: v.Variable,
|
Variable: v.Variable,
|
||||||
|
Reference in New Issue
Block a user