bin/check-snmp-disk.rb in sensu-plugins-snmp-1.1.0 vs bin/check-snmp-disk.rb in sensu-plugins-snmp-2.0.0
- old
+ new
@@ -40,10 +40,15 @@
option :host,
short: '-h host',
default: '127.0.0.1',
description: 'SNMP hostname'
+ option :port,
+ short: '-P port',
+ long: '--port PORT',
+ default: '161'
+
option :community,
short: '-C snmp community',
default: 'public',
description: 'SNMP community'
@@ -94,9 +99,10 @@
dev_desc_oid = base_oid + '.3'
dev_size_oid = base_oid + '.5'
dev_used_oid = base_oid + '.6'
begin
manager = SNMP::Manager.new(host: config[:host].to_s,
+ port: config[:port].to_i,
community: config[:community].to_s,
version: config[:snmp_version].to_sym,
timeout: config[:timeout].to_i)
response = manager.get_bulk(0, 200, [dev_desc_oid])
dev_indexes = []