Getting output from SSH commands in Ruby

I usually do SSH in to servers to check if things are okay with raid and shit.

But now I’m going hardcore, with Ruby.

First add NOPASSWD to sudoers to get what commands you want working without password in sudo, with “sudo visudo”

You can probably skip passwords with ssh-copy-id.

This code SSH’s into the server, runs the command, get the ouput, formats it into markdown and writes it to a file, then copies everything to your clipboard so you can paste it into anything you want (say like trello?)

 

Leave a Reply

Your email address will not be published.