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