Logstash icinga输出IOError:管道损坏

时间:2018-12-19 09:51:16

标签: logstash logstash-configuration icinga2

我正在尝试使用Logstash icinga输出插件设置一个check_command exit_status和plugin_ouput。

但是每次出现以下错误:

[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>}

我有一个带文件拍的主机,它将新的日志文件条目发送到另一台主机上的Logstash。 效果很好。

现在我想从filebeat过滤传入的消息并将其输出到icinga。

我的Icinga api_users.conf配置为:

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
}

和我的Logstash配置如下所示:

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 { }
}

当我使用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\"}"

我找不到任何有助于解决此问题的帖子或纪录片。

我希望任何人都能提供帮助:)

0 个答案:

没有答案