diff --git a/centreon-certified/capensis/canopsis2-events-apiv2.lua b/centreon-certified/capensis/canopsis2-events-apiv2.lua index dbc29636..ec4d446a 100644 --- a/centreon-certified/capensis/canopsis2-events-apiv2.lua +++ b/centreon-certified/capensis/canopsis2-events-apiv2.lua @@ -348,7 +348,7 @@ function EventQueue:add() self.sc_flush.queues[category][element].events[#self.sc_flush.queues[category][element].events + 1] = self.sc_event.event.formated_event self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) - .. "max is: " .. tostring(self.sc_params.params.max_buffer_size)) + .. ", max is: " .. tostring(self.sc_params.params.max_buffer_size)) end end @@ -375,7 +375,13 @@ function EventQueue:send_data(payload, queue_metadata) local params = self.sc_params.params local url = params.sending_protocol .. "://" .. params.canopsis_user .. ":" .. params.canopsis_password .. "@" .. params.canopsis_host .. ':' .. params.canopsis_port .. queue_metadata.event_route - local data = broker.json_encode(payload) + payload = broker.json_encode(payload) + queue_metadata.headers = { + "content-length: " .. string.len(payload), + "content-type: application/json" + } + + self.sc_logger:log_curl_command(url, queue_metadata, self.sc_params.params, payload) -- write payload in the logfile for test purpose if self.sc_params.params.send_data_test == 1 then @@ -383,7 +389,7 @@ function EventQueue:send_data(payload, queue_metadata) return true end - self.sc_logger:info("[EventQueue:send_data]: Going to send the following json " .. data) + self.sc_logger:info("[EventQueue:send_data]: Going to send the following json " .. payload) self.sc_logger:info("[EventQueue:send_data]: Canopsis address is: " .. tostring(url)) local http_response_body = "" @@ -396,13 +402,7 @@ function EventQueue:send_data(payload, queue_metadata) ) :setopt(curl.OPT_TIMEOUT, self.sc_params.params.connection_timeout) :setopt(curl.OPT_SSL_VERIFYPEER, self.sc_params.params.allow_insecure_connection) - :setopt( - curl.OPT_HTTPHEADER, - { - "content-length: " .. string.len(data), - "content-type: application/json" - } - ) + :setopt(curl.OPT_HTTPHEADER, queue_metadata.headers) -- set proxy address configuration if (self.sc_params.params.proxy_address ~= '') then @@ -427,14 +427,7 @@ function EventQueue:send_data(payload, queue_metadata) if queue_metadata.method and queue_metadata.method == "DELETE" then http_request:setopt(curl.OPT_CUSTOMREQUEST, queue_metadata.method) else - http_request:setopt( - curl.OPT_HTTPHEADER, - { - "content-length: " .. string.len(data), - "content-type: application/json" - } - ) - http_request:setopt_postfields(data) + http_request:setopt_postfields(payload) end -- performing the HTTP request diff --git a/centreon-certified/capensis/canopsis4-events-apiv2.lua b/centreon-certified/capensis/canopsis4-events-apiv2.lua index c09f908b..e8735ed5 100644 --- a/centreon-certified/capensis/canopsis4-events-apiv2.lua +++ b/centreon-certified/capensis/canopsis4-events-apiv2.lua @@ -355,7 +355,7 @@ function EventQueue:add() self.sc_flush.queues[category][element].events[#self.sc_flush.queues[category][element].events + 1] = self.sc_event.event.formated_event self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) - .. "max is: " .. tostring(self.sc_params.params.max_buffer_size)) + .. ", max is: " .. tostring(self.sc_params.params.max_buffer_size)) end end @@ -380,15 +380,22 @@ function EventQueue:send_data(payload, queue_metadata) local params = self.sc_params.params local url = params.sending_protocol .. "://" .. params.canopsis_host .. ':' .. params.canopsis_port .. queue_metadata.event_route - local data = broker.json_encode(payload) - + payload = broker.json_encode(payload) + queue_metadata.headers = { + "content-length: " .. string.len(payload), + "content-type: application/json", + "x-canopsis-authkey: " .. tostring(self.sc_params.params.canopsis_authkey) + } + + self.sc_logger:log_curl_command(url, queue_metadata, self.sc_params.params, payload) + -- write payload in the logfile for test purpose if self.sc_params.params.send_data_test == 1 then - self.sc_logger:notice("[send_data]: " .. tostring(data)) + self.sc_logger:notice("[send_data]: " .. tostring(payload)) return true end - self.sc_logger:info("[EventQueue:send_data]: Going to send the following json " .. data) + self.sc_logger:info("[EventQueue:send_data]: Going to send the following json " .. payload) self.sc_logger:info("[EventQueue:send_data]: Canopsis address is: " .. tostring(url)) local http_response_body = "" @@ -401,14 +408,7 @@ function EventQueue:send_data(payload, queue_metadata) ) :setopt(curl.OPT_TIMEOUT, self.sc_params.params.connection_timeout) :setopt(curl.OPT_SSL_VERIFYPEER, self.sc_params.params.allow_insecure_connection) - :setopt( - curl.OPT_HTTPHEADER, - { - "content-length: " .. string.len(data), - "content-type: application/json", - "x-canopsis-authkey: " .. tostring(self.sc_params.params.canopsis_authkey) - } - ) + :setopt(curl.OPT_HTTPHEADER, queue_metadata.headers) -- set proxy address configuration if (self.sc_params.params.proxy_address ~= '') then @@ -434,14 +434,7 @@ function EventQueue:send_data(payload, queue_metadata) http_request:setopt(curl.OPT_CUSTOMREQUEST, queue_metadata.method) end - http_request:setopt( - curl.OPT_HTTPHEADER, - { - "content-length: " .. string.len(data), - "content-type: application/json" - } - ) - http_request:setopt_postfields(data) + http_request:setopt_postfields(payload) -- performing the HTTP request http_request:perform() diff --git a/centreon-certified/datadog/datadog-events-apiv2.lua b/centreon-certified/datadog/datadog-events-apiv2.lua index 9292723c..264ab1a0 100644 --- a/centreon-certified/datadog/datadog-events-apiv2.lua +++ b/centreon-certified/datadog/datadog-events-apiv2.lua @@ -190,7 +190,7 @@ function EventQueue:add() self.sc_flush.queues[category][element].events[#self.sc_flush.queues[category][element].events + 1] = self.sc_event.event.formated_event self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) - .. "max is: " .. tostring(self.sc_params.params.max_buffer_size)) + .. ", max is: " .. tostring(self.sc_params.params.max_buffer_size)) end -------------------------------------------------------------------------------- @@ -213,7 +213,12 @@ function EventQueue:send_data(payload, queue_metadata) self.sc_logger:debug("[EventQueue:send_data]: Starting to send data") local url = self.sc_params.params.http_server_url .. self.sc_params.params.datadog_event_endpoint + queue_metadata.headers = { + "content-type: application/json", + "DD-API-KEY:" .. self.sc_params.params.api_key + } + self.sc_logger:log_curl_command(url, queue_metadata, self.sc_params.params, payload) -- write payload in the logfile for test purpose if self.sc_params.params.send_data_test == 1 then self.sc_logger:notice("[send_data]: " .. tostring(payload)) @@ -233,13 +238,7 @@ function EventQueue:send_data(payload, queue_metadata) ) :setopt(curl.OPT_TIMEOUT, self.sc_params.params.connection_timeout) :setopt(curl.OPT_SSL_VERIFYPEER, self.sc_params.params.allow_insecure_connection) - :setopt( - curl.OPT_HTTPHEADER, - { - "content-type: application/json", - "DD-API-KEY:" .. self.sc_params.params.api_key - } - ) + :setopt(curl.OPT_HTTPHEADER, queue_metadata.headers) -- set proxy address configuration if (self.sc_params.params.proxy_address ~= '') then diff --git a/centreon-certified/datadog/datadog-metrics-apiv2.lua b/centreon-certified/datadog/datadog-metrics-apiv2.lua index 51516aec..19e002e1 100644 --- a/centreon-certified/datadog/datadog-metrics-apiv2.lua +++ b/centreon-certified/datadog/datadog-metrics-apiv2.lua @@ -234,7 +234,7 @@ function EventQueue:add() self.sc_flush.queues[category][element].events[#self.sc_flush.queues[category][element].events + 1] = self.sc_event.event.formated_event self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) - .. "max is: " .. tostring(self.sc_params.params.max_buffer_size)) + .. ", max is: " .. tostring(self.sc_params.params.max_buffer_size)) end -------------------------------------------------------------------------------- @@ -260,6 +260,12 @@ function EventQueue:send_data(payload, queue_metadata) local url = self.sc_params.params.http_server_url .. tostring(self.sc_params.params.datadog_metric_endpoint) local payload_json = broker.json_encode(payload) + queue_metadata.headers = { + "content-type: application/json", + "DD-API-KEY:" .. self.sc_params.params.api_key + } + + self.sc_logger:log_curl_command(url, queue_metadata, self.sc_params.params, payload_json) -- write payload in the logfile for test purpose if self.sc_params.params.send_data_test == 1 then @@ -280,13 +286,7 @@ function EventQueue:send_data(payload, queue_metadata) ) :setopt(curl.OPT_TIMEOUT, self.sc_params.params.connection_timeout) :setopt(curl.OPT_SSL_VERIFYPEER, self.sc_params.params.allow_insecure_connection) - :setopt( - curl.OPT_HTTPHEADER, - { - "content-type: application/json", - "DD-API-KEY:" .. self.sc_params.params.api_key - } - ) + :setopt(curl.OPT_HTTPHEADER,queue_metadata.headers) -- set proxy address configuration if (self.sc_params.params.proxy_address ~= '') then diff --git a/centreon-certified/elasticsearch/elastic-events-apiv2.lua b/centreon-certified/elasticsearch/elastic-events-apiv2.lua index 780fced2..79bbc212 100644 --- a/centreon-certified/elasticsearch/elastic-events-apiv2.lua +++ b/centreon-certified/elasticsearch/elastic-events-apiv2.lua @@ -177,8 +177,8 @@ function EventQueue:format_accepted_event() self.sc_flush.queues[category][element].events[#self.sc_flush.queues[category][element].events + 1] = self.sc_event.event.formated_event - self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) - .. "max is: " .. tostring(self.sc_params.params.max_buffer_size)) + self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) + .. ", max is: " .. tostring(self.sc_params.params.max_buffer_size)) end -------------------------------------------------------------------------------- @@ -200,6 +200,15 @@ function EventQueue:format_accepted_event() function EventQueue:send_data(payload, queue_metadata) self.sc_logger:debug("[EventQueue:send_data]: Starting to send data") + local url = self.sc_params.params.elastic_url .. "/_bulk" + queue_metadata.headers = { + "content-type: application/json;charset=UTF-8", + "content-length: " .. string.len(payload), + "Authorization: Basic " .. (mime.b64(self.sc_params.params.elastic_username .. ":" .. self.sc_params.params.elastic_password)) + } + + self.sc_logger:log_curl_command(url, queue_metadata, self.sc_params.params, payload) + -- write payload in the logfile for test purpose if self.sc_params.params.send_data_test == 1 then self.sc_logger:info("[send_data]: " .. tostring(payload)) @@ -209,24 +218,18 @@ function EventQueue:format_accepted_event() self.sc_logger:info("[EventQueue:send_data]: Going to send the following json " .. tostring(payload)) self.sc_logger:info("[EventQueue:send_data]: Elastic URL is: " .. tostring(self.sc_params.params.elastic_url) .. "/_bulk") - local http_response_body = "" - local http_request = curl.easy() - :setopt_url(self.sc_params.params.elastic_url .. "/_bulk") - :setopt_writefunction( - function (response) - http_response_body = http_response_body .. tostring(response) - end - ) - :setopt(curl.OPT_TIMEOUT, self.sc_params.params.connection_timeout) - :setopt(curl.OPT_SSL_VERIFYPEER, self.sc_params.params.allow_insecure_connection) - :setopt( - curl.OPT_HTTPHEADER, - { - "content-type: application/json;charset=UTF-8", - "content-length: " .. string.len(payload), - "Authorization: Basic " .. (mime.b64(self.sc_params.params.elastic_username .. ":" .. self.sc_params.params.elastic_password)) - } - ) + local http_response_body = "" + local http_request = curl.easy() + :setopt_url(url) + :setopt_writefunction( + function (response) + http_response_body = http_response_body .. tostring(response) + end + ) + :setopt(curl.OPT_TIMEOUT, self.sc_params.params.connection_timeout) + :setopt(curl.OPT_SSL_VERIFYPEER, self.sc_params.params.allow_insecure_connection) + :setopt(curl.OPT_HTTPHEADER, queue_metadata.headers) + -- set proxy address configuration if (self.sc_params.params.proxy_address ~= '') then if (self.sc_params.params.proxy_port ~= '') then diff --git a/centreon-certified/kafka/kafka-events-apiv2.lua b/centreon-certified/kafka/kafka-events-apiv2.lua index c23e3e81..5509ea79 100644 --- a/centreon-certified/kafka/kafka-events-apiv2.lua +++ b/centreon-certified/kafka/kafka-events-apiv2.lua @@ -184,8 +184,8 @@ function EventQueue:add() self.sc_flush.queues[category][element].events[#self.sc_flush.queues[category][element].events + 1] = self.sc_event.event.formated_event - self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) - .. "max is: " .. tostring(self.sc_params.params.max_buffer_size)) + self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) + .. ", max is: " .. tostring(self.sc_params.params.max_buffer_size)) end -------------------------------------------------------------------------------- diff --git a/centreon-certified/logstash/logstash-events-apiv2.lua b/centreon-certified/logstash/logstash-events-apiv2.lua index ee96be5b..18203d98 100644 --- a/centreon-certified/logstash/logstash-events-apiv2.lua +++ b/centreon-certified/logstash/logstash-events-apiv2.lua @@ -170,7 +170,7 @@ function EventQueue:add() self.sc_flush.queues[category][element].events[#self.sc_flush.queues[category][element].events + 1] = self.sc_event.event.formated_event self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) - .. "max is: " .. tostring(self.sc_params.params.max_buffer_size)) + .. ", max is: " .. tostring(self.sc_params.params.max_buffer_size)) end -------------------------------------------------------------------------------- @@ -193,6 +193,10 @@ end function EventQueue:send_data(payload, queue_metadata) self.sc_logger:debug("[EventQueue:send_data]: Starting to send data") + queue_metadata.headers = {"accept: application/json"} + queue_metadata.method = "PUT" + self.sc_logger:log_curl_command(url, queue_metadata, self.sc_params.params, payload) + -- write payload in the logfile for test purpose if self.sc_params.params.send_data_test == 1 then self.sc_logger:notice("[send_data]: " .. tostring(payload)) @@ -212,13 +216,8 @@ function EventQueue:send_data(payload, queue_metadata) ) :setopt(curl.OPT_TIMEOUT, self.sc_params.params.connection_timeout) :setopt(curl.OPT_SSL_VERIFYPEER, self.sc_params.params.allow_insecure_connection) - :setopt(curl.OPT_CUSTOMREQUEST, "PUT") - :setopt( - curl.OPT_HTTPHEADER, - { - "accept: application/json" - } - ) + :setopt(curl.OPT_CUSTOMREQUEST, queue_metadata.method) + :setopt(curl.OPT_HTTPHEADER, queue_metadata.headers) -- set proxy address configuration if (self.sc_params.params.proxy_address ~= '') then diff --git a/centreon-certified/omi/omi_events-apiv2.lua b/centreon-certified/omi/omi_events-apiv2.lua index b4d9cb12..801b9ce1 100644 --- a/centreon-certified/omi/omi_events-apiv2.lua +++ b/centreon-certified/omi/omi_events-apiv2.lua @@ -197,8 +197,8 @@ function EventQueue:add() self.sc_logger:debug("[EventQueue:add]: queue size before adding event: " .. tostring(#self.sc_flush.queues[category][element].events)) self.sc_flush.queues[category][element].events[#self.sc_flush.queues[category][element].events + 1] = self.sc_event.event.formated_event - self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) - .. "max is: " .. tostring(self.sc_params.params.max_buffer_size)) + self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) + .. ", max is: " .. tostring(self.sc_params.params.max_buffer_size)) end -------------------------------------------------------------------------------- @@ -229,6 +229,14 @@ end function EventQueue:send_data(payload, queue_metadata) self.sc_logger:debug("[EventQueue:send_data]: Starting to send data") + local url = self.sc_params.params.http_server_url + queue_metadata.headers = { + "Content-Type: text/xml", + "content-length: " .. string.len(payload) + } + + self.sc_logger:log_curl_command(url, queue_metadata, self.sc_params.params, payload) + -- write payload in the logfile for test purpose if self.sc_params.params.send_data_test == 1 then self.sc_logger:notice("[send_data]: " .. tostring(payload)) @@ -236,11 +244,11 @@ function EventQueue:send_data(payload, queue_metadata) end self.sc_logger:info("[EventQueue:send_data]: Going to send the following xml " .. tostring(payload)) - self.sc_logger:info("[EventQueue:send_data]: BSM Http Server URL is: \"" .. tostring(self.sc_params.params.http_server_url .. "\"")) + self.sc_logger:info("[EventQueue:send_data]: BSM Http Server URL is: \"" .. tostring(url) .. "\"") local http_response_body = "" local http_request = curl.easy() - :setopt_url(self.sc_params.params.http_server_url) + :setopt_url(url) :setopt_writefunction( function (response) http_response_body = http_response_body .. tostring(response) @@ -248,13 +256,7 @@ function EventQueue:send_data(payload, queue_metadata) ) :setopt(curl.OPT_TIMEOUT, self.sc_params.params.connection_timeout) :setopt(curl.OPT_SSL_VERIFYPEER, self.sc_params.params.allow_insecure_connection) - :setopt( - curl.OPT_HTTPHEADER, - { - "Content-Type: text/xml", - "content-length: " .. string.len(payload) - } - ) + :setopt(curl.OPT_HTTPHEADER,queue_metadata.headers) -- set proxy address configuration if (self.sc_params.params.proxy_address ~= '') then diff --git a/centreon-certified/pagerduty/pagerduty-events-apiv2.lua b/centreon-certified/pagerduty/pagerduty-events-apiv2.lua index fc2f2353..7d7cf491 100644 --- a/centreon-certified/pagerduty/pagerduty-events-apiv2.lua +++ b/centreon-certified/pagerduty/pagerduty-events-apiv2.lua @@ -311,7 +311,7 @@ function EventQueue:add() self.sc_flush.queues[category][element].events[#self.sc_flush.queues[category][element].events + 1] = self.sc_event.event.formated_event self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) - .. "max is: " .. tostring(self.sc_params.params.max_buffer_size)) + .. ", max is: " .. tostring(self.sc_params.params.max_buffer_size)) end -------------------------------------------------------------------------------- @@ -333,6 +333,14 @@ end function EventQueue:send_data(payload, queue_metadata) self.sc_logger:debug("[EventQueue:send_data]: Starting to send data") + local url = self.sc_params.params.http_server_url + queue_metadata.headers = { + "content-type: application/json", + "content-length:" .. string.len(payload), + } + + self.sc_logger:log_curl_command(url, queue_metadata, self.sc_params.params, payload) + -- write payload in the logfile for test purpose if self.sc_params.params.send_data_test == 1 then self.sc_logger:notice("[send_data]: " .. tostring(payload)) @@ -340,11 +348,11 @@ function EventQueue:send_data(payload, queue_metadata) end self.sc_logger:info("[EventQueue:send_data]: Going to send the following json " .. tostring(payload)) - self.sc_logger:info("[EventQueue:send_data]: Pagerduty address is: " .. tostring(self.sc_params.params.http_server_url)) + self.sc_logger:info("[EventQueue:send_data]: Pagerduty address is: " .. tostring(url)) local http_response_body = "" local http_request = curl.easy() - :setopt_url(self.sc_params.params.http_server_url) + :setopt_url(url) :setopt_writefunction( function (response) http_response_body = http_response_body .. tostring(response) @@ -352,13 +360,7 @@ function EventQueue:send_data(payload, queue_metadata) ) :setopt(curl.OPT_TIMEOUT, self.sc_params.params.connection_timeout) :setopt(curl.OPT_SSL_VERIFYPEER, self.sc_params.params.allow_insecure_connection) - :setopt( - curl.OPT_HTTPHEADER, - { - "content-type: application/json", - "content-length:" .. string.len(payload), - } - ) + :setopt(curl.OPT_HTTPHEADER, queue_metadata.headers) -- set proxy address configuration if (self.sc_params.params.proxy_address ~= '') then diff --git a/centreon-certified/servicenow/servicenow-em-events-apiv2.lua b/centreon-certified/servicenow/servicenow-em-events-apiv2.lua index ef15ed19..3eac03dc 100644 --- a/centreon-certified/servicenow/servicenow-em-events-apiv2.lua +++ b/centreon-certified/servicenow/servicenow-em-events-apiv2.lua @@ -218,13 +218,30 @@ end -- @throw exception if http call fails or response is empty -------------------------------------------------------------------------------- function EventQueue:call(url, method, data, authToken) - method = method or "GET" data = data or nil authToken = authToken or nil + local queue_metadata = { + method = method or "GET" + } + + -- handle headers + if not authToken and queue_metadata.method ~= "GET" then + self.sc_logger:debug("EventQueue:call: Add form header") + queue_metadata.headers = {"Content-Type: application/x-www-form-urlencoded"} + else + broker_log:info(3, "Add JSON header") + queue_metadata.headers = { + "Accept: application/json", + "Content-Type: application/json", + "Authorization: Bearer " .. authToken + } + end local endpoint = "https://" .. tostring(self.sc_params.params.instance) .. ".service-now.com/" .. tostring(url) self.sc_logger:debug("EventQueue:call: Prepare url " .. endpoint) + self.sc_logger:log_curl_command(endpoint, queue_metadata, self.sc_params.params, data) + -- write payload in the logfile for test purpose if self.sc_params.params.send_data_test == 1 then self.sc_logger:notice("[send_data]: " .. tostring(data) .. " to endpoint: " .. tostring(endpoint)) @@ -238,6 +255,7 @@ function EventQueue:call(url, method, data, authToken) res = res .. tostring(response) end) :setopt(curl.OPT_TIMEOUT, self.sc_params.params.connection_timeout) + :setopt(curl.OPT_HTTPHEADER, queue_metadata.headers) self.sc_logger:debug("EventQueue:call: Request initialize") @@ -259,24 +277,7 @@ function EventQueue:call(url, method, data, authToken) end end - if not authToken then - if method ~= "GET" then - self.sc_logger:debug("EventQueue:call: Add form header") - request:setopt(curl.OPT_HTTPHEADER, { "Content-Type: application/x-www-form-urlencoded" }) - end - else - broker_log:info(3, "Add JSON header") - request:setopt( - curl.OPT_HTTPHEADER, - { - "Accept: application/json", - "Content-Type: application/json", - "Authorization: Bearer " .. authToken - } - ) - end - - if method ~= "GET" then + if queue_metadata.method ~= "GET" then self.sc_logger:debug("EventQueue:call: Add post data") request:setopt_postfields(data) end @@ -389,7 +390,7 @@ function EventQueue:add() self.sc_flush.queues[category][element].events[#self.sc_flush.queues[category][element].events + 1] = self.sc_event.event.formated_event self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) - .. "max is: " .. tostring(self.sc_params.params.max_buffer_size)) + .. ", max is: " .. tostring(self.sc_params.params.max_buffer_size)) end -------------------------------------------------------------------------------- diff --git a/centreon-certified/servicenow/servicenow-incident-events-apiv2.lua b/centreon-certified/servicenow/servicenow-incident-events-apiv2.lua index 3c074e62..f184df5f 100644 --- a/centreon-certified/servicenow/servicenow-incident-events-apiv2.lua +++ b/centreon-certified/servicenow/servicenow-incident-events-apiv2.lua @@ -228,13 +228,31 @@ end -- @throw exception if http call fails or response is empty -------------------------------------------------------------------------------- function EventQueue:call(url, method, data, authToken) - method = method or "GET" data = data or nil authToken = authToken or nil + local queue_metadata = { + method = method or "GET" + } + + -- handle headers + if not authToken and queue_metadata.method ~= "GET" then + self.sc_logger:debug("EventQueue:call: Add form header") + queue_metadata.headers = {"Content-Type: application/x-www-form-urlencoded"} + else + broker_log:info(3, "Add JSON header") + queue_metadata.headers = { + "Accept: application/json", + "Content-Type: application/json", + "Authorization: Bearer " .. authToken + } + end + local endpoint = "https://" .. tostring(self.sc_params.params.instance) .. "." .. self.sc_params.params.http_server_url .. "/" .. tostring(url) self.sc_logger:debug("EventQueue:call: Prepare url " .. endpoint) + self.sc_logger:log_curl_command(endpoint, queue_metadata, self.sc_params.params, data) + -- write payload in the logfile for test purpose if self.sc_params.params.send_data_test == 1 then self.sc_logger:notice("[send_data]: " .. tostring(data) .. " to endpoint: " .. tostring(endpoint)) @@ -248,6 +266,7 @@ function EventQueue:call(url, method, data, authToken) res = res .. tostring(response) end) :setopt(curl.OPT_TIMEOUT, self.sc_params.params.connection_timeout) + :setopt(curl.OPT_HTTPHEADER, queue_metadata.headers) self.sc_logger:debug("EventQueue:call: Request initialize") @@ -269,24 +288,7 @@ function EventQueue:call(url, method, data, authToken) end end - if not authToken then - if method ~= "GET" then - self.sc_logger:debug("EventQueue:call: Add form header") - request:setopt(curl.OPT_HTTPHEADER, { "Content-Type: application/x-www-form-urlencoded" }) - end - else - broker_log:info(3, "Add JSON header") - request:setopt( - curl.OPT_HTTPHEADER, - { - "Accept: application/json", - "Content-Type: application/json", - "Authorization: Bearer " .. authToken - } - ) - end - - if method ~= "GET" then + if queue_metadata.method ~= "GET" then self.sc_logger:debug("EventQueue:call: Add post data") request:setopt_postfields(data) end @@ -390,7 +392,7 @@ function EventQueue:add() self.sc_flush.queues[category][element].events[#self.sc_flush.queues[category][element].events + 1] = self.sc_event.event.formated_event self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) - .. "max is: " .. tostring(self.sc_params.params.max_buffer_size)) + .. ", max is: " .. tostring(self.sc_params.params.max_buffer_size)) end -------------------------------------------------------------------------------- diff --git a/centreon-certified/signl4/signl4-events-apiv2.lua b/centreon-certified/signl4/signl4-events-apiv2.lua index 79b677bb..f2b312bc 100644 --- a/centreon-certified/signl4/signl4-events-apiv2.lua +++ b/centreon-certified/signl4/signl4-events-apiv2.lua @@ -180,8 +180,8 @@ function EventQueue:add() self.sc_logger:debug("[EventQueue:add]: queue size before adding event: " .. tostring(#self.sc_flush.queues[category][element].events)) self.sc_flush.queues[category][element].events[#self.sc_flush.queues[category][element].events + 1] = self.sc_event.event.formated_event - self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) - .. "max is: " .. tostring(self.sc_params.params.max_buffer_size)) + self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) + .. ", max is: " .. tostring(self.sc_params.params.max_buffer_size)) end -------------------------------------------------------------------------------- @@ -202,6 +202,10 @@ end function EventQueue:send_data(payload, queue_metadata) self.sc_logger:debug("[EventQueue:send_data]: Starting to send data") + local url = self.sc_params.params.server_address .. "/webhook/" .. self.sc_params.params.team_secret + queue_metadata.headers = {"content-type: application/json"} + + self.sc_logger:log_curl_command(url, queue_metadata, self.sc_params.params, payload) -- write payload in the logfile for test purpose if self.sc_params.params.send_data_test == 1 then @@ -210,11 +214,11 @@ function EventQueue:send_data(payload, queue_metadata) end self.sc_logger:info("[EventQueue:send_data]: Going to send the following json " .. tostring(payload)) - self.sc_logger:info("[EventQueue:send_data]: Signl4 Server URL is: " .. tostring(self.sc_params.params.server_address) .. "/webhook/" .. tostring(self.sc_params.params.team_secret)) + self.sc_logger:info("[EventQueue:send_data]: Signl4 Server URL is: " .. tostring(url)) local http_response_body = "" local http_request = curl.easy() - :setopt_url(self.sc_params.params.server_address .. "/webhook/" .. self.sc_params.params.team_secret) + :setopt_url(url) :setopt_writefunction( function (response) http_response_body = http_response_body .. tostring(response) @@ -222,12 +226,8 @@ function EventQueue:send_data(payload, queue_metadata) ) :setopt(curl.OPT_TIMEOUT, self.sc_params.params.connection_timeout) :setopt(curl.OPT_SSL_VERIFYPEER, self.sc_params.params.allow_insecure_connection) - :setopt( - curl.OPT_HTTPHEADER, - { - "content-type: application/json", - } - ) + :setopt(curl.OPT_HTTPHEADER,queue_metadata.headers) + -- set proxy address configuration if (self.sc_params.params.proxy_address ~= '') then if (self.sc_params.params.proxy_port ~= '') then @@ -236,6 +236,7 @@ function EventQueue:send_data(payload, queue_metadata) self.sc_logger:error("[EventQueue:send_data]: proxy_port parameter is not set but proxy_address is used") end end + -- set proxy user configuration if (self.sc_params.params.proxy_username ~= '') then if (self.sc_params.params.proxy_password ~= '') then @@ -244,6 +245,7 @@ function EventQueue:send_data(payload, queue_metadata) self.sc_logger:error("[EventQueue:send_data]: proxy_password parameter is not set but proxy_username is used") end end + -- adding the HTTP POST data http_request:setopt_postfields(payload) -- performing the HTTP request @@ -251,14 +253,17 @@ function EventQueue:send_data(payload, queue_metadata) -- collecting results http_response_code = http_request:getinfo(curl.INFO_RESPONSE_CODE) http_request:close() + -- Handling the return code local retval = false + if http_response_code == 200 or http_response_code == 201 then self.sc_logger:info("[EventQueue:send_data]: HTTP POST request successful: return code is " .. tostring(http_response_code)) retval = true else self.sc_logger:error("[EventQueue:send_data]: HTTP POST request FAILED, return code is " .. tostring(http_response_code) .. ". Message is: " .. tostring(http_response_body)) end + return retval end diff --git a/centreon-certified/splunk/splunk-events-apiv2.lua b/centreon-certified/splunk/splunk-events-apiv2.lua index 66ac3591..450f232d 100644 --- a/centreon-certified/splunk/splunk-events-apiv2.lua +++ b/centreon-certified/splunk/splunk-events-apiv2.lua @@ -172,7 +172,7 @@ function EventQueue:add() } self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) - .. "max is: " .. tostring(self.sc_params.params.max_buffer_size)) + .. ", max is: " .. tostring(self.sc_params.params.max_buffer_size)) end -------------------------------------------------------------------------------- @@ -194,6 +194,14 @@ end function EventQueue:send_data(payload, queue_metadata) self.sc_logger:debug("[EventQueue:send_data]: Starting to send data") + local url = self.sc_params.params.http_server_url + queue_metadata.headers = { + "content-type: application/json", + "content-length:" .. string.len(payload), + "authorization: Splunk " .. self.sc_params.params.splunk_token + } + + self.sc_logger:log_curl_command(url, queue_metadata, self.sc_params.params, payload) -- write payload in the logfile for test purpose if self.sc_params.params.send_data_test == 1 then @@ -202,11 +210,11 @@ function EventQueue:send_data(payload, queue_metadata) end self.sc_logger:info("[EventQueue:send_data]: Going to send the following json " .. tostring(payload)) - self.sc_logger:info("[EventQueue:send_data]: Splunk address is: " .. tostring(self.sc_params.params.http_server_url)) + self.sc_logger:info("[EventQueue:send_data]: Splunk address is: " .. tostring(url)) local http_response_body = "" local http_request = curl.easy() - :setopt_url(self.sc_params.params.http_server_url) + :setopt_url(url) :setopt_writefunction( function (response) http_response_body = http_response_body .. tostring(response) @@ -214,14 +222,7 @@ function EventQueue:send_data(payload, queue_metadata) ) :setopt(curl.OPT_TIMEOUT, self.sc_params.params.connection_timeout) :setopt(curl.OPT_SSL_VERIFYPEER, self.sc_params.params.allow_insecure_connection) - :setopt( - curl.OPT_HTTPHEADER, - { - "content-type: application/json", - "content-length:" .. string.len(payload), - "authorization: Splunk " .. self.sc_params.params.splunk_token, - } - ) + :setopt(curl.OPT_HTTPHEADER, queue_metadata.headers) -- set proxy address configuration if (self.sc_params.params.proxy_address ~= '') then diff --git a/centreon-certified/splunk/splunk-metrics-apiv2.lua b/centreon-certified/splunk/splunk-metrics-apiv2.lua index b4b4cb6e..2af12d26 100644 --- a/centreon-certified/splunk/splunk-metrics-apiv2.lua +++ b/centreon-certified/splunk/splunk-metrics-apiv2.lua @@ -229,7 +229,7 @@ function EventQueue:add() } self.sc_logger:info("[EventQueue:add]: queue size is now: " .. tostring(#self.sc_flush.queues[category][element].events) - .. "max is: " .. tostring(self.sc_params.params.max_buffer_size)) + .. ", max is: " .. tostring(self.sc_params.params.max_buffer_size)) end -------------------------------------------------------------------------------- @@ -250,6 +250,14 @@ end function EventQueue:send_data(payload, queue_metadata) self.sc_logger:debug("[EventQueue:send_data]: Starting to send data") + queue_metadata.headers = { + "content-type: application/json", + "content-length:" .. string.len(payload), + "authorization: Splunk " .. self.sc_params.params.splunk_token + } + local url = self.sc_params.params.http_server_url + + self.sc_logger:log_curl_command(url, queue_metadata, self.sc_params.params, payload) -- write payload in the logfile for test purpose if self.sc_params.params.send_data_test == 1 then @@ -258,11 +266,11 @@ function EventQueue:send_data(payload, queue_metadata) end self.sc_logger:info("[EventQueue:send_data]: Going to send the following json " .. tostring(payload)) - self.sc_logger:info("[EventQueue:send_data]: Splunk address is: " .. tostring(self.sc_params.params.http_server_url)) + self.sc_logger:info("[EventQueue:send_data]: Splunk address is: " .. tostring(url)) local http_response_body = "" local http_request = curl.easy() - :setopt_url(self.sc_params.params.http_server_url) + :setopt_url(url) :setopt_writefunction( function (response) http_response_body = http_response_body .. tostring(response) @@ -270,14 +278,7 @@ function EventQueue:send_data(payload, queue_metadata) ) :setopt(curl.OPT_TIMEOUT, self.sc_params.params.connection_timeout) :setopt(curl.OPT_SSL_VERIFYPEER, self.sc_params.params.allow_insecure_connection) - :setopt( - curl.OPT_HTTPHEADER, - { - "content-type: application/json", - "content-length:" .. string.len(payload), - "authorization: Splunk " .. self.sc_params.params.splunk_token, - } - ) + :setopt(curl.OPT_HTTPHEADER, queue_metadata.headers) -- set proxy address configuration if (self.sc_params.params.proxy_address ~= '') then diff --git a/modules/centreon-stream-connectors-lib/sc_common.lua b/modules/centreon-stream-connectors-lib/sc_common.lua index d06684a8..663a7544 100644 --- a/modules/centreon-stream-connectors-lib/sc_common.lua +++ b/modules/centreon-stream-connectors-lib/sc_common.lua @@ -98,7 +98,7 @@ end -- @param [opt] separator (string) the separator character that will be used to split the string -- @return false (boolean) if text param is empty or nil -- @return table (table) a table of strings -function ScCommon:split (text, separator) +function ScCommon:split(text, separator) -- return false if text is nil or empty if text == nil or text == "" then self.sc_logger:error("[sc_common:split]: could not split text because it is nil or empty") diff --git a/modules/centreon-stream-connectors-lib/sc_logger.lua b/modules/centreon-stream-connectors-lib/sc_logger.lua index f63e9623..523e6b7f 100644 --- a/modules/centreon-stream-connectors-lib/sc_logger.lua +++ b/modules/centreon-stream-connectors-lib/sc_logger.lua @@ -88,4 +88,64 @@ function ScLogger:debug(message) broker_log:info(3, message) end +--- log_curl_command: build a shell curl command based on given parameters and write it in the logfile +-- @param url (string) the url to which curl will send data +-- @param metadata (table) a table that contains headers information and http method for curl +-- @param params (table) the stream connector params table +-- @param data (string) [opt] the data that must be send by curl +function ScLogger:log_curl_command(url, metadata, params, data) + if params.log_curl_commands == 1 then + self:debug("[sc_logger:log_curl_command]: starting computing curl command") + local curl_string = "curl " + + -- handle proxy + self:debug("[sc_looger:log_curl_command]: proxy information: protocol: " .. params.proxy_protocol .. ", address: " + .. params.proxy_address .. ", port: " .. params.proxy_port .. ", user: " .. params.proxy_username .. ", password: " + .. tostring(params.proxy_password)) + local proxy_url + if params.proxy_address ~= "" then + if params.proxy_username ~= "" then + proxy_url = params.proxy_protocol .. "://" .. params.proxy_username .. ":" .. params.proxy_password + .. "@" .. params.proxy_address .. ":" .. params.proxy_port + else + proxy_url = params.proxy_protocol .. "://" .. params.proxy_address .. ":" .. params.proxy_port + end + + curl_string = curl_string .. "--proxy '" .. proxy_url .. "' " + end + + -- handle certificate verification + if params.allow_insecure_connection == 1 then + curl_string = curl_string .. "-k " + end + + -- handle http method + if metadata.method then + curl_string = curl_string .. "-X " .. metadata.method .. " " + elseif data then + curl_string = curl_string .. "-X POST " + else + curl_string = curl_string .. "-X GET " + end + + -- handle headers + if metadata.headers then + for _, header in ipairs(metadata.headers) do + curl_string = curl_string .. "-H '" .. tostring(header) .. "' " + end + end + + curl_string = curl_string .. "'" .. tostring(url) .. "' " + + -- handle curl data + if data and data ~= "" then + curl_string = curl_string .. "-d '" .. data .. "'" + end + + self:notice("[sc_logger:log_curl_command]: " .. curl_string) + else + self:debug("[sc_logger:log_curl_command]: curl command not logged because log_curl_commands param is set to: " .. params.log_curl_commands) + end +end + return sc_logger \ No newline at end of file diff --git a/modules/centreon-stream-connectors-lib/sc_params.lua b/modules/centreon-stream-connectors-lib/sc_params.lua index c4540358..6732ddd1 100644 --- a/modules/centreon-stream-connectors-lib/sc_params.lua +++ b/modules/centreon-stream-connectors-lib/sc_params.lua @@ -89,6 +89,7 @@ function sc_params.new(common, logger) proxy_port = "", proxy_username = "", proxy_password = "", + proxy_protocol = "http", -- event formatting parameters format_file = "", @@ -114,6 +115,7 @@ function sc_params.new(common, logger) -- logging parameters logfile = "", log_level = "", + log_curl_commands = 0, -- metric metric_name_regex = "", @@ -778,6 +780,7 @@ function ScParams:check_params() self.params.enable_service_status_dedup = self.common:check_boolean_number_option_syntax(self.params.enable_service_status_dedup, 0) self.params.send_data_test = self.common:check_boolean_number_option_syntax(self.params.send_data_test, 0) self.params.proxy_address = self.common:if_wrong_type(self.params.proxy_address, "string", "") + self.params.proxy_protocol = self.common:if_wrong_type(self.params.proxy_protocol, "string", "http") self.params.proxy_port = self.common:if_wrong_type(self.params.proxy_port, "number", "") self.params.proxy_username = self.common:if_wrong_type(self.params.proxy_username, "string", "") self.params.proxy_password = self.common:if_wrong_type(self.params.proxy_password, "string", "") @@ -785,6 +788,7 @@ function ScParams:check_params() self.params.allow_insecure_connection = self.common:number_to_boolean(self.common:check_boolean_number_option_syntax(self.params.allow_insecure_connection, 0)) self.params.logfile = self.common:ifnil_or_empty(self.params.logfile, "/var/log/centreon-broker/stream-connector.log") self.params.log_level = self.common:ifnil_or_empty(self.params.log_level, 1) + self.params.log_curl_commands = self.common:check_boolean_number_option_syntax(self.params.log_curl_commands, 0) self.params.use_long_output = self.common:check_boolean_number_option_syntax(self.params.use_longoutput, 1) self.params.remove_line_break_in_output = self.common:check_boolean_number_option_syntax(self.params.remove_line_break_in_output, 1) self.params.output_line_break_replacement_character = self.common:if_wrong_type(self.params.output_line_break_replacement_character, "string", " ") diff --git a/modules/docs/README.md b/modules/docs/README.md index 41ea3946..5cf1fb96 100644 --- a/modules/docs/README.md +++ b/modules/docs/README.md @@ -50,13 +50,14 @@ ## sc_logger methods -| Method name | Method description | Link | -| ----------- | ------------------------------------------- | -------------------------------------------- | -| error | write an error message in the log file | [Documentation](sc_logger.md#error-method) | -| warning | write a warning message in the log file | [Documentation](sc_logger.md#warning-method) | -| notice | write a notice/info message in the log file | [Documentation](sc_logger.md#notice-method) | -| info | write an info message in the log file | [Documentation](sc_logger.md#info-method) | -| debug | write a debug message in the log file | [Documentation](sc_logger.md#debug-method) | +| Method name | Method description | Link | +| ---------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| error | write an error message in the log file | [Documentation](sc_logger.md#error-method) | +| warning | write a warning message in the log file | [Documentation](sc_logger.md#warning-method) | +| notice | write a notice/info message in the log file | [Documentation](sc_logger.md#notice-method) | +| info | write an info message in the log file | [Documentation](sc_logger.md#info-method) | +| debug | write a debug message in the log file | [Documentation](sc_logger.md#debug-method) | +| log_curl_command | creates and log a curl command using given parameters | [Documentation](sc_logger.md#log_curl_command-method) | ## sc_broker methods diff --git a/modules/docs/sc_logger.md b/modules/docs/sc_logger.md index 8b7044d8..620bf721 100644 --- a/modules/docs/sc_logger.md +++ b/modules/docs/sc_logger.md @@ -1,6 +1,6 @@ # Documentation of the sc_logger module -- [Documentation of the sc_logger module](#documentation-of-the-sc_logger-module) +- [Documentation of the sc\_logger module](#documentation-of-the-sc_logger-module) - [Introduction](#introduction) - [Best practices](#best-practices) - [Module initialization](#module-initialization) @@ -21,6 +21,9 @@ - [notice method](#notice-method) - [notice: parameters](#notice-parameters) - [notice: example](#notice-example) + - [log\_curl\_command method](#log_curl_command-method) + - [log\_curl\_command: parameters](#log_curl_command-parameters) + - [log\_curl\_command: example](#log_curl_command-example) ## Introduction @@ -158,3 +161,44 @@ The **notice** method will print a notice message in the logfile if **severity i -- call notice method test_logger:notice("[module_name:method_name]: This is a notice message.") ``` + +## log_curl_command method + +The **log_curl_command** method will print a notice message containing a ready to use shell curl command in the logfile. + +See [notice method](#notice-method) for more information about notice logs + +### log_curl_command: parameters + +| parameter | type | optional | default value | +| ---------------------------------------------------------------- | ------ | -------- | ------------- | +| the url for the curl command | string | no | | +| metadata containing headers information and http method for curl | table | no | | +| stream connector parameters | table | no | | +| data that must be sent | string | yes | | + +### log_curl_command: example + +```lua +local url = "https://127.0.0.1/my_endpoint" +local metadata = { + method = "POST", + headers = { + "content-type: application/json", + "token: mont-de-marsan" + } +} + +local params = { + allow_insecure_connection = 1 +} + +local data = '{"host":"test-host","state":"down"}' + +-- call notice method +test_logger:log_curl_command(url, metadata, params, data) +--> this will print the following log +--[[ + Thu Mar 17 10:44:53 2022: INFO: [sc_logger:log_curl_command]: curl -k -X POST -H "content-type: application/json" -H "token: mont-de-marsan" "https://127.0.0.1/my_endpoint" -d '{"host":"test-host","state":"down"}' +]]-- +``` diff --git a/modules/docs/sc_param.md b/modules/docs/sc_param.md index 1c45cdfc..878bdeed 100644 --- a/modules/docs/sc_param.md +++ b/modules/docs/sc_param.md @@ -72,6 +72,7 @@ The sc_param module provides methods to help you handle parameters for your stre | proxy_port | number | | port of the proxy | | | | proxy_username | string | | user for the proxy | | | | proxy_password | string | | pasword of the proxy user | | | +| proxy_protocol | string | http | protocol to use with the proxy (can be http or https) | | | | connection_timeout | number | 60 | time to wait in second when opening connection | | | | allow_insecure_connection | number | 0 | check the certificate validity of the peer host (0 = needs to be a valid certificate), use 1 if you are using self signed certificates | | | | use_long_output | number | 1 | use the long output when sending an event (set to 0 to send the short output) | service_status(neb), host_status(neb) | | @@ -82,6 +83,7 @@ The sc_param module provides methods to help you handle parameters for your stre | metric_replacement_character | string | "_" | the character that will be used to replace invalid characters in the metric name | service_status(neb), host_status(neb) | | | logfile | string | **check the stream connector documentation** | the logfile that will be used for the stream connector | any | | | log_level | number | 1 | the verbosity level for the logs. 1 = error + notice, 2 = error + warning + notice, 3 = error + warning + notice + debug (you should avoir using level 3) | any | | +| log_curl_commands | number | 0 | log ready to use curl commands when enabled (0 = disabled, 1 = enabled) | any | | ## Module initialization diff --git a/modules/specs/3.6.x/centreon-stream-connectors-lib-3.6.0-1.rockspec b/modules/specs/3.6.x/centreon-stream-connectors-lib-3.6.0-1.rockspec new file mode 100644 index 00000000..9bd517c9 --- /dev/null +++ b/modules/specs/3.6.x/centreon-stream-connectors-lib-3.6.0-1.rockspec @@ -0,0 +1,39 @@ +package = "centreon-stream-connectors-lib" +version = "3.6.0-1" +source = { + url = "git+https://github.com/centreon/centreon-stream-connector-scripts", + tag = "3.6.0-1" +} +description = { + summary = "Centreon stream connectors lua modules", + detailed = [[ + Those modules provides helpful methods to create + stream connectors for Centreon + ]], + license = "" +} +dependencies = { + "lua >= 5.1, < 5.4", + "luasocket >= 3.0rc1-2" +} +build = { + type = "builtin", + modules = { + ["centreon-stream-connectors-lib.sc_broker"] = "modules/centreon-stream-connectors-lib/sc_broker.lua", + ["centreon-stream-connectors-lib.sc_common"] = "modules/centreon-stream-connectors-lib/sc_common.lua", + ["centreon-stream-connectors-lib.sc_event"] = "modules/centreon-stream-connectors-lib/sc_event.lua", + ["centreon-stream-connectors-lib.sc_logger"] = "modules/centreon-stream-connectors-lib/sc_logger.lua", + ["centreon-stream-connectors-lib.sc_params"] = "modules/centreon-stream-connectors-lib/sc_params.lua", + ["centreon-stream-connectors-lib.sc_test"] = "modules/centreon-stream-connectors-lib/sc_test.lua", + ["centreon-stream-connectors-lib.sc_macros"] = "modules/centreon-stream-connectors-lib/sc_macros.lua", + ["centreon-stream-connectors-lib.sc_flush"] = "modules/centreon-stream-connectors-lib/sc_flush.lua", + ["centreon-stream-connectors-lib.sc_metrics"] = "modules/centreon-stream-connectors-lib/sc_metrics.lua", + ["centreon-stream-connectors-lib.rdkafka.config"] = "modules/centreon-stream-connectors-lib/rdkafka/config.lua", + ["centreon-stream-connectors-lib.rdkafka.librdkafka"] = "modules/centreon-stream-connectors-lib/rdkafka/librdkafka.lua", + ["centreon-stream-connectors-lib.rdkafka.producer"] = "modules/centreon-stream-connectors-lib/rdkafka/producer.lua", + ["centreon-stream-connectors-lib.rdkafka.topic_config"] = "modules/centreon-stream-connectors-lib/rdkafka/topic_config.lua", + ["centreon-stream-connectors-lib.rdkafka.topic"] = "modules/centreon-stream-connectors-lib/rdkafka/topic.lua", + ["centreon-stream-connectors-lib.google.auth.oauth"] = "modules/centreon-stream-connectors-lib/google/auth/oauth.lua", + ["centreon-stream-connectors-lib.google.bigquery.bigquery"] = "modules/centreon-stream-connectors-lib/google/bigquery/bigquery.lua" + } +}