Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions centreon-certified/canopsis/canopsis2x-events-apiv2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ end
-- Classe event_queue
--------------------------------------------------------------------------------

local EventQueue = {}
EventQueue = {}
EventQueue.__index = EventQueue

--------------------------------------------------------------------------------
Expand All @@ -49,13 +49,13 @@ function EventQueue.new(params)
self.fail = false

-- set up log configuration
local logfile = params.logfile or "/var/log/centreon-broker/canopsis4-events.log"
local log_level = params.log_level or 1
params.logfile = params.logfile or "/var/log/centreon-broker/canopsis4-events.log"
params.log_level = params.log_level or 1
params.logger_backend = params.logger_backend or "broker"

-- initiate mandatory objects
self.sc_logger = sc_logger.new(logfile, log_level)
self.sc_logger = sc_logger.new(params)
self.sc_common = sc_common.new(self.sc_logger)
self.sc_broker = sc_broker.new(self.sc_logger)
self.sc_params = sc_params.new(self.sc_common, self.sc_logger)
self.bbdo_version = self.sc_common:get_bbdo_version()

Expand Down Expand Up @@ -116,6 +116,7 @@ function EventQueue.new(params)
self.sc_params:build_accepted_elements_info()
self.sc_flush = sc_flush.new(self.sc_params.params, self.sc_logger)
self.sc_storage = sc_storage.new(self.sc_common, self.sc_logger, self.sc_params.params)
self.sc_broker = sc_broker.new(self.sc_params.params, self.sc_logger)

local categories = self.sc_params.params.bbdo.categories
local elements = self.sc_params.params.bbdo.elements
Expand Down Expand Up @@ -626,7 +627,9 @@ end
-- Required functions for Broker StreamConnector
--------------------------------------------------------------------------------

local queue
if not queue then
local queue
end

-- Fonction init()
function init(conf)
Expand Down
15 changes: 9 additions & 6 deletions centreon-certified/clickhouse/clickhouse-metrics-apiv2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ local sc_storage = require("centreon-stream-connectors-lib.sc_storage")
-- Classe event_queue
--------------------------------------------------------------------------------

local EventQueue = {}
EventQueue = {}
EventQueue.__index = EventQueue

--------------------------------------------------------------------------------
Expand All @@ -45,13 +45,13 @@ function EventQueue.new(params)
self.fail = false

-- set up log configuration
local logfile = params.logfile or "/var/log/centreon-broker/clickhouse-metrics.log"
local log_level = params.log_level or 1
params.logfile = params.logfile or "/var/log/centreon-broker/clickhouse-metrics.log"
params.log_level = params.log_level or 1
params.logger_backend = params.logger_backend or "broker"

-- initiate mandatory objects
self.sc_logger = sc_logger.new(logfile, log_level)
self.sc_logger = sc_logger.new(params)
self.sc_common = sc_common.new(self.sc_logger)
self.sc_broker = sc_broker.new(self.sc_logger)
self.sc_params = sc_params.new(self.sc_common, self.sc_logger)

-- checking mandatory parameters and setting a fail flag
Expand Down Expand Up @@ -88,6 +88,7 @@ function EventQueue.new(params)
self.sc_params:build_accepted_elements_info()
self.sc_flush = sc_flush.new(self.sc_params.params, self.sc_logger)
self.sc_storage = sc_storage.new(self.sc_common, self.sc_logger, self.sc_params.params)
self.sc_broker = sc_broker.new(self.sc_params.params, self.sc_logger)

local categories = self.sc_params.params.bbdo.categories
local elements = self.sc_params.params.bbdo.elements
Expand Down Expand Up @@ -426,7 +427,9 @@ end
-- Required functions for Broker StreamConnector
--------------------------------------------------------------------------------

local queue
if not queue then
local queue
end

