check_by_ssh little help
Rainer Duffner
rainer at ultra-secure.de
Tue Nov 2 13:46:38 CET 2004
Jason Williams wrote:
>Hello everyone.
>
>Been trying to get check_by_ssh working here this morning. I feel like I am
>close, but missing something.
>
>I setup passwordless SSH, using keys. Tested it with my account and it
>works. (Going to use my login as a test, jwilliams)
>
>Anyway, if I navigate to the plugin directory and execute the following
>command:
>
>./check_by_ssh -H 192.168.1.199 -C uptime
>
>I get the result printed back to me, which is great (BTW, the above command
>is executed by my login name).
>
>But the problem I think is when I am setting up the checkcommands portion.
>I think I am making it more difficult than it is and may be going in
>circles. :(
>
>Here is what I have setup (Checking the load average BTW)
>
>First, I have this:
>
># 'check_local_load' command definition
>define command{
> command_name check_load_avg
> command_line $USER1$/check_by_ssh -H $HOSTADDRESS$ -C
>"$USER1$/check_load -w $ARG1$ -c $ARG2$"
> }
>
>
>Then, I have this:
>
># check_by_ssh
>define command{
> command_name check_by_ssh
> command_line $USER1$/check_by_ssh -H $HOSTADDRESS -C uptime -l
>jwilliams
> }
>
>
>I think I may be doing something backwards here, or something is missing,
>as I cannot get it to bring back the info I am requesting.
>
>I thought i'd ask here for a little bit of help maybe clear up what I am
>doing incorrectly.
>
>I appreciate the help.
>
>
Nagios runs commands as user "nagios". So you must be able to ssh from
one server to the other as user nagios (and preferrably login to the
remote host as user nagios).
The nagios-user needs a valid shell and homedirectory to be able to do that.
To try it out, give the nagios-user a password, a home-dir and a shell
and try it manually.
Then generate and copy ssh-keys and set the password to "*" in the
shadow-file (or vipw, if you use FreeBSD or some other means of "locking
out" the account) if ssh-keys start working.
Rainer
--
===================================================
~ Rainer Duffner - rainer at ultra-secure.de ~
~ Freising - Munich - Germany ~
~ Unix - Linux - BSD - OpenSource - Security ~
~ http://www.ultra-secure.de/~rainer/pubkey.pgp ~
===================================================
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list