Skip to content

Commit

Permalink
fix ekinops
Browse files Browse the repository at this point in the history
  • Loading branch information
babos77 committed May 14, 2021
1 parent 73d2ac4 commit 36b91e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/communicator/ekinops.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@ type ekinopsCommunicator struct {

// GetInterfaces returns the interfaces of ekinops devices.
func (c *ekinopsCommunicator) GetInterfaces(ctx context.Context) ([]device.Interface, error) {
interfaces, err := c.GetIfTable(ctx)
if err != nil {
return nil, err
}

con, ok := network.DeviceConnectionFromContext(ctx)
if !ok || con.SNMP == nil {
return nil, errors.New("no device connection available")
}

con.SNMP.SnmpClient.UseCache(false)

interfaces, err := c.GetIfTable(ctx)
if err != nil {
return nil, err
}

//get used slots
slotResults, err := con.SNMP.SnmpClient.SNMPWalk(ctx, ".1.3.6.1.4.1.20044.7.8.1.1.2")
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions core/network/snmp_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ func (s *SNMPClient) SNMPGet(ctx context.Context, oid ...string) ([]SNMPResponse
m[a] = res
}
}
} else {
reqOIDs = oid
}

var response *gosnmp.SnmpPacket
Expand Down

0 comments on commit 36b91e4

Please sign in to comment.