Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def perform(sensor_params)
- @hostname = "10.0.10.100"
- @username = "root"
- @password = "root
- @cmd = "id"
- begin
- ssh = Net::SSH.start(@hostname, @username, :password => @password)
- res = ssh.exec!(@cmd)
- ssh.close
- puts res
- rescue
- puts "Unable to connect to #{@hostname} using #{@username}/#{@password}"
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement