R: force event_handler : SOLVED

Marco Borsani m.borsani at it.net
Wed Jun 15 14:29:23 CEST 2011


Thank you very much.

I made same configuration like yours, but the problem was another.
I found it few minutes ago, using only obsessive command, no event_handler.

Sometime happen that the macros have syntax that give problems to the
host_submit_check_result command.
To solve it I put 2 controls inside the script.

Many thanks for your time.
Regards
Marco

-----Messaggio originale-----
Da: Craig Stewart [mailto:Craig.Stewart at corp.xplornet.com] 
Inviato: mercoledì 15 giugno 2011 14:03
A: Nagios Users List
Cc: Marco Borsani
Oggetto: Re: [Nagios-users] R: force event_handler

Slight problem with my formatting that could lead to confusion.

I meant to say for system wide settings put these in nagios.cfg:

obsess_over_services=1
obsess_over_hosts=1

I put this in a high level template for hosts and services so it applies to
everything:

General:
ocsp_timeout=10
ochp_timeout=10

ochp_command=host_submit_check_result
ocsp_command=service_submit_check_result

This you put in your host/service entry or template:
ocsp_command=name_of_service_command_here
ochp_command=name_of_host_command_here

Sorry for any confusion.

Craig
--
Craig Stewart
Systems Integration Analyst
Craig.Stewart at corp.xplornet.com
Xplornet - Broadband, Everywhere

On 06/15/2011 08:44 AM, Craig Stewart wrote:
> Marco,
> 
> My first thought would be to ensure that the send_nsca on the sender 
> and the nscad on the receiver are working.
> 
> In the nagios.cfg, make sure you have the following if you want system 
> wide obsessing:
> 
> obsess_over_services=1
> obsess_over_hosts=1
> 
> I put this in a high level template for hosts and services so it 
> applies to everything:
> 
> General:
> ocsp_timeout=10
> ochp_timeout=10
> 
> For hosts:
> obsess_over_host 1
> ochp_command=host_submit_check_result
> 
> For services:
> obsess_over_service 1
> ocsp_command=service_submit_check_result
> 
> Make sure that the commands you specify exist.
> 
> Also, ensure that the service and host names match EXACTLY on the 
> remote and local system.  Otherwise you'll see entries in the log that 
> look something like
> "Warning:  Passive check result was received for service 'Up/Down' on 
> host 'blah.blah.blah', but the host could not be found!" or something 
> similar.
> 
> The Nagios documentation is very good for distributed monitoring.  
> It's what I used to build my setup.
> 
> Cheers!
> 
> Craig Stewart
> Systems Integration Analyst
> Craig.Stewart at corp.xplornet.com
> Xplornet - Broadband, Everywhere
> 
> On 06/15/2011 03:28 AM, Marco Borsani wrote:
>> Thanks.
>>
>> I already set OCHP and OCSP , using same command configured in 
>> event_handler, but nothing change.
>>
>> May you tell me how do you use OCHP and OCSP ?
>>
>> Regards
>> Marco
>>
>> -----Messaggio originale-----
>> Da: Craig Stewart [mailto:Craig.Stewart at corpxplornet.com
>> <mailto:Craig.Stewart at corpxplornet.com
> <mailto:Craig.Stewart at corp.xplornet.com>>]
>> Inviato: martedì 14 giugno 2011 16:59
>> A: Nagios Users List
>> Cc: Marco Borsani
>> Oggetto: Re: [Nagios-users] force event_handler
>>
>> Marco,
>>
>> I think what you want is the OCSP or OSHP command (Obsessive 
>> Compulsive Service/Host Processor)
>>
>> I think event handlers are more for taking corrective action.  The
> example I
>> saw was to log into a web server and restart the apache service when 
>> the check_web service went critical.  I'm using the OHCP command that 
>> uses send_nsca for every little thing, regardless of state.
>>  That's the nature of the beast.  Now, I'm sure you can tailor the 
>> command to only send what you want.
>>
>> I might be out in left field though.
>>
>> Hope it helps.
>>
>> Cheers!
>>
>> Craig
>>
>> Craig Stewart
>> Systems Integration Analyst
>> Craig.Stewart at corp.xplornet.com
>> Xplornet - Broadband, Everywhere
>>
>> On 06/14/2011 11:16 AM, Marco Borsani wrote:
>>> Hi all
>>>
>>>
>>>
>>> I need to execute a command every time an host state or a service 
>>> state change (to use send_nsca).
>>>
>>> I supposed was a normal behaviour, but something is going wrong

>>>
>>> Right now, the command configured in “event_handler” run only when 
>>> the state changes from OK to CRITICAL 
 never from CRITICAL to OK
>>>
>>>
>>>
>>> Any idea ?
>>>
>>> Thanks
>>>
>>> Marco
>>>
>>>
>>>
>>>
>>> --
>>> This message has been scanned for viruses and dangerous content by
>>> *MailScanner* <http://www.mailscanner.info/>, and is believed to be 
>>> clean.
>>
>>
>> --
>> This message has been scanned by MailScanner
>>
> 
> ----------------------------------------------------------------------
> -------- EditLive Enterprise is the world's most technically advanced 
> content authoring tool. Experience the power of Track Changes, Inline 
> Image Editing and ensure content is compliant with Accessibility 
> Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> 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
> 
> --
> This message has been scanned by MailScanner
> 


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
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