I'm trying to set up Icinga in a distributed configuration with one
remote Icinga instance and one central instance. I'm following the
instructions in this guide:
http://docs.icinga.org/latest/en/distributed.html

Section 7.6.7 "ocsp_command=submit_check_result" mentions the
submit_check_result command definition and shows the corresponding shell
script. That script basically pipes the right data into send_nsca and
sends it to the central Icinga server.

On my (Ubuntu Precise, Icinga 1.10) I found
/usr/share/icinga/plugins/eventhandlers/submit_check_result. That script
does something entirely different. It appends the data to the local
command file and doesn't use the NSCA client at all.
Here are the contents:

#!/bin/sh

# SUBMIT_CHECK_RESULT
# Written by Ethan Galstad (egals...@nagios.org)
# Modified by Icinga Development Team (https://dev.icinga.org)
#
# This script will write a command to the Icinga command
# file to cause Icinga to process a passive service check
# result.  Note: This script is intended to be run on the
# same host that is running Icinga.  If you want to
# submit passive check results from a remote machine, look
# at using the nsca addon.
#
# Arguments:
#  $1 = host_name (Short name of host that the service is
#       associated with)
#  $2 = svc_description (Description of the service)
#  $3 = return_code (An integer that determines the state
#       of the service check, 0=OK, 1=WARNING, 2=CRITICAL,
#       3=UNKNOWN).
#  $4 = plugin_output (A text string that should be used
#       as the plugin output for the service check)
#

echocmd="/bin/echo"

CommandFile="/var/lib/icinga/rw/icinga.cmd"

# get the current date/time in seconds since UNIX epoch
datetime=`date +%s`

# create the command line to add to the command file
cmdline="[$datetime] PROCESS_SERVICE_CHECK_RESULT;$1;$2;$3;$4"

# append the command to the end of the command file
`$echocmd $cmdline >> $CommandFile`

I'm very confused now. Isn't the NSCA daemon supposed to be the one
writing to the command file? What's the purpose of this script? Should I
replace the contents of the submit_check_result script on the
distributed machine with the example given in the docs?

Right now I'm considering just creating the script with a different name
and use that for the ocsp_command.

--
Kenny Rasschaert
+32 497 72 27 69 | Open Source consultant - Inuits.eu

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
icinga-users mailing list
icinga-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/icinga-users

Reply via email to