Skip to content

Commit

Permalink
Merge pull request #94 from NETWAYS/fix/timeout-bug
Browse files Browse the repository at this point in the history
Fix timeout bug
  • Loading branch information
martialblog authored Mar 15, 2024
2 parents 7127c1b + a70e445 commit 9bce804
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func main() {
host = fs.StringP("hostname", "H", "localhost", "SNMP host")
community = fs.StringP("community", "c", "public", "SNMP community")
protocol = fs.StringP("protocol", "P", "2c", "SNMP protocol")
port = fs.Uint16P("port", "p", 161, "SNMP port")
file = fs.String("snmpwalk-file", "", "Read output from snmpwalk")
ignoreIlo = fs.BoolP("ignore-ilo-version", "I", false, "Don't check the ILO version")
ipv4 = fs.BoolP("ipv4", "4", false, "Use IPv4")
Expand Down Expand Up @@ -76,8 +77,9 @@ func main() {
} else {
client = gosnmp.NewHandler()
client.SetTarget(*host)
client.SetPort(*port)
client.SetCommunity(*community)
client.SetTimeout(time.Duration(config.Timeout) - 1*time.Second)
client.SetTimeout(time.Duration(config.Timeout) * time.Second)
client.SetRetries(1)

version, err := snmp.VersionFromString(*protocol)
Expand Down

0 comments on commit 9bce804

Please sign in to comment.