check_by_ssh and Nagios communication

Karl DeBisschop karl at debisschop.net
Sat Jan 25 13:01:53 CET 2003


Also, pay attention to the keys. It look from your command line that you
ran the test as the nagios user - the same user that will run the
command. So the server will be a known host, I geuss. But to be sure I'd
put the host key in the /etc/ssh/ssh_know_host file and specify the key
you use explicitly on the command line.

On Wed, 2003-01-22 at 11:58, Dave Viner wrote:
> you also might want to replace the ~ in the command with the actual path.
> i don't know if that is the cause of your problem, but its one more variable
> that could cause problems.
> 
> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net
> [mailto:nagios-users-admin at lists.sourceforge.net]On Behalf Of Carroll,
> Jim P [Contractor]
> Sent: Wednesday, January 22, 2003 7:51 AM
> To: 'VEGH Karoly'
> Cc: nagios-users at lists.sourceforge.net
> Subject: RE: [Nagios-users] check_by_ssh and Nagios communication
> 
> 
> Try making these changes to your command_line in checkcommands.cfg:
> 
>   command_line  $USER1$/check_by_ssh -H $HOSTADDRESS$ -C
> './libexec/check_disk -w 15% -c 5%'
> 
> jc
> 
> 
> > -----Original Message-----
> > From: VEGH Karoly [mailto:karoly.vegh at uta.at]
> > Sent: Wednesday, January 22, 2003 6:04 AM
> > To: Michael Loftis
> > Cc: nagios-users at lists.sourceforge.net
> > Subject: Re: [Nagios-users] check_by_ssh and Nagios communication
> >
> >
> > On Wed, 22 Jan 2003, Michael Loftis wrote:
> >
> > > Error 127 generally means it couldn't execute, check the executable
> > > permissions on the check_by_ssh (needs to be executable by
> > whomever is
> > > doing ssh checks)
> >
> >
> > as i wrote, executed by hand it works fine:
> >
> >
> > newmx4:/var/spool/exim/input# su - nagios
> > nagios at newmx4:~$ /opt/nagios/libexec/check_by_ssh -H newmx4 -C \
> > '~/libexec/check_disk -w 15% -c 5%'
> > DISK OK - [6950540 kB (95%) free on /dev/md0] [17208 kB (78%) free on
> > /dev/md1] [2343592 kB (92%) free on /dev/md2]
> > nagios at newmx4:~$
> >
> >
> > exactly this stands in my checkcommands.cfg:
> >
> >
> > newmx4:/opt/nagios# grep check_by_ssh etc/checkcommands.cfg
> >         command_line
> > command[ssh_disk]=/opt/nagios/libexec/check_by_ssh
> > -H $HOSTADDRESS$ -C '~/libexec/check_disk -w 15% -c 5%'
> > newmx4:/opt/nagios#
> >
> >
> > > check_by_ssh also has the path to ssh hard coded into
> > > it, so check to make sure it's looking for the right SSH
> > executable and
> > > that this is also runnable by the right user,
> >
> > newmx4:/opt/nagios# which ssh
> > /usr/bin/ssh
> > newmx4:/opt/nagios#
> > newmx4:/opt/nagios# strings libexec/check_by_ssh | grep ssh
> > /usr/bin/ssh
> > check_by_ssh
> > -f tells ssh to fork rather than create a tty
> >    tell ssh to use IPv4
> >    tell ssh to use IPv6
> > check_by_ssh [-f46] [-t timeout] [-i identity] [-l user] -H <host> -C
> > <command>
> > check_by_ssh  -V prints version info
> > check_by_ssh  -h prints more detailed help
> > newmx4:/opt/nagios#
> >
> > seems to be OK...
> >
> > newmx4:/opt/nagios# ls -la /usr/bin/ssh
> > -rwxr-xr-x    1 root     root       230248 Jun 28  2002 /usr/bin/ssh
> > newmx4:/opt/nagios# su - nagios
> > nagios at newmx4:~$ ssh newmx4
> > Linux newmx4 2.4.19-ac4 #1 Wed Sep 18 10:45:42 CEST 2002 i686 unknown
> >
> > Most of the programs included with the Debian GNU/Linux system are
> > freely redistributable; the exact distribution terms for each program
> > are described in the individual files in /usr/share/doc/*/copyright
> >
> > Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
> > permitted by applicable law.
> > You have new mail.
> > Last login: Wed Jan 22 12:20:02 2003 from newmx4
> > nagios at newmx4:~$
> >
> > > you'll need to probably do a
> > > strings /path/to/your/check_by_ssh and look for something
> > like /usr/bin/ssh
> > > (as on my FreeBSD box).
> > >
> > > Lemme know if this is more helpful!
> >
> > well, i dont know, how to get on weiter, how to see how
> > nagios tries to
> > execute the plugin... how to see more debug, i mean more that
> > errpr 127
> > plugin may be missing, which is impossible because as u see i try
> > check_bye_ssh on the server itself, only over ssh...
> >
> >
> > thanks for your help, any ideas more maybe?
> >
> > charlie
> >
> > --
> > Vegh Karoly -  System Engineer - UTA - TIS.SAS.SDI
> > Cynics says that Hungarians created America's Hollywood before
> > other Hungarians less destructively created America's A-bomb.
> > http://www.mek.iif.hu/kiallit/tudtor/tudos1/martians.html
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Scholarships for Techies!
> > Can't afford IT training? All 2003 ictp students receive scholarships.
> > Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
> > www.ictp.com/training/sourceforge.asp
> > _______________________________________________
> > Nagios-users mailing list
> > Nagios-users at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/nagios-users
> >
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Scholarships for Techies!
> Can't afford IT training? All 2003 ictp students receive scholarships.
> Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
> www.ictp.com/training/sourceforge.asp
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Scholarships for Techies!
> Can't afford IT training? All 2003 ictp students receive scholarships.
> Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
> www.ictp.com/training/sourceforge.asp
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com




More information about the Users mailing list