Obsessive Compulsive Problem

Russell Scibetti russell at quadrix.com
Wed Feb 19 17:10:14 CET 2003


Try this:

First, "su - nagios", then run:

/opt/nagios/libexec/submit_check_result NAME_OF_HOST "SERVICE DESC" 
"CRITICAL" "PLUGIN OUTPUT"

Also, in the script, change all mentions of -1 to 3.  Unknowns are now 3 
for Nagios (someone might want to change this is the Nagios contrib 
directory if it hasn't been already).

Finally, do you have retain_nonstatus_information=1 for services?  My 
only other guess is that if you first has ocsp turned off, and then 
you've tried reloading Nagios, when retain_nonstatus is on, it will use 
the settings it already had rather than any changes to the cfg's.  So 
another thing to try would be to set that to 0, stop and start Nagios 
and see what it does.

I'm just trying to brainstorm what the problem could be.  It's got to 
either be that "nagios" can't run it for some reason, or that nagios 
can't tell that it's supposed to run it.  Another test could be to 
change the submit_check_result command in the commands.cfg to something 
you know works (an email notification command or something).  That would 
hopefully tell you what area the problem is in.

Russell Scibetti

Jason Marshall wrote:

>>Please also send us the content of the actual submit_check_result script.
>>
>
>Whoops, sorry, I meant to do that, and forgot to hit "paste"!
>
>#!/bin/sh
>
># 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)
>#
>
>touch /tmp/blah
>
># 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=-1
>  ;;
>esac
>
># pipe the service check info into the send_nsca program, which
># in turn transmits the data to the nsca daemon on the central
># monitoring server
>
>/bin/echo "$1\t$2\t$return_code\t$4\n" >/tmp/blah
>
>/bin/echo "$1\t$2\t$return_code\t$4\n" | /opt/nagios/bin/send_nsca \
>172.29.3.254 -c /opt/nagios/etc/send_nsca.cfg
>
>If I run it on the command line, it works A-OK.  It doesn't get run AT ALL
>by nagios -- that's why i put the touch at the top, so I'd see if it was
>actually being run.
>
>
>
>>Thanks.
>>
>>Russell
>>
>>Jason Marshall wrote:
>>
>>>>First thing to check...file permissions for the submit_check_result 
>>>>script.  I had a problem with that once.  Make sure that whatever used 
>>>>
>>>I just checked, and it was the wrong owner, but mode 755, so it was
>>>runnable by whomever.
>>>
>>>>Nagios runs as can execute that script.  Then double check the command 
>>>>you have defined in your misccommands.cfg file to make sure the syntax 
>>>>is good (suggestion:  email it to the list).  Rememver to put quotes 
>>>>around any $MACRO$ variable that could have spaces in them.
>>>>
>>>I had quotes around everything, and then removed them, and the results
>>>have been the same:
>>>
>>>define command {
>>>       command_name            submit_check_result
>>>       command_line            /opt/nagios/libexec/submit_check_result 
>>>$HOSTNAME$ $SERVICEDESC$ $SERVICESTATE$ '$OUTPUT$'
>>>}
>>>
>>>The command_line is all one one line, sorry for the wrappage.
>>>
>>>---
>>>Jason Marshall, Unix Geek, Kelman Technologies, Inc., Calgary, AB, Canada.
>>>
>>> From a Sun Microsystems bug report (#4102680):
>>>   "Workaround: don't pound on the mouse like a wild monkey."
>>>
>>> "I have great faith in fools: 
>>>    Self confidence my friends call it."  -Edgar Allan Poe
>>>
>>>
>>>
>>>
>>-- 
>>Russell Scibetti
>>Quadrix Solutions, Inc.
>>http://www.quadrix.com
>>(732) 235-2335, ext. 7038
>>
>>
>>
>
>---
>Jason Marshall, Unix Geek, Kelman Technologies, Inc., Calgary, AB, Canada.
>
>  From a Sun Microsystems bug report (#4102680):
>    "Workaround: don't pound on the mouse like a wild monkey."
>
>  "I have great faith in fools: 
>     Self confidence my friends call it."  -Edgar Allan Poe
>
>
>
>

-- 
Russell Scibetti
Quadrix Solutions, Inc.
http://www.quadrix.com
(732) 235-2335, ext. 7038


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


More information about the Users mailing list