Metricbeats


(Ninoslav) #1

Hi,

I have installed metricbeats on server, and configured index, so i have output in kibana...
But what ever i do to set up dashboard in kibana fails.

If I try to do:
setup.dashboards.enabled: true in metricbeat.yml, my service wont start, it i comment that line out or set it to false, i can start service w/o problems, and get the output into kibana.

If i try to run command like:

metricbeat setup --template -E 'output.elasticsearch.hosts=[ "myip:9200"]'

it creates an index, and i can access it.
But when i try

metricbeat setup --dashboards -E 'output.elasticsearch.hosts=["myip:9200"]'

i get error status:

"403 Forbidden. Response: {"statusCode":403,"error":"Forbidden","message":"Error: Unauthorized"}"

is there a a way to pass username and password parameters in above command?

if any one could provide any help with the above problem i would appreciate it.

Thanks.


(Steffen Siering) #2

Which versions of metricbeat, Elasticsearch and kibana are you using. Depending on versions, metricbeat tries to write the kibana index mapping into the .kibana index, or (with newer kibana version) contacts kibana, so to use some API in kibana to install dashboards and index mapping.

Can you also share your metricbeat configuration?

Please format logs, configs and terminal input/output using the </>-Button or markdown code fences. This forum uses Markdown to format posts. Without proper formatting, it can be very hard to read your posts.


(Ninoslav) #3

Sorry for an incomplete post, and for not formatting texts, ill try to do better.

The version I`am using is 6.0.0 , for both my elastic stack, and metricbeats.

I am aware that after version 6.0, dashboards are loaded to Kibana via API.

So i tied the command from documentation:

metricbeat setup --dashboards

But i get an error:

Exiting: Error importing Kibana dashboards: fail to import the dashboards in Kibana: Error importing directory /usr/share/metricbeat/kibana: Failed to import index-pattern: Failed to load directory /usr/share/metricbeat/kibana/default/index-pattern:
error loading /usr/share/metricbeat/kibana/default/index-pattern/metricbeat.json: 403 Forbidden. Response: {"statusCode":403,"error":"Forbidden","message":"Error: Unauthorized"}

I have also tried to give extra parameters to command like:

-c /etc/metricbeat/metricbeat.yml -E 'setup.dashboards.directory=/usr/share/metricbeat/kibana' -E 'output.elasticsearch.username="user"' -E 'output.elasticsearch.password="password"' -E 'output.elasticsearch.hosts=["myip:9200"]'

But still i get a same error.

My metricbeat config looks something like:

> metricbeat.config.modules:
>   path: ${path.config}/modules.d/*.yml
>   reload.enabled: false
> 
> setup.template.settings:
>   index.number_of_shards: 1
>   index.codec: best_compression
> 
> tags: ["service-X", "web-tier"]
> 
> setup.dashboards.enabled: true
> 
> setup.kibana:
>  hosts: ["myip:9200"]
>   username: "kibanauser"
>   password: "kibanapass"
> 
> output.elasticsearch:
>   hosts: ["myip:9200"]
>   username: "elasticuser"
>   password: "elasticpass"

Thanks for help.

Ninoslav.


(Steffen Siering) #4

The kibana credentials are taken from setup.kibana.username and setup.kibana.password or directly from the url configuration (e.g. https://username:password@myip:9200). Indentation in your config seems to be somewhat off.


(Ninoslav) #5

I have managed to solve the problem.

I had installed search guard plugin in my elastic search and kibana, and it looks like problem was with the plugin. :roll_eyes:
Cant tell is it missconfiguration of plugin, or if plugin is blocking kibana entirely.

Any ways i uninstalled search guard plugin, and than I was able to use command

metricbeat setup --dashboards

witch imported my dashboards.

Thanks for help mate, you can put this post into resolved state.

Cheers.

Ninoslav.


(system) #6

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.