Skip to content

Commit

Permalink
Merge pull request #111 from redBorder/bug/#16718_sflow_enrichment_al…
Browse files Browse the repository at this point in the history
…l_flow_sensors

pass all flow sensors to sflow pipeline
  • Loading branch information
JPeraltaNic authored Apr 2, 2024
2 parents bb34482 + 6763ebe commit a3fc2d7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
19 changes: 19 additions & 0 deletions resources/libraries/get_all_flow_sensors_info.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module Rb_manager
module Helpers
def get_all_flow_sensors_info()
sensors_info = {}
sensor_types = ["flow-sensor"]

sensor_types.each do |s_type|
sensors = search(:node, "role:#{s_type}").sort

sensors_info[s_type] = []
sensors.each do |s|
sensors_info[s_type] << s
end
end
sensors_info
end
end
end

2 changes: 1 addition & 1 deletion resources/recipes/configure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@

logstash_config "Configure logstash" do
cdomain node["redborder"]["cdomain"]
flow_nodes node["redborder"]["sensors_info_all"]["flow-sensor"]
flow_nodes node["redborder"]["all_flow_sensors_info"]["flow-sensor"]
namespaces node["redborder"]["namespaces"]
vault_nodes node["redborder"]["sensors_info_all"]["vault-sensor"]
scanner_nodes node["redborder"]["sensors_info_all"]["scanner-sensor"]
Expand Down
3 changes: 3 additions & 0 deletions resources/recipes/prepare_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
#get sensors info full info
node.default["redborder"]["sensors_info_all"] = get_sensors_all_info()

#get sensors info of all flow sensors
node.default["redborder"]["all_flow_sensors_info"] = get_all_flow_sensors_info()

#get namespaces
node.default["redborder"]["namespaces"] = get_namespaces

Expand Down

0 comments on commit a3fc2d7

Please sign in to comment.