Skip to content

Commit 133bfc8

Browse files
authored
Merge pull request #58 from inexio/dev
Dev
2 parents b03ced6 + 6be29b7 commit 133bfc8

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

cmd/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ func init() {
7878
Msg("Can't bind flag ratelimit")
7979
return
8080
}
81-
82-
setDeviceDefaults()
8381
}
8482

8583
var apiCMD = &cobra.Command{
@@ -94,6 +92,8 @@ var apiCMD = &cobra.Command{
9492
return err
9593
}
9694

95+
setDeviceDefaults()
96+
9797
if !(viper.GetString("api.format") == "json" || viper.GetString("format") == "xml") {
9898
return errors.New("invalid api format set")
9999
}

config/codecommunicator/ceraos-ip10.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (c *ceraosIP10Communicator) GetInterfaces(ctx context.Context) ([]device.In
2727
}
2828

2929
for i, inter := range subInterfaces {
30-
if regex.MatchString(*inter.IfDescr) {
30+
if inter.IfDescr != nil && regex.MatchString(*inter.IfDescr) {
3131
targetInterface = inter
3232
copy(subInterfaces[i:], subInterfaces[i+1:])
3333
subInterfaces = subInterfaces[:len(subInterfaces)-1]
@@ -41,7 +41,7 @@ func (c *ceraosIP10Communicator) GetInterfaces(ctx context.Context) ([]device.In
4141
}
4242

4343
for i := range subInterfaces {
44-
if regex.MatchString(*subInterfaces[i].IfDescr) {
44+
if subInterfaces[i].IfDescr != nil && regex.MatchString(*subInterfaces[i].IfDescr) {
4545
subInterfaces[i].IfOperStatus = targetInterface.IfOperStatus
4646
subInterfaces[i].IfInOctets = targetInterface.IfInOctets
4747
subInterfaces[i].IfOutOctets = targetInterface.IfOutOctets

doc/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
package doc
2929

3030
// Version specifies the current version.
31-
const Version = "v0.3.2"
31+
const Version = "v0.3.3"

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/gomodule/redigo v1.8.4
1010
github.com/google/go-cmp v0.5.4
1111
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
1313
github.com/jmoiron/sqlx v1.2.0
1414
github.com/labstack/echo/v4 v4.2.1
1515
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/J
139139
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
140140
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
141141
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=
144144
github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA=
145145
github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
146146
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=

0 commit comments

Comments
 (0)