bin/check-snmp.rb in sensu-plugins-snmp-1.0.0 vs bin/check-snmp.rb in sensu-plugins-snmp-1.1.0
- old
+ new
@@ -28,10 +28,14 @@
class CheckSNMP < Sensu::Plugin::Check::CLI
option :host,
short: '-h host',
default: '127.0.0.1'
+ option :port,
+ short: '-p port',
+ default: '161'
+
option :community,
short: '-C snmp community',
default: 'public'
option :objectid,
@@ -79,9 +83,10 @@
default: false
def run
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([config[:objectid].to_s])
if config[:debug]