naparuba / check-linux-by-ssh

Shinken checks designed to be run without installing something on the distant linux (aside ssh keys of course!)
MIT License
43 stars 47 forks source link

Add SSH class #54

Open AnatomicJC opened 7 years ago

AnatomicJC commented 7 years ago

As discussed with you by mail, here is a pull request. I added a SSH class who allows you to use native SSH in replacement of python Paramiko module.

It is still a work in progress. For now, all params like user, port, etc. must be managed in ssh config file.

If you can reach a host with "ssh host", you will be able to use any check like this:

python2 check_cpu_stats_by_ssh.py -H host -a ssh

Never forget you have to populate a ~/.ssh/config file with at least SSH multiplexing params: ControlMaster auto ControlPath ~/.ssh/sockets/%r@%h:%p ControlPersist 600

http://blog.scottlowe.org/2015/12/11/using-ssh-multiplexing/