-- Fonction init()
function init(conf)
Expand Down
15 changes: 9 additions & 6 deletions centreon-certified/datadog/datadog-events-apiv2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local sc_storage = require("centreon-stream-connectors-lib.sc_storage")
-- Classe event_queue
--------------------------------------------------------------------------------

local EventQueue = {}
EventQueue = {}
EventQueue.__index = EventQueue

--------------------------------------------------------------------------------
Expand All @@ -42,13 +42,13 @@ function EventQueue.new(params)
self.fail = false

-- set up log configuration
local logfile = params.logfile or "/var/log/centreon-broker/datadog-events.log"
local log_level = params.log_level or 1
params.logfile = params.logfile or "/var/log/centreon-broker/datadog-events.log"
params.log_level = params.log_level or 1
params.logger_backend = params.logger_backend or "broker"

-- initiate mandatory objects
self.sc_logger = sc_logger.new(logfile, log_level)
self.sc_logger = sc_logger.new(params)
self.sc_common = sc_common.new(self.sc_logger)
self.sc_broker = sc_broker.new(self.sc_logger)
self.sc_params = sc_params.new(self.sc_common, self.sc_logger)

-- checking mandatory parameters and setting a fail flag
Expand Down Expand Up @@ -81,6 +81,7 @@ function EventQueue.new(params)
self.sc_params:build_accepted_elements_info()
self.sc_storage = sc_storage.new(self.sc_common, self.sc_logger, self.sc_params.params)
self.sc_flush = sc_flush.new(self.sc_params.params, self.sc_logger)
self.sc_broker = sc_broker.new(self.sc_params.params, self.sc_logger)

local categories = self.sc_params.params.bbdo.categories
local elements = self.sc_params.params.bbdo.elements
Expand Down Expand Up @@ -292,7 +293,9 @@ end
-- Required functions for Broker StreamConnector
--------------------------------------------------------------------------------

local queue
if not queue then
local queue
end

-- Fonction init()
function init(conf)
Expand Down
15 changes: 9 additions & 6 deletions centreon-certified/datadog/datadog-metrics-apiv2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ local sc_storage = require("centreon-stream-connectors-lib.sc_storage")
-- Classe event_queue
--------------------------------------------------------------------------------

local EventQueue = {}
EventQueue = {}
EventQueue.__index = EventQueue

--------------------------------------------------------------------------------
Expand All @@ -43,13 +43,13 @@ function EventQueue.new(params)
self.fail = false

-- set up log configuration
local logfile = params.logfile or "/var/log/centreon-broker/datadog-metrics.log"
local log_level = params.log_level or 3
params.logfile = params.logfile or "/var/log/centreon-broker/datadog-metrics.log"
params.log_level = params.log_level or 3
params.logger_backend = params.logger_backend or "broker"

-- initiate mandatory objects
self.sc_logger = sc_logger.new(logfile, log_level)
self.sc_logger = sc_logger.new(params)
self.sc_common = sc_common.new(self.sc_logger)
self.sc_broker = sc_broker.new(self.sc_logger)
self.sc_params = sc_params.new(self.sc_common, self.sc_logger)

-- checking mandatory parameters and setting a fail flag
Expand Down Expand Up @@ -86,6 +86,7 @@ function EventQueue.new(params)
self.sc_params:build_accepted_elements_info()
self.sc_flush = sc_flush.new(self.sc_params.params, self.sc_logger)
self.sc_storage = sc_storage.new(self.sc_common, self.sc_logger, self.sc_params.params)
self.sc_broker = sc_broker.new(self.sc_params.params, self.sc_logger)

local categories = self.sc_params.params.bbdo.categories
local elements = self.sc_params.params.bbdo.elements
Expand Down Expand Up @@ -340,7 +341,9 @@ end
-- Required functions for Broker StreamConnector
--------------------------------------------------------------------------------

local queue
if not queue then
local queue
end

-- Fonction init()
function init(conf)
Expand Down
15 changes: 9 additions & 6 deletions centreon-certified/elasticsearch/elastic-events-apiv2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ local sc_storage = require("centreon-stream-connectors-lib.sc_storage")
-- event_queue class
--------------------------------------------------------------------------------

local EventQueue = {}
EventQueue = {}
EventQueue.__index = EventQueue

--------------------------------------------------------------------------------
Expand All @@ -44,13 +44,13 @@ function EventQueue.new(params)
self.fail = false

-- set up log configuration
local logfile = params.logfile or "/var/log/centreon-broker/elastic-events-apiv2.log"
local log_level = params.log_level or 1
params.logfile = params.logfile or "/var/log/centreon-broker/elastic-events-apiv2.log"
params.log_level = params.log_level or 1
params.logger_backend = params.logger_backend or "broker"

-- initiate mandatory objects
self.sc_logger = sc_logger.new(logfile, log_level)
self.sc_logger = sc_logger.new(params)
self.sc_common = sc_common.new(self.sc_logger)
self.sc_broker = sc_broker.new(self.sc_logger)
self.sc_params = sc_params.new(self.sc_common, self.sc_logger)

-- checking mandatory parameters and setting a fail flag
Expand All @@ -77,6 +77,7 @@ function EventQueue.new(params)
self.sc_params:build_accepted_elements_info()
self.sc_flush = sc_flush.new(self.sc_params.params, self.sc_logger)
self.sc_storage = sc_storage.new(self.sc_common, self.sc_logger, self.sc_params.params)
self.sc_broker = sc_broker.new(self.sc_params.params, self.sc_logger)

local categories = self.sc_params.params.bbdo.categories
local elements = self.sc_params.params.bbdo.elements
Expand Down Expand Up @@ -281,7 +282,9 @@ function EventQueue:format_accepted_event()
-- Required functions for Broker StreamConnector
--------------------------------------------------------------------------------

local queue
if not queue then
local queue
end

-- Fonction init()
function init(conf)
Expand Down
15 changes: 9 additions & 6 deletions centreon-certified/elasticsearch/elastic-metrics-apiv2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ local sc_storage = require("centreon-stream-connectors-lib.sc_storage")
-- Classe event_queue
--------------------------------------------------------------------------------

local EventQueue = {}
EventQueue = {}
EventQueue.__index = EventQueue

--------------------------------------------------------------------------------
Expand All @@ -48,13 +48,13 @@ function EventQueue.new(params)
self.fail_message_counter = 0

-- set up log configuration
local logfile = params.logfile or "/var/log/centreon-broker/elastic-metrics.log"
local log_level = params.log_level or 1
params.logfile = params.logfile or "/var/log/centreon-broker/elastic-metrics.log"
params.log_level = params.log_level or 1
params.logger_backend = params.logger_backend or "broker"

-- initiate mandatory objects
self.sc_logger = sc_logger.new(logfile, log_level)
self.sc_logger = sc_logger.new(params)
self.sc_common = sc_common.new(self.sc_logger)
self.sc_broker = sc_broker.new(self.sc_logger)
self.sc_params = sc_params.new(self.sc_common, self.sc_logger)

-- checking mandatory parameters and setting a fail flag
Expand Down Expand Up @@ -105,6 +105,7 @@ function EventQueue.new(params)
self.sc_params:build_accepted_elements_info()
self.sc_flush = sc_flush.new(self.sc_params.params, self.sc_logger)
self.sc_storage = sc_storage.new(self.sc_common, self.sc_logger, self.sc_params.params)
self.sc_broker = sc_broker.new(self.sc_params.params, self.sc_logger)

local categories = self.sc_params.params.bbdo.categories
local elements = self.sc_params.params.bbdo.elements
Expand Down Expand Up @@ -706,7 +707,9 @@ end
-- Required functions for Broker StreamConnector
--------------------------------------------------------------------------------

local queue
if not queue then
local queue
end

