help with executing remote command

nagios at mm.quex.org nagios at mm.quex.org
Thu Apr 28 04:44:23 CEST 2005


On Wed, Apr 27, 2005 at 08:35:55PM -0500, Leonardo Mur?a Jim?nez wrote:
> 
> I'm  try to excute a check_disk in remote host via ssh, in command
> line works fine but in the webnagios say "check_by_ssh: Port must be a
> positive integer - / -p ", does anyone can help me o send me an
> example.
> 
>  checkcommands.cfg  
> 
> # 'check_remote_disk' command definition
> define command{
>     command_name    check_remote_disk
>     command_line    $USER1$check_by_ssh -H $HOSTADDRESS$ -C '/usr/local/bin/check_disk -p $ARG1$'
>  "services.cfg"
> 
> define service{
>         host_name               nfsserver
>         service_description     DISK Remote
>         check_command           check_remote_disk! -H 10.0.2.10 -C '/usr/local/bin/check_disk -p /'

You only need to provide the path to check here. Everything after
the first ! and before the second ! (if there is one) is passed to
the check command as $ARG1$. This means your command is expanding
to something like:

check_by_ssh -H 1.2.3.4 -C '/u/l/b/check_disk -p  -H 10.0.2.10 -C '...

Obviously that's going to confuse check_disk. It should look like
this:

  host_name            nfsserver
  service_description  DISK Remote
  check_command        check_remote_disk!/

This will then run "check_disk -p /" on the remote host, which
should do what you want.


-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
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