Processing all messages with NEB
Mohr James
james.mohr at elaxy.com
Sun Oct 23 15:05:01 CEST 2005
Hi All!
What I need to do is to catch all service messages/text that are sent to Nagios, whether done via an active or passive check (i.e. send_nsca). I am using the helloworld.c example and I have finally figured out how to get pull most of the data. I have a fuction like this that usually does what I want:
int helloworld_handle_status(int event_type, void *data){
char temp_buffer[1024];
service * tmp_service;
nebstruct_service_status_data * service_status_data;
if( (service_status_data=(nebstruct_service_status_data *)data) ){
tmp_service = (service *) service_status_data->object_ptr;
snprintf(temp_buffer,sizeof(temp_buffer)-1,"EVENT: %d MESSAGE: %s",event_type,tmp_service->plugin_output);
}
write_to_all_logs(temp_buffer,NSLOG_INFO_MESSAGE);
/* write_to_all_logs("inside: helloworld_handle_status",NSLOG_INFO_MESSAGE); */
}
However, when use tmp_service->plugin_output, it says "structure has no member named `plugin_output'". Inside of ../include/ojects.h, there is the definition of the service_struct, which shows me
char *plugin_output;
However, this is within an the block #ifdef NSCORE. Moving the line outside of the block, it will compile but when I send something to a service with send_nsca the value of plugin_output ends up being null. So, I am at a loss how to get the text of the plugin_output.
I have looked at th code for the mysql inserter module. However, I get stuck here as well.One thing that is unclear is whether **all** messages get sent through here or just the status changes. I need all of the messages and not just the status changes.
An additional goal is to be able to process and change the messages before being sent to the GUI. For example, the text contains a code number which tells the system to change the text to a specific URL so all you need to do is click on the message text to get instructions on what to do in a specific case. However, I have not yet figured out how to change the message that appears in the GUI.
Any help would be greatly appreaciated.
Regards,
Jim Mohr
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
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