check_by_ssh with password

I know, I know…bad! bad! BAD!

Sometime though, you just can’t do things the proper method.  In my case, the reasons I am using the improper method are:

  1. Only running one check on server(check_zpool) so installing NRPE seems a bit overkill
  2. Getting NRPE to run on Freenas takes a bit of magic.  There is the potential to cause issues as well.
  3. It is only on my personal network 🙂
  4. Can’t setup the ssh keys on freenas, so have to use password.
  •  Create a script(Example here: check_freenas)

#!/bin/sh

sshpass -p $1 ssh $2@$4 $3

  • Command definition

$USER1$/check_freenas $ARG1$ $ARG2$ $ARG3$ $HOSTADDRESS$

  • ARG1=Password, ARG2=User, ARG3=command to run
  • Make sure sshpass is installed on the Nagios server.