Re: [Nagios-users] Problem with check_by_ssh

2010-02-05 Thread Sean McAfee
mirko stefanelli wrote:
 Hi to all,
 
 We run nagios on Ubuntu server with 2Gb ramm kernel version  
 2.6.24-23-server. Nagios version is 3.2.0.
 
 We have configured all our server (Linux REL) to execute our custom 
 plugin by check_by_ssh. The problem is that for some server this check 
 fails and the output is:
 
 CRITICAL - Plugin timed out while executing system call
 
 If we try to do same command, executed with check_by_shh, from user 
 nagios on cli the command work fine!
 
 Any idea?
 
 Regards,
 Mirko.

Doing it on the CLI as the Nagios user was the right first step.

Could you send your command definition, host definition, service 
definition, and any templates used?  It's very hard to troubleshoot 
without those.

-- 
Sean McAfee


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] Problem with check_by_ssh

2010-02-05 Thread mirko stefanelli
Hi,

yes if I doing it from the CLI as Nagios User is work fine.

Here:

Command definition:

# 'check_tablespace' command definition_
define command{
command_namecheck_tablespace
command_line$USER1$/check_by_ssh -H $HOSTADDRESS$ -C
/usr/local/nagios/libexec/check_tablespace $ARG1$ $ARG2$ $ARG3$ $ARG4$


Host definition:

define host{
use linux-server; Name of host
template to use
; This host
definition will inherit all variables that are defined
; in (or inherited
by) the linux-server host template definition.
host_name   siper_afr
alias   siper_afr
address 10.5.3.xxx
parents routerIperAfr
}

service definition:

define service{
use local-service ; Name of
service template to use
host_name   siper_afr
service_description tablespace
check_command
check_tablespace!siper!user!passwd!89
notifications_enabled   0
}

Service template definition:

# Local service definition template - This is NOT a real service, just a
template!

define service{
namelocal-service   ; The name
of this service template
use generic-service ; Inherit
default values from the generic-service definition
max_check_attempts  4   ; Re-check
the service up to 4 times in order to determine its final (hard) state
normal_check_interval   5   ; Check the
service every 5 minutes under normal conditions
retry_check_interval1   ; Re-check
the service every minute until a hard state can be determined
register0   ; DONT
REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}

thank in advance,
Mirko.

2010/2/5 Sean McAfee smca...@collaborativefusion.com

 mirko stefanelli wrote:

 Hi to all,

 We run nagios on Ubuntu server with 2Gb ramm kernel version
  2.6.24-23-server. Nagios version is 3.2.0.

 We have configured all our server (Linux REL) to execute our custom plugin
 by check_by_ssh. The problem is that for some server this check fails and
 the output is:

 CRITICAL - Plugin timed out while executing system call

 If we try to do same command, executed with check_by_shh, from user nagios
 on cli the command work fine!

 Any idea?

 Regards,
 Mirko.


 Doing it on the CLI as the Nagios user was the right first step.

 Could you send your command definition, host definition, service
 definition, and any templates used?  It's very hard to troubleshoot without
 those.

 --
 Sean McAfee


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com___
Nagios-users mailing list
Nagios-users@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

Re: [Nagios-users] Problem with check_by_ssh

2010-02-05 Thread Marc Powell

On Feb 5, 2010, at 9:42 AM, mirko stefanelli wrote:

 Hi,
 
 yes if I doing it from the CLI as Nagios User is work fine.
 
 Here:
 
 Command definition:
 
 # 'check_tablespace' command definition_
 define command{
 command_namecheck_tablespace
 command_line$USER1$/check_by_ssh -H $HOSTADDRESS$ -C 
 /usr/local/nagios/libexec/check_tablespace $ARG1$ $ARG2$ $ARG3$ $ARG4$


Does it/can it take longer than 10 seconds to run the check_tablespace command? 
If so, you need to adjust the service_check_timeout value in nagios.cfg if you 
haven't already done so. You'll probably also want to verify that the 
check_tablespace command itself doesn't have a built-in timeout.

--
Marc


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] Problem with check_by_ssh

2010-02-05 Thread Matt Simmons
My first guess would be that there is some sort of environmental
variable being set when you log in that wouldn't be set when you
aren't (ie, when Nagios triggers it). Are you using keys that have
passphrases, maybe?  Can you give us a look at the contents of
check_by_ssh?

--Matt


On Fri, Feb 5, 2010 at 10:12 AM, mirko stefanelli
mirko.stefane...@gmail.com wrote:
 Hi to all,

 We run nagios on Ubuntu server with 2Gb ramm kernel version
 2.6.24-23-server. Nagios version is 3.2.0.

 We have configured all our server (Linux REL) to execute our custom plugin
 by check_by_ssh. The problem is that for some server this check fails and
 the output is:

 CRITICAL - Plugin timed out while executing system call

 If we try to do same command, executed with check_by_shh, from user nagios
 on cli the command work fine!

 Any idea?

 Regards,
 Mirko.

 --
 The Planet: dedicated and managed hosting, cloud storage, colocation
 Stay online with enterprise data centers and the best network in the
 business
 Choose flexible plans and management services without long-term contracts
 Personal 24x7 support from experience hosting pros just a phone call away.
 http://p.sf.net/sfu/theplanet-com
 ___
 Nagios-users mailing list
 Nagios-users@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




-- 

LITTLE GIRL: But which cookie will you eat FIRST?
COOKIE MONSTER: Me think you have misconception of cookie-eating process.

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] Problem with check_by_ssh SOLVED

