[Nagios-users] question about check_by_ssh

2010-09-17 Thread Mirza Dedic
My nagiox box uses check_by_ssh to run a remote check_log script on a box, I 
have a tricky situation where I need to generate the log right before 
check_log is invoked.

This is the setup I have done:

On my local Nagios box, created a dummy shell script to invoke check_by_ssh 
twice, one to run the remote script to generate the log, and another to run 
check_log to check that log.

In my Nagios check commands, I call the dummy script, it first generates the 
log, waits 10 seconds and runs the check_log, both return:

nag...@van-nagios:/usr/local/nagios/libexec$ ./check_test
OK - check_by_ssh: Remote command '/home/nagios/plugins/check_appsrv' returned 
status 0
OK - no errors or warnings|app_production_lines=3 app_production_warnings=0 
app_production_criticals=0 app_production_unknowns=0

Will there be issues with Nagios when a check script returns two status? First 
check will almost always return an OK, it's the 2nd run that I care about.

The Oppenheimer Group  CONFIDENTIAL

This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information. If you have received it in 
error, please notify the sender immediately and delete the original. Any other 
use of the email by you is prohibited.

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
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] question about check_by_ssh

2010-09-17 Thread Morris, Patrick

 A check *cannot* return two status codes; it's just not possible.

Nagios will only respect the status code returned by your check plugin, 
and there will only be one of those.  If that plugin happens to run 
multiple scripts that return other codes, that's irrelevant; the only 
result code that matters is the one returned by your plugin.  In this 
case, after you run check_test, you can try echo $?.  That will return 
value of the single result code that will be passed to Nagios.  Whether 
that's correct or not depends on how your plugin was written.


On 9/17/2010 9:23 AM, Mirza Dedic wrote:


My nagiox box uses check_by_ssh to run a remote check_log script on a 
box, I have a tricky situation where I need to generate the log 
right before check_log is invoked.


This is the setup I have done:

On my local Nagios box, created a dummy shell script to invoke 
check_by_ssh twice, one to run the remote script to generate the log, 
and another to run check_log to check that log.


In my Nagios check commands, I call the dummy script, it first 
generates the log, waits 10 seconds and runs the check_log, both return:


nag...@van-nagios:/usr/local/nagios/libexec$ ./check_test

OK - check_by_ssh: Remote command '/home/nagios/plugins/check_appsrv' 
returned status 0


OK - no errors or warnings|app_production_lines=3 
app_production_warnings=0 app_production_criticals=0 
app_production_unknowns=0


Will there be issues with Nagios when a check script returns two 
status? First check will almost always return an OK, it's the 2^nd run 
that I care about.


The Oppenheimer Group  CONFIDENTIAL

This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information. If you have received it in 
error, please notify the sender immediately and delete the original. Any other 
use of the email by you is prohibited.




--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev___
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] question about check_by_ssh

2010-09-17 Thread diego . roccia
Actually, if nagios command definition is calling the dummy script, it won't 
receive 2 statuses, but only one. Btw, you could pass more commands to a single 
check_by_ssh, removing the dummy.

Diego


Sent from my BlackBerry® wireless device

-Original Message-
From: Mirza Dedic mi...@oppy.com
Date: Fri, 17 Sep 2010 09:23:42 
To: 'nagios-users@lists.sourceforge.net'nagios-users@lists.sourceforge.net
Reply-To: Nagios Users List nagios-users@lists.sourceforge.net
Subject: [Nagios-users] question about check_by_ssh

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
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