Skip to content

Commit b357d22

Browse files
author
HD Moore
committed
Fix stack trace/error handling in AIX snmp version
1 parent d95220d commit b357d22

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/auxiliary/scanner/snmp/aix_version.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ def run_host(ip)
6969

7070
print_status(status)
7171
end
72-
7372
disconnect_snmp
74-
73+
rescue SNMP::RequestTimeout, Rex::ConnectionError, ::Errno::ECONNREFUSED
7574
rescue Exception => e
76-
print_error("#{e.class}, #{e.message}")
77-
75+
print_error("#{ip} #{e.class}, #{e.message}")
76+
ensure
77+
disconnect_snmp
7878
end
7979

8080
end

0 commit comments

Comments
 (0)