Я хочу отслеживать ActiveMQ Artemis из JMX с помощью logstash и отправлять данные в Elastic.
Для Artemis 2.13.0,
management.xml
:
- закомментировал тег
<authorisation>
- добавил
<connector connector-port="1099">
artemis.profile.cmd
:
- добавлен
-Djava.rmi.server.hostname=localhost
под JAVA_ARGS, поскольку Jconsole / Logstash не смог обнаружить RMI JMX
Установите ELK на моем локальном компьютере с Windows 10 local-jmx.config
input {
jmx {
path => "/path/to/config/" //This has a file jmxquery.config
polling_frequency => 60
nb_thread => 5
type => "jmx"
}
}
output {
elasticsearch {
hosts => [ "localhost:9200" ]
}
}
jmxquery.config
:
{
"host" : "127.0.0.1",
"port" : 1099,
"url": "service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi",
"username" : "guest",
"password" : "guest",
"alias" : "Version",
"queries" : [
{
"object_name" : "org.apache.activemq.artemis:broker=0.0.0.0,attribute=Version" ,
"object_alias" : "version"
}
]
}
Я могу использовать localhost:1099
с JConsole
Однако, когда я запускаю logstash, JMX может подключиться, но появляется сообщение «Нет объекта jmx».
[2020-07-29T13:57:40,030][DEBUG][logstash.inputs.jmx ] Wait until the queue conf is empty
[2020-07-29T13:57:40,030][DEBUG][logstash.inputs.jmx ] Retrieve config {"host"=>"127.0.0.1", "port"=>1099, "url"=>"service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi", "username"=>"guest", "password"=>"guest", "alias"=>"ActiveMQ", "queries"=>[{"object_name"=>"org.apache.activemq.artemis:broker=0.0.0.0,attribute=Version", "object_alias"=>"version"}]} from queue conf
[2020-07-29T13:57:40,031][DEBUG][logstash.inputs.jmx ] Check if jmx connection need a user/password
[2020-07-29T13:57:40,031][DEBUG][logstash.inputs.jmx ] Wait 60s (60-0(seconds wait until queue conf empty)) before to launch again a new jmx metrics collection
[2020-07-29T13:57:40,031][DEBUG][logstash.inputs.jmx ] Connect to 127.0.0.1:1099 with user guest
[2020-07-29T13:57:40,044][DEBUG][logstash.inputs.jmx ] Set base_metric_path to alias: Version
[2020-07-29T13:57:40,044][DEBUG][logstash.inputs.jmx ] Treat queries [{"object_name"=>"org.apache.activemq.artemis:broker=0.0.0.0,attribute=Version", "object_alias"=>"version"}]
[2020-07-29T13:57:40,044][DEBUG][logstash.inputs.jmx ] Find all objects name org.apache.activemq.artemis:broker=0.0.0.0,attribute=Version
[2020-07-29T13:57:40,045][WARN ][logstash.inputs.jmx ] No jmx object found for org.apache.activemq.artemis:broker=0.0.0.0,attribute=Version
Я ожидал вернуть сюда номер версии. Имя объекта или конфигурация неверны для logstash?