db_updater: Put parentheses back
[merlin.git] / hookinfo.h
blobeecd49022c7b59720dfb15567c0270567f1b17c5
1 /**
2 * Conversion table to encode and decode data-structs sent from
3 * Nagios to event broker modules.
5 * To add more checks here, first go check in nagios/include/nebcallbacks.h
6 * to figure out the thing you want to add stuff to. Then find the
7 * corresponding data struct in nagios/include/nebstructs.h and add the
8 * necessary info.
10 * 'strings' is the number of dynamic strings (char *)
11 * 'offset' is 'sizeof(nebstruct_something_data)'
12 * 'ptrs[]' are the offsets of each char *. use the offsetof() macro
14 #ifndef INCLUDE_hookinfo_h__
15 #define INCLUDE_hookinfo_h__
17 #include "shared.h"
19 static struct hook_info_struct {
20 int cb_type;
21 int strings;
22 off_t offset, ptrs[7];
23 } hook_info[NEBCALLBACK_NUMITEMS] = {
24 { NEBCALLBACK_PROCESS_DATA, 0, sizeof(nebstruct_process_data),
25 { 0, 0, 0, 0, 0 },
27 { NEBCALLBACK_TIMED_EVENT_DATA, 0, sizeof(nebstruct_timed_event_data),
28 { 0, 0, 0, 0, 0 },
30 { NEBCALLBACK_LOG_DATA, 1, sizeof(nebstruct_log_data),
32 offsetof(nebstruct_log_data, data),
33 0, 0, 0, 0
36 { NEBCALLBACK_SYSTEM_COMMAND_DATA, 2, sizeof(nebstruct_system_command_data),
38 offsetof(nebstruct_system_command_data, command_line),
39 offsetof(nebstruct_system_command_data, output),
40 0, 0, 0
43 { NEBCALLBACK_EVENT_HANDLER_DATA, 4, sizeof(nebstruct_event_handler_data),
45 offsetof(nebstruct_event_handler_data, host_name),
46 offsetof(nebstruct_event_handler_data, service_description),
47 offsetof(nebstruct_event_handler_data, command_line),
48 offsetof(nebstruct_event_handler_data, output),
52 { NEBCALLBACK_NOTIFICATION_DATA, 5, sizeof(nebstruct_notification_data),
54 offsetof(nebstruct_notification_data, host_name),
55 offsetof(nebstruct_notification_data, service_description),
56 offsetof(nebstruct_notification_data, output),
57 offsetof(nebstruct_notification_data, ack_author),
58 offsetof(nebstruct_notification_data, ack_data),
61 { NEBCALLBACK_SERVICE_CHECK_DATA, 5, sizeof(merlin_service_status),
63 offsetof(merlin_service_status, host_name),
64 offsetof(merlin_service_status, service_description),
65 offsetof(merlin_service_status, state.plugin_output),
66 offsetof(merlin_service_status, state.long_plugin_output),
67 offsetof(merlin_service_status, state.perf_data),
70 { NEBCALLBACK_HOST_CHECK_DATA, 4, sizeof(merlin_host_status),
72 offsetof(merlin_host_status, name),
73 offsetof(merlin_host_status, state.plugin_output),
74 offsetof(merlin_host_status, state.long_plugin_output),
75 offsetof(merlin_host_status, state.perf_data),
79 { NEBCALLBACK_COMMENT_DATA, 4, sizeof(nebstruct_comment_data),
81 offsetof(nebstruct_comment_data, host_name),
82 offsetof(nebstruct_comment_data, service_description),
83 offsetof(nebstruct_comment_data, author_name),
84 offsetof(nebstruct_comment_data, comment_data),
88 { NEBCALLBACK_DOWNTIME_DATA, 4, sizeof(nebstruct_downtime_data),
90 offsetof(nebstruct_downtime_data, host_name),
91 offsetof(nebstruct_downtime_data, service_description),
92 offsetof(nebstruct_downtime_data, author_name),
93 offsetof(nebstruct_downtime_data, comment_data),
97 { NEBCALLBACK_FLAPPING_DATA, 2, sizeof(nebstruct_flapping_data),
99 offsetof(nebstruct_flapping_data, host_name),
100 offsetof(nebstruct_flapping_data, service_description),
101 0, 0, 0
104 { NEBCALLBACK_PROGRAM_STATUS_DATA, 2, sizeof(nebstruct_program_status_data),
106 offsetof(nebstruct_program_status_data, global_host_event_handler),
107 offsetof(nebstruct_program_status_data, global_service_event_handler),
108 0, 0, 0
111 { NEBCALLBACK_HOST_STATUS_DATA, 4, sizeof(merlin_host_status),
113 offsetof(merlin_host_status, name),
114 offsetof(merlin_host_status, state.plugin_output),
115 offsetof(merlin_host_status, state.long_plugin_output),
116 offsetof(merlin_host_status, state.perf_data),
120 { NEBCALLBACK_SERVICE_STATUS_DATA, 5, sizeof(merlin_service_status),
122 offsetof(merlin_service_status, host_name),
123 offsetof(merlin_service_status, service_description),
124 offsetof(merlin_service_status, state.plugin_output),
125 offsetof(merlin_service_status, state.long_plugin_output),
126 offsetof(merlin_service_status, state.perf_data),
129 { NEBCALLBACK_ADAPTIVE_PROGRAM_DATA, 0, 0, { 0, 0, 0, 0, 0 }, },
130 { NEBCALLBACK_ADAPTIVE_HOST_DATA, 0, 0, { 0, 0, 0, 0, 0 }, },
131 { NEBCALLBACK_ADAPTIVE_SERVICE_DATA, 0, 0, { 0, 0, 0, 0, 0 }, },
132 { NEBCALLBACK_EXTERNAL_COMMAND_DATA, 2, sizeof(nebstruct_external_command_data),
134 offsetof(nebstruct_external_command_data, command_string),
135 offsetof(nebstruct_external_command_data, command_args),
136 0, 0, 0
139 { NEBCALLBACK_AGGREGATED_STATUS_DATA, 0, 0, { 0, 0, 0, 0, 0 }, },
140 { NEBCALLBACK_RETENTION_DATA, 0, 0, { 0, 0, 0, 0, 0 }, },
141 { NEBCALLBACK_CONTACT_NOTIFICATION_DATA, 6, sizeof(nebstruct_contact_notification_data),
143 offsetof(nebstruct_contact_notification_data, host_name),
144 offsetof(nebstruct_contact_notification_data, service_description),
145 offsetof(nebstruct_contact_notification_data, contact_name),
146 offsetof(nebstruct_contact_notification_data, output),
147 offsetof(nebstruct_contact_notification_data, ack_author),
148 offsetof(nebstruct_contact_notification_data, ack_data),
151 { NEBCALLBACK_CONTACT_NOTIFICATION_METHOD_DATA, 7, sizeof(nebstruct_contact_notification_method_data),
153 offsetof(nebstruct_contact_notification_method_data, host_name),
154 offsetof(nebstruct_contact_notification_method_data, service_description),
155 offsetof(nebstruct_contact_notification_method_data, contact_name),
156 offsetof(nebstruct_contact_notification_method_data, command_name),
157 offsetof(nebstruct_contact_notification_method_data, output),
158 offsetof(nebstruct_contact_notification_method_data, ack_author),
159 offsetof(nebstruct_contact_notification_method_data, ack_data),
162 { NEBCALLBACK_ACKNOWLEDGEMENT_DATA, 4, sizeof(nebstruct_acknowledgement_data),
164 offsetof(nebstruct_acknowledgement_data, host_name),
165 offsetof(nebstruct_acknowledgement_data, service_description),
166 offsetof(nebstruct_acknowledgement_data, author_name),
167 offsetof(nebstruct_acknowledgement_data, comment_data),
171 { NEBCALLBACK_STATE_CHANGE_DATA, 3, sizeof(nebstruct_statechange_data),
173 offsetof(nebstruct_statechange_data, host_name),
174 offsetof(nebstruct_statechange_data, service_description),
175 offsetof(nebstruct_statechange_data, output),
176 0, 0
179 { NEBCALLBACK_CONTACT_STATUS_DATA, 0, 0, { 0, 0, 0, 0, 0 }, },
180 { NEBCALLBACK_ADAPTIVE_CONTACT_DATA, 0, 0, { 0, 0, 0, 0, 0 }, },
183 #endif /* INCLUDE_hookinfo_h__ */