Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.48 KB | None | 0 0
  1. #!/usr/bin/ruby -w
  2.  
  3. require 'net-snmp'
  4.  
  5. Net::SNMP::Session.open(:peername => 'example.com',
  6.                         :version => '3',
  7.                         :security_level => Net::SNMP::Constants::SNMP_SEC_LEVEL_AUTHPRIV,
  8.                         :auth_protocol => :md5,
  9.                         :priv_protocol => :des,
  10.                         :username => 'user',
  11.                         :password => 'xxxxxx') do |sess|
  12.   pdu = sess.get('.1.3.6.1.4.1.2021.4.5.0')
  13.   pdu.print
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement