aristanetworks / goarista

Fairly general building blocks used in Arista Go code and open-sourced for the benefit of all.
Apache License 2.0
206 stars 66 forks source link

cmd/octsdb not json.Number #45

Closed Jochem22 closed 4 years ago

Jochem22 commented 5 years ago

I am getting allot of "not json.Number" errors when running octsdb with -text output.

Go version:

go version go1.12.9 linux/amd64

I am running the latest octsdb:

/root/.gvm/pkgsets/go1.12.9/global/bin/octsdb

Command:

$GOPATH/bin/octsdb -addr leaf-sw5.test:6042 -config /root/user/terminattr/test.json -text

Config test.json:

{ "comment": "Arista Terminattr Config", "subscriptions": [ "/Sysdb/hardware/archer/xcvr/status/all" ], "metricPrefix": "eos.test", "metrics": { "rxpowerlane1": {"path": "/Sysdb/hardware/archer/xcvr/status/all/(?P<intf>.+)/domRegisterData/(lane1OpticalRxPower)"}, "txpowerlane1": {"path": "/Sysdb/hardware/archer/xcvr/status/all/(?P<intf>.+)/domRegisterData/(lane1TxPower)"} } }

Output:

I0820 11:31:56.850122 30273 main.go:211] Element 0: 111.111.1.11 is string, not json.Number I0820 11:31:56.850184 30273 main.go:211] Element 0: 222.222.2.22 is string, not json.Number I0820 11:31:56.852689 30273 main.go:211] Element 0: map[hop::: intfId:Ethernet50/1 mplsLabel:map[value:1048576] weight:1] is map[string]interface {}, not json.Number I0820 11:31:56.852723 30273 main.go:211] Element 0: map[hop::: intfId:Ethernet50/1 mplsLabel:map[value:1048576] weight:1] is map[string]interface {}, not json.Number I0820 11:31:56.852744 30273 main.go:211] Element 0: map[hop::: intfId:Vlan4094 mplsLabel:map[value:1048576] weight:1] is map[string]interface {}, not json.Number I0820 11:31:56.852772 30273 main.go:211] Element 0: map[hop::: intfId:Ethernet49/1 mplsLabel:map[value:1048576] weight:1] is map[string]interface {}, not json.Number I0820 11:31:56.852794 30273 main.go:211] Element 0: map[hop::: intfId:Vlan4094 mplsLabel:map[value:1048576] weight:1] is map[string]interface {}, not json.Number I0820 11:31:56.852817 30273 main.go:211] Element 0: map[hop::: intfId:Loopback0 mplsLabel:map[value:1048576] weight:1] is map[string]interface {}, not json.Number I0820 11:31:56.852841 30273 main.go:211] Element 0: map[hop::: intfId:Ethernet49/1 mplsLabel:map[value:1048576] weight:1] is map[string]interface {}, not json.Number I0820 11:31:56.852866 30273 main.go:211] Element 0: map[hop::: intfId:Loopback1 mplsLabel:map[value:1048576] weight:1] is map[string]interface {}, not json.Number

Arista software version:

4.20.3F-INT

TerminAttr version:

v1.4.1 go1.10.3

Jochem22 commented 4 years ago

look like https://github.com/aristanetworks/goarista/commit/19402535e24e553bb75179c271db4c8976e781df fixed this

aaronbee commented 4 years ago

Sorry, we missed this issue earlier. Thanks for keeping track.