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

Brian Smith bsmith at fusionbroadband.com
Wed Aug 3 02:49:35 CEST 2005


> 
> See the example submit_check_result from
> http://nagios.sourceforge.net/docs/1_0/distributed.html. I'm not sure
> what script 'obsessive_svc_handler' is. I haven't seen that one
before.
> How did you install nagios? If it's a package the maintainer might
like
> to know about that confusion.


It's installed on Gentoo.  If I remember correctly, I think I used
Portage for that one.  Here's the folder it appears in:

/usr/nagios/contrib/eventhandlers/distributed-monitoring

both obsessive_svc_handler and submit_check_result_via_nsca are there.
Here's a paste of obsessive_svc_handler.  It just translates the text
code and then invokes the other script:


------------------------paste------------------------



#!/bin/sh

# OBSESSIVE_SVC_HANDLER
# Written by Ethan Galstad (nagios at nagils.org)
# Last Modified: 07-19-2001
#
# This script is intended to run as the OCSP command
# on a distributed monitoring server.  The script calls
# submit_check_result_via_nsca to send the service check
# results to the central monitoring server.
#
# Arguments:
#  $1 = host_name (Short name of host that the service is
#       associated with)
#  $2 = svc_description (Description of the service)
#  $3 = state_string (A string representing the status of
#       the given service - "OK", "WARNING", "CRITICAL"
#       or "UNKNOWN")
#  $4 = plugin_output (A text string that should be used
#       as the plugin output for the service checks)
#

# Location of the submit_check_result_via_nsca script
SubmitCmd="/usr/nagios/libexec/eventhandlers/submit_check_result_via_nsc
a"

# Convert the state string to the corresponding return code
return_code=-1

case "$3" in
        OK)
                return_code=0
                ;;
        WARNING)
                return_code=1
                ;;
        CRITICAL)
                return_code=2
                ;;
        UNKNOWN)
                return_code=3
                ;;
esac

# Send the service check results to the central monitoring server
$SubmitCmd "$1" "$2" $return_code "$4"



------------------------end paste------------------------



-- Brian


-------------------------------------------------------
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=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