check_by_ssh-issue(remote host monitoring)

Marc Powell marc at ena.com
Sun Apr 10 21:49:52 CEST 2005



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of vivek sharma sharma
> Sent: Sunday, April 10, 2005 1:22 PM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] check_by_ssh-issue(remote host monitoring)
> 
> Dear all,
>      I guess there is no solution for getting Nagios work in betn. two
OS
> as I have not got any reply in 3 days.

There are many ways. Guess any way you please though. As to your other
comment, I know that there was at least one.

> Well I have tried to work out one solution,its through check_by_ssh
plugin
> wherein i am trying to run the commands through it
> in the remote system(Solaris-OS) and give me the output in
Nagios(Nagios-
> OS).But the problem That i am getting is that i am
> getting proper output when i run the command on command line as Nagios
> user but when i restart the Nagios service and see it
> in GUI it basically gives me only first line of output.Same behaviour
> happens in the command line also if i remove the -O
> option but after giving that it works fine in command line but no
> improvement in GUI mode .

That is expected behavior given the command you are running below. If
you're going to write your own check plugins you should read the Plugin
Developers Guidelines at http://nagiosplug.sf.net, then you won't be
surprised by these little details. check_by_ssh is just a wrapper,
passing the output of the plugin run on the remote host back to Nagios.

> My configuration is as follows:
> 
> define command {
>                 command_name solaris_disk_check
>                 command_line $USER1$/check_by_ssh -H xxx.xxx.xxx -l
root -
> C 'df -k' -n solaris-disk-check -s solaris-disk-check -O $USER1$/test
> }
> 
> Command line output:
> [nagios at nagios libexec]$ id
> uid=501(nagios) gid=501(nagios) groups=501(nagios),502(nagcmd)
> [nagios at nagios libexec]$ /usr/local/nagios/libexec/check_by_ssh -H
> xxx.xxx.xxx -l root -C 'df -k' -n solaris-disk-check -s
> solaris-check-disk -O /usr/local/nagios/libexec/test
> Filesystem            kbytes    used  avail capacity  Mounted on
> /dev/md/dsk/d10      5040814 4140918  849488    83%    /
> /proc                      0      0      0    0%    /proc
> mnttab                    0      0      0    0%    /etc/mnttab
> fd                        0      0      0    0%    /dev/fd
> /dev/md/dsk/d30      4032504 3450385  541794    87%    /var
> swap                2248192    168 2248024    1%    /var/run
> swap                2254928    6904 2248024    1%    /tmp
> /dev/md/dsk/d50      1984564 1660404  264624    87%    /export
> /dev/md/dsk/d40      1488787  111161 1318075    8%    /opt
> [nagios at nagios libexec]$
> 
> GUI Output:
> Filesystem kbytes used avail capacity Mounted on
> 
> Both check_by_ssh plugin and test file are in
> /usr/local/nagios/libexec=$USER1$ directory
> 
> Also how would i make the nagios get a warning status for %age amount
of
> disk free etc. b'cos check_by_ssh plugin has option
> for warning/critical only on response time which is not useful for my
> situation.

Read the Plugin Developers Guidelines on how to exit with the proper
code or use the check_disk plugin which has already been written for
you.

--
Marc


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&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