Skip to content

Commit

Permalink
Delete logstash monitors
Browse files Browse the repository at this point in the history
  • Loading branch information
malvads committed Dec 12, 2023
1 parent 9c6ab30 commit a87100c
Showing 1 changed file with 1 addition and 46 deletions.
47 changes: 1 addition & 46 deletions resources/libraries/update_service_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,51 +27,6 @@ def update_service_config(resource)
# puts "Error accessing to redborder service list, skipping hadoop-resourcemanager monitorization"
#end

# Logstash
pipelines = ["bulkstats-pipeline", "location-pipeline", "meraki-pipeline", "mobility-pipeline", "monitor-pipeline", "netflow-pipeline", "nmsp-pipeline", "radius-pipeline", "rbwindow-pipeline", "redfish-pipeline", "scanner-pipeline", "sflow-pipeline", "vault-pipeline"]
begin
if node.default["redborder"]["services"]["logstash"] == true
sensor= {
"timeout"=>5,
"sensor_name"=> resource["hostname"],
"sensor_ip"=> resource["hostip"],
"community" => resource["community"],
"snmp_version"=> "2c",
"monitors"=>
[
{"name"=> "logstash_cpu", "system"=> "/usr/lib/redborder/bin/rb_get_logstash_stats.sh -c 2>/dev/null", "unit"=> "%"},
{"name"=> "logstash_load_1", "system"=> "/usr/lib/redborder/bin/rb_get_logstash_stats.sh -l 2>/dev/null", "unit"=> "%"},
{"name"=> "logstash_load_5", "system"=> "/usr/lib/redborder/bin/rb_get_logstash_stats.sh -m 2>/dev/null", "unit"=> "%"},
{"name"=> "logstash_load_15", "system"=> "/usr/lib/redborder/bin/rb_get_logstash_stats.sh -n 2>/dev/null", "unit"=> "%"},
{"name"=> "logstash_heap", "system"=> "/usr/lib/redborder/bin/rb_get_logstash_stats.sh -u 2>/dev/null", "unit"=> "%"},
{"name"=> "logstash_events", "system"=> "/usr/lib/redborder/bin/rb_get_logstash_stats.sh -e 2>/dev/null", "unit"=> "event", "integer"=> 1},
{"name"=> "logstash_memory", "system"=> "/usr/lib/redborder/bin/rb_get_logstash_stats.sh -v 2>/dev/null", "unit"=> "bytes", "integer"=> 1}
]
}
node.default[:redborder][:monitor][:count] = node.default[:redborder][:monitor][:count] + 7
node.default["redborder"]["monitor"]["config"][:sensors].push(sensor)
pipelines.each do |pipeline|
sensor_pipeline= {
"timeout"=>5,
"sensor_name"=> "#{resource["hostname"]}-#{pipeline}",
"sensor_ip"=> resource["hostip"],
"community" => resource["community"],
"snmp_version"=> "2c",
"monitors"=>
[
{"name"=> "logstash_events_per_pipeline", "system"=> "/usr/lib/redborder/bin/rb_get_logstash_stats.sh -e "+pipeline+" 2>/dev/null", "unit"=> "event", "integer"=> 1},
{"name"=> "logstash_events_count_queue", "system"=> "/usr/lib/redborder/bin/rb_get_logstash_stats.sh -w "+pipeline+" 2>/dev/null", "unit"=> "event", "integer"=> 1},
{"name"=> "logstash_events_count_queue_bytes", "system"=> "/usr/lib/redborder/bin/rb_get_logstash_stats.sh -z "+pipeline+" 2>/dev/null", "unit"=> "bytes", "integer"=> 1}
]
}
node.default[:redborder][:monitor][:count] = node.default[:redborder][:monitor][:count] + 3
node.default["redborder"]["monitor"]["config"][:sensors].push(sensor_pipeline)
end
end
rescue
puts "Error accessing to redborder service list, skipping logstash monitorization"
end

# Druid-overlord
begin
if node.default["redborder"]["services"]["druid-overlord"] == true
Expand Down Expand Up @@ -118,4 +73,4 @@ def update_service_config(resource)
end

end
end
end

0 comments on commit a87100c

Please sign in to comment.