Weirdness with remote (passive) checks. Critical on remote, OK on local?

Scott Sugar ssugar at proserveit.com
Tue Aug 2 22:07:09 CEST 2005


Another way to test this is to turn off active checks on the central machine.
 
Scott
 
 
 
Marc said:
 
It could be that nagios is actively checking the host/service from your
central machine. Nagios.log would be a good place to look, on both
machines for that matter. You'll probably want to look at your log_
lines in nagios.cfg to bump up your logging.


________________________________

From: nagios-users-admin at lists.sourceforge.net on behalf of Marc Powell
Sent: Tue 8/2/2005 3:51 PM
To: nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] Weirdness with remote (passive) checks. Critical on remote, OK on local?





> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Brian Smith
> Sent: Tuesday, August 02, 2005 2:30 PM
> To: nagios-users at lists.sourceforge.net
> Subject: RE: [Nagios-users] Weirdness with remote (passive) checks.
> Critical on remote, OK on local?
>
> Thanks Marc for the tips, but this has just gotten weirder - neither
> submit_check_result, nor submit_check_result_via_nsca, seem to ever
run.
> NSCA is being invoked, I see its process pop up when checks happen.
> Checks are being delivered to home base, because manual Critical
states
> get overridden after a few minutes.  Also, I can invoke this command
and
> deliver a single distributed check successfully to home base:
>
> (folder)/submit_check_result_via_nsca remotehost 'Telnet' 2 'Because I
> said so'
>
> That command successfully sends the service into a soft critical state
> on the home server, and running it multiple times sends it to hard
> critical.


>
> I've tacked little "debug" lines into the submit_check_result and
> submit_..._via_nsca scripts to echo their commands into a log file,
and
> the log file never gets appended.  So I put commands in to echo the
word
> 'test' into the logfile, and that word never gets put in there either.

The destination file is writeable by the nagios user?

>
> From the end of checkcommands.cfg:
>
>    # 'submit_check_result' command definition
>    define command{
>            command_name    submit_check_result
>            command_line    $USER1$/eventhandlers/distributed-
>                monitoring/submit_check_result_via_nsca
>                $HOSTNAME$ '$SERVICEDESC$' $SERVICESTATE$ '$OUTPUT$'
>         }
>
> (except without the line breaks I inserted to make it behave in the
> email.)
>
> It appears I will have to trace, from the check queue to NSCA, how
this
> is being executed.  Can anyone tell me where in the config files the
> following things could be set:
>
> location of a custom script, if it's not set in the lines from
> checkcommands.cfg above?

I'm not sure what you mean here. In nagios.cfg you should have the
following --

obsess_over_services=1
ocsp_command=submit_check_result

The last may be what you're asking about.

For each service that you want to send a result back for (or in a shared
template), you should have the following as part of the service{}
definition --

obsess_over_service 1

Nagios will then execute the ocsp_command above for every service that
you are obsessing over. submit_check_result_via_nsca in your case will
parse the passed arguments, call send_nsca with the correct values which
connects to nsca on the central host which appends the results to
nagios.cmd. Enable debug for nsca if you haven't already and watch
/var/log/messages to watch the last few steps of that process.

>
> What return codes are used for OK, Critical, Warning, etc?  So far it

http://nagiosplug.sourceforge.net/developer-guidelines.html#AEN75

> appears Nagios is sending a 0 for all cases.  If not Nagios, whatever
is
> invoking NSCA is sending it, or whatever is invoking the script that
> invokes NSCA is.  I can't figure out what the chain of commands is
here,
> but I know that home base Nagios is working correctly and NSCA is
> sending / receiving correctly, and remote Nagios is writing Critical
in
> the status logs.
>
>
> And, by the way, am I correct in assuming people on the mailing list
> prefer text-only emails?  Otherwise I will send as html.

Yes, absolutely. You should send only plain text e-mails to any
[technical] mailing list you are on, not just this one. HTML e-mails
mess up archives and won't show up in digests or munge the digests such
that they are unreadable. There are other appropriateness and perception
reasons that are defined by each individual that I won't get into... As
always, the KISS rule applies here as well.

--
Marc


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=ick
_______________________________________________
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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050802/b2a5c66d/attachment.html>


More information about the Users mailing list