-- Fonction init()
function init(conf)
Expand Down
15 changes: 9 additions & 6 deletions centreon-certified/google/bigquery-events-apiv2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ local sc_oauth = require("centreon-stream-connectors-lib.google.auth.oauth")
local sc_bq = require("centreon-stream-connectors-lib.google.bigquery.bigquery")
local curl = require("cURL")

local EventQueue = {}
EventQueue = {}

function EventQueue.new(params)
local self = {}
Expand All @@ -27,13 +27,13 @@ function EventQueue.new(params)
self.fail = false

-- set up log configuration
local logfile = params.logfile or "/var/log/centreon-broker/stream-connector.log"
local log_level = params.log_level or 2
params.logfile = params.logfile or "/var/log/centreon-broker/stream-connector.log"
params.log_level = params.log_level or 2
params.logger_backend = params.logger_backend or "broker"

-- initiate mandatory objects
self.sc_logger = sc_logger.new(logfile, log_level)
self.sc_logger = sc_logger.new(params)
self.sc_common = sc_common.new(self.sc_logger)
self.sc_broker = sc_broker.new(self.sc_logger)
self.sc_params = sc_params.new(self.sc_common, self.sc_logger)

-- checking mandatory parameters and setting a fail flag
Expand Down Expand Up @@ -109,6 +109,7 @@ function EventQueue.new(params)
self.sc_bq = sc_bq.new(self.sc_params.params, self.sc_logger)
self.sc_bq:get_tables_schema()
self.sc_storage = sc_storage.new(self.sc_common, self.sc_logger, self.sc_params.params)
self.sc_broker = sc_broker.new(self.sc_params.params, self.sc_logger)

-- return EventQueue object
setmetatable(self, { __index = EventQueue })
Expand Down Expand Up @@ -380,7 +381,9 @@ function EventQueue:call (data, table_name)
return true
end

local queue
if not queue then
local queue
end

function init(params)
queue = EventQueue.new(params)
Expand Down
15 changes: 9 additions & 6 deletions centreon-certified/influxdb/influxdb2-metrics-apiv2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ local sc_storage = require("centreon-stream-connectors-lib.sc_storage")
-- Classe event_queue
--------------------------------------------------------------------------------

local EventQueue = {}
EventQueue = {}
EventQueue.__index = EventQueue

--------------------------------------------------------------------------------
Expand All @@ -46,13 +46,13 @@ function EventQueue.new(params)
self.fail = false

-- set up log configuration
local logfile = params.logfile or "/var/log/centreon-broker/infuxdb2-metrics.log"
local log_level = params.log_level or 1
params.logfile = params.logfile or "/var/log/centreon-broker/infuxdb2-metrics.log"
params.log_level = params.log_level or 1
params.logger_backend = params.logger_backend or "broker"

-- initiate mandatory objects
self.sc_logger = sc_logger.new(logfile, log_level)
self.sc_logger = sc_logger.new(params)
self.sc_common = sc_common.new(self.sc_logger)
self.sc_broker = sc_broker.new(self.sc_logger)
self.sc_params = sc_params.new(self.sc_common, self.sc_logger)

-- checking mandatory parameters and setting a fail flag
Expand Down Expand Up @@ -92,6 +92,7 @@ function EventQueue.new(params)
self.sc_params:build_accepted_elements_info()
self.sc_flush = sc_flush.new(self.sc_params.params, self.sc_logger)
self.sc_storage = sc_storage.new(self.sc_common, self.sc_logger, self.sc_params.params)
self.sc_broker = sc_broker.new(self.sc_params.params, self.sc_logger)

local categories = self.sc_params.params.bbdo.categories
local elements = self.sc_params.params.bbdo.elements
Expand Down Expand Up @@ -379,7 +380,9 @@ end
-- Required functions for Broker StreamConnector
--------------------------------------------------------------------------------

local queue
if not queue then
local queue
end

-- Fonction init()
function init(conf)
Expand Down
Loading
Loading