Method: Recmon::SSHSensor#sense
- Defined in:
- lib/recmon/ssh-sensor.rb
#sense ⇒ Object
Called by Monitor. sense() attempts to log in to the host in batch mode so you MUST set up a private key authentication for this user or this sensor will generate false negatives.
18 19 20 21 22 23 |
# File 'lib/recmon/ssh-sensor.rb', line 18 def sense() `/usr/bin/ssh -p#{@port} -o "BatchMode yes" #{@user}@#{@name} pwd` up = $?.exitstatus == 0 status = up ? "up" : "down" return("SSH at host=#{@name} for user=#{@user} status=#{status}") end |