2010-01-22 Thread Mario Rimann

On Fri, 22 Jan 2010 13:35:48 +0100, Mario Rimann ma...@rimann.org wrote:
 Running the same stuff as the nagios user fails (script get's called,
but
 doesn't get the parameters)
 [nag...@monitoring ~]$  /path/to/libexec/check_by_ssh -l root -H
 xxx.xxx.xxx.xxx -v -C /root/bin/checkSomeThing.sh 300 500

Problem solved:

The key of the nagios user that was put into the authorized_keys file on
the remote server was restricted to a forced command - which obviously cut
of the parameters. *damned*

Cheers,
Mario

--
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
___
Nagios-users mailing list
Nagios-users@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


Re: [Nagios-users] Problem with check_by_ssh

2010-01-22 Thread Matt Simmons
Are you able to ssh to the remote machine as the remote user? I've
been bitten by not having the remote host in my nagios user's
known_hosts file, and my scripts get prompted, and for some reason
that stops me from obtaining statistics ;-)

--Matt


On Fri, Jan 22, 2010 at 7:35 AM, Mario Rimann ma...@rimann.org wrote:

 Hi there

 We're experiencing an issue on a new setup where check_by_ssh should run a
 script on a foreign host with two parameters and handle the response.
 Executing the script on the remote server works - but the parameters don't
 get transmitted to the remote server. Afther fiddling around with the
 service and the command definition, I started to run the command on the
 shell to see what happens:

 If I run it locally as root, all works out:
 [r...@monitoring ~]# /path/to/libexec/check_by_ssh -l root -H
 xxx.xxx.xxx.xxx -v -C /root/bin/checkSomeThing.sh 300 500

 Running the same stuff as the nagios user fails (script get's called, but
 doesn't get the parameters)
 [nag...@monitoring ~]$  /path/to/libexec/check_by_ssh -l root -H
 xxx.xxx.xxx.xxx -v -C /root/bin/checkSomeThing.sh 300 500

 I already checked /etc/passwd - but besides the user's names, user-id,
 group-id and the home directory path all looks the same - both have
 /bin/bash as their logon shell.

 Any hint?

 Cheers,
 Mario

 --
 Throughout its 18-year history, RSA Conference consistently attracts the
 world's best and brightest in the field, creating opportunities for Conference
 attendees to learn about information security's most important issues through
 interactions with peers, luminaries and emerging and established companies.
 http://p.sf.net/sfu/rsaconf-dev2dev
 ___
 Nagios-users mailing list
 Nagios-users@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




-- 

LITTLE GIRL: But which cookie will you eat FIRST?
COOKIE MONSTER: Me think you have misconception of cookie-eating process.

--
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
___
Nagios-users mailing list
Nagios-users@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