File tree Expand file tree Collapse file tree 5 files changed +8
-8
lines changed Expand file tree Collapse file tree 5 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -78,8 +78,6 @@ func init() {
78
78
Msg ("Can't bind flag ratelimit" )
79
79
return
80
80
}
81
-
82
- setDeviceDefaults ()
83
81
}
84
82
85
83
var apiCMD = & cobra.Command {
@@ -94,6 +92,8 @@ var apiCMD = &cobra.Command{
94
92
return err
95
93
}
96
94
95
+ setDeviceDefaults ()
96
+
97
97
if ! (viper .GetString ("api.format" ) == "json" || viper .GetString ("format" ) == "xml" ) {
98
98
return errors .New ("invalid api format set" )
99
99
}
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ func (c *ceraosIP10Communicator) GetInterfaces(ctx context.Context) ([]device.In
27
27
}
28
28
29
29
for i , inter := range subInterfaces {
30
- if regex .MatchString (* inter .IfDescr ) {
30
+ if inter . IfDescr != nil && regex .MatchString (* inter .IfDescr ) {
31
31
targetInterface = inter
32
32
copy (subInterfaces [i :], subInterfaces [i + 1 :])
33
33
subInterfaces = subInterfaces [:len (subInterfaces )- 1 ]
@@ -41,7 +41,7 @@ func (c *ceraosIP10Communicator) GetInterfaces(ctx context.Context) ([]device.In
41
41
}
42
42
43
43
for i := range subInterfaces {
44
- if regex .MatchString (* subInterfaces [i ].IfDescr ) {
44
+ if subInterfaces [ i ]. IfDescr != nil && regex .MatchString (* subInterfaces [i ].IfDescr ) {
45
45
subInterfaces [i ].IfOperStatus = targetInterface .IfOperStatus
46
46
subInterfaces [i ].IfInOctets = targetInterface .IfInOctets
47
47
subInterfaces [i ].IfOutOctets = targetInterface .IfOutOctets
Original file line number Diff line number Diff line change 28
28
package doc
29
29
30
30
// Version specifies the current version.
31
- const Version = "v0.3.2 "
31
+ const Version = "v0.3.3 "
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ require (
9
9
github.com/gomodule/redigo v1.8.4
10
10
github.com/google/go-cmp v0.5.4
11
11
github.com/gosnmp/gosnmp v1.30.0
12
- github.com/inexio/go-monitoringplugin v1.0.6
12
+ github.com/inexio/go-monitoringplugin v1.0.7
13
13
github.com/jmoiron/sqlx v1.2.0
14
14
github.com/labstack/echo/v4 v4.2.1
15
15
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db
Original file line number Diff line number Diff line change @@ -139,8 +139,8 @@ github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/J
139
139
github.com/hpcloud/tail v1.0.0 /go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU =
140
140
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM =
141
141
github.com/inconshreveable/mousetrap v1.0.0 /go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8 =
142
- github.com/inexio/go-monitoringplugin v1.0.6 h1:tnxWon7lMtbDjWf2LdvUiMcaJ8DnnJ8CqeF462qJ5bg =
143
- github.com/inexio/go-monitoringplugin v1.0.6 /go.mod h1:kzHRJGZ2iE/0IElB4NYI38h3h0HM5wqTTH7KyUCjkM8 =
142
+ github.com/inexio/go-monitoringplugin v1.0.7 h1:Aj47aNEykRJkaH/zEVOxFRF7/ekGDjyy7JofFi9SvK4 =
143
+ github.com/inexio/go-monitoringplugin v1.0.7 /go.mod h1:kzHRJGZ2iE/0IElB4NYI38h3h0HM5wqTTH7KyUCjkM8 =
144
144
github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA =
145
145
github.com/jmoiron/sqlx v1.2.0 /go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks =
146
146
github.com/jonboulle/clockwork v0.1.0 /go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo =
You can’t perform that action at this time.
0 commit comments