Question about NEB

Andreas Ericsson ae at op5.se
Fri Oct 21 13:26:00 CEST 2005


Hendrik Baecker wrote:
> Hi List,
> 
> now I've changed some code from Ethan's helloworld.c NEB to give me NEB 
> Callbacks from Nagios Core.
> 
> I've registered a callback for Service Check data like this:
> 
>    
> neb_register_callback(NEBCALLBACK_SERVICE_CHECK_DATA,nsca_neb_module_handle,0,nsca_neb_handle_data); 
> 
> 
> and I am processing this Service Checkdata just in that way, that I want 
> to see them in the log:
> 
> ###
> 
> case NEBCALLBACK_SERVICE_CHECK_DATA:
>                if((scdata=(nebstruct_service_check_data *)data)){
>                        
> snprintf(temp_buffer,sizeof(temp_buffer)-1,"nsca_neb:%s\t%s\t%d\t%s",(scdata->host_name), 
> 
>                                    (scdata->service_description), 
> (scdata->return_code), (scdata->output));
>                        temp_buffer[sizeof(temp_buffer)-1]='\x0';
>                        write_to_all_logs(temp_buffer,NSLOG_INFO_MESSAGE);
>             }
> break;
> 
> .....
> 
> ###
> 
> I am a little confused, cause I am getting two (different) Log entries 
> for each service check!
> 
> Log-Output:
> 
> [1129892835] nsca_neb:Nagios_Slave      Disk /usr       0       DISK OK 
> - free space: /usr 3425 MB (57%):
> [1129892836] nsca_neb:Nagios_Slave      Disk /usr       0       DISK OK 
> - free space: /usr 3425 MB (57%):
> [1129892854] nsca_neb:Nagios_Master     Disk /var       0       DISK OK 
> - free space: /var 2865 MB (57%):
> [1129892855] nsca_neb:Nagios_Master     Disk /var       0       DISK OK 
> - free space: /var 2865 MB (57%):
> 
> On the other side I have perfdata enabled and just see one entry for 
> each check.
> 
> Can anyone explain?
> 
> Is it a feature? Is it a bug?
> 

I think you've still got the ocsp-command (or oscp or something) 
enabled, so that the Nagios core and the module are both running send_nsca.

You also need to watch out for Nagios calling the module twice for each 
check it does. Once before and once after. This isn't likely to be what 
you're seeing though, because the two entries that are temporally close 
to each other have identical plugin output and AFAIR it should segfault 
if you try to use the plugin output before the check is run.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
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