logstash-plugins / logstash-output-icinga Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Hi,
i´m having trouble with the child_options for scheduled downtimes.
workaround:
adding 'all_services' => {} in icinga.rb (line 275) after child_options fixed my issue, 'child_options' breaks with standard error.
i guess it´s an api problem but maybe you could an all_services to icinga.rb, as fallback key
Hi,
im trying to modify a check-result with logstash.
I have a Host with filebeat, that is sending new logfile entries to Logstash on another host.
That works perfectly fine.
Now I want to filter the incoming message from filebeat and output it to icinga.
But I get the following message when Logstash tries to send the data to icinga:
[WARN ][logstash.outputs.icinga ] Request failed {:host=>"localhost", :port=>5665, :path=>"/v1/actions/process-check-result?service=linArpalertVM%21testService", :body=>"{\"exit_status\":\"1\",\"plugin_output\":\"Placeholder\"}", :error=>#<IOError: Broken pipe>}
my Icinga api_users.conf config is:
object ApiUser "root" {
password = "password"
//client_cn = ""
permissions = [ "*" ]
}
object ApiUser "icinga" {
password = "icinga"
//client_cn = ""
permissions = [ "*" ]
}
apply Service "testService" {
import "generic-service"
check_command = "dummy"
assign where host.address
}
and my Logstash config looks like the following:
input {
beats {
port => 5044
type => "logs"
}
}
filter {
if "new_mac" in [message] {
mutate {
replace => { "exit_status" => "2" }
}
}
}
output {
icinga {
host => 'localhost'
user => 'icinga'
password => 'icinga'
ssl_verify => false
action => 'process-check-result'
action_config => {
exit_status => "%{exit_status}"
plugin_output => "Placeholder"
}
icinga_host => "linArpalertVM"
icinga_service => "testService"
}
stdout { }
}
The command works fine when I enter it manually with curl:
curl -k -u icinga:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/process-check-result?service=linArpalertVM%21testService' -d "{\"exit_status\":\"1\",\"plugin_output\":\"Placeholder\"}"
If you need any more file content let me now...
I searched almost a week now in the internet but nothing helped...
Moved from Icinga/logstash-output-icinga#11
Hi,
We got the output working with Logstash 6.4 but not with 6.7.1. Could you please check if there's some incompatibility between the output und Logstash 6.7.1?
Here are the error messages:
[2019-04-10T18:12:23,808][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Reload/pipeline_id:oracle, :exception=>"SyntaxError", :message=>"/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-icinga-1.2.1/lib/logstash/outputs/icinga.rb:383: Invalid next", :backtrace=>["org/jruby/RubyClass.java:233:in `allocate'", "org/logstash/config/ir/compiler/OutputStrategyExt.java:232:in `initialize'", "org/logstash/config/ir/compiler/OutputDelegatorExt.java:48:in `initialize'", "org/logstash/config/ir/compiler/OutputDelegatorExt.java:30:in `initialize'", "org/logstash/plugins/PluginFactoryExt.java:239:in `plugin'", "org/logstash/plugins/PluginFactoryExt.java:184:in `plugin'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:71:in `plugin'", "(eval):147:in `initialize'", "org/jruby/RubyKernel.java:1047:in `eval'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:49:in `initialize'", "/usr/share/logstash/logstash-co
re/lib/logstash/pipeline_action/reload.rb:43:in `block in execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:96:in `block in exclusive'", "org/jruby/ext/thread/Mutex.java:165:in `synchronize'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:96:in `exclusive'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/reload.rb:39:in `execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:334:in `block in converge_state'"]}
I've encountered a problem sending check results to services when the service contains a "space" in its name.
The service should receive the passive check results
Error is returned:
Response: {:response_code=>"404", :response_body=>"{"error":404.0,"status":"No objects found."}"}
As a quick fix, I managed to get the check result processed by changing "../lib/logstash/outputs/icinga.rb" , around line 315.
Change
@uri.query = URI.encode_www_form({:service => "#{icinga_host}!#{icinga_service}"})
else
@uri.query = URI.encode_www_form({:host => icinga_host})
to
@uri.query = URI.encode_www_form({:service => "#{icinga_host}!#{icinga_service}"}).gsub('+','%20')
else
@uri.query = URI.encode_www_form({:host => icinga_host}).gsub('+','%20')
(uses %20 url encode for space instead of plus sign)
bin/logstash-plugin list '*icinga*'
): 1.2.2bin/logstash -V
): 6.8.0icinga2 --version
): 2.10.5ruby -V
):Is there anything I can do to make this plugin be published on the official summary website for logstash plugins?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.