kkirsche/net-netconf

View on GitHub
examples/jnpr/get-inventory.rb

Summary

Maintainability
A
15 mins
Test Coverage
require 'net/netconf'

puts "NETCONF v#{Netconf::VERSION}"

login = { :target => 'vsrx', :username => "jeremy", :password => "jeremy1" }

Netconf::SSH.new( login ){ |dev|  
    
  inv = dev.rpc.get_chassis_inventory  

  puts "Chassis: " + inv.xpath('chassis/description').text
  puts "Chassis Serial-Number: " + inv.xpath('chassis/serial-number').text      
}