Skip to content

Commit

Permalink
Merge pull request #58 from inexio/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
TheFireMike authored Jul 7, 2021
2 parents b03ced6 + 6be29b7 commit 133bfc8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cmd/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ func init() {
Msg("Can't bind flag ratelimit")
return
}

setDeviceDefaults()
}

var apiCMD = &cobra.Command{
Expand All @@ -94,6 +92,8 @@ var apiCMD = &cobra.Command{
return err
}

setDeviceDefaults()

if !(viper.GetString("api.format") == "json" || viper.GetString("format") == "xml") {
return errors.New("invalid api format set")
}
Expand Down
4 changes: 2 additions & 2 deletions config/codecommunicator/ceraos-ip10.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func (c *ceraosIP10Communicator) GetInterfaces(ctx context.Context) ([]device.In
}

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

for i := range subInterfaces {
if regex.MatchString(*subInterfaces[i].IfDescr) {
if subInterfaces[i].IfDescr != nil && regex.MatchString(*subInterfaces[i].IfDescr) {
subInterfaces[i].IfOperStatus = targetInterface.IfOperStatus
subInterfaces[i].IfInOctets = targetInterface.IfInOctets
subInterfaces[i].IfOutOctets = targetInterface.IfOutOctets
Expand Down
2 changes: 1 addition & 1 deletion doc/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
package doc

// Version specifies the current version.
const Version = "v0.3.2"
const Version = "v0.3.3"
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/gomodule/redigo v1.8.4
github.com/google/go-cmp v0.5.4
github.com/gosnmp/gosnmp v1.30.0
github.com/inexio/go-monitoringplugin v1.0.6
github.com/inexio/go-monitoringplugin v1.0.7
github.com/jmoiron/sqlx v1.2.0
github.com/labstack/echo/v4 v4.2.1
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/J
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inexio/go-monitoringplugin v1.0.6 h1:tnxWon7lMtbDjWf2LdvUiMcaJ8DnnJ8CqeF462qJ5bg=
github.com/inexio/go-monitoringplugin v1.0.6/go.mod h1:kzHRJGZ2iE/0IElB4NYI38h3h0HM5wqTTH7KyUCjkM8=
github.com/inexio/go-monitoringplugin v1.0.7 h1:Aj47aNEykRJkaH/zEVOxFRF7/ekGDjyy7JofFi9SvK4=
github.com/inexio/go-monitoringplugin v1.0.7/go.mod h1:kzHRJGZ2iE/0IElB4NYI38h3h0HM5wqTTH7KyUCjkM8=
github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA=
github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
Expand Down

0 comments on commit 133bfc8

Please sign in to comment.