Graylog-Telegraf-Grafana

I am trying to integrate Grafana in Graylog. I have installed Telegraf, Grafana, and Influxdb.

I get the error below when testing the conf file using (telegraf --config telegraf.conf --test ) and also in the journal for the telegraf service.

E! Error in plugin [inputs.graylog]: Response from url “https://X.X.X.X:9000/api/system/metrics/multiple has status code 401 (Unauthorized), expected 200 (OK)

I have created access tokens for user, created a role with the privileges to read metrics and assigned the role to the user but i still get the error above. I even tried assigning admin privileges to the user.

I tested the token by using the “curl get” to extract a metric value and it worked and the token is working.

The links I have referenced are below:

http://docs.graylog.org/en/2.4/pages/users_and_roles.html
http://docs.graylog.org/en/2.4/pages/faq.html#how-can-i-create-a-restricted-user-to-check-internal-graylog-metrics-in-my-monitoring-system

Any help is appreciated.

what does your telegraf configuration look like?

I created a conf file under telegraf.d called graylog.conf - i didnt’ edit the default telegraf.conf file most of the lines are hashed out. Below is the conf file under telegraf.d

[[inputs.graylog]]
servers = [
http://X.X.X.X:9000/api/system/metrics/multiple”,
]
metrics = [
“jvm.threads.count”,
“jvm.memory.total.init”,
“jvm.memory.total.used”,
“org.graylog2.journal.size”,
“org.graylog2.journal.size-limit”,
“org.graylog2.buffers.input.size”,
“org.graylog2.buffers.input.usage”,
“org.graylog2.buffers.output.size”,
“org.graylog2.buffers.output.usage”,
“org.graylog2.buffers.process.size”,
“org.graylog2.buffers.process.usage”,
“org.graylog2.journal.append.1-sec-rate”,
“org.graylog2.journal.utilization-ratio”,
“org.graylog2.throughput.input.1-sec-rate”,
“org.graylog2.throughput.output.1-sec-rate”
]
username = “test_token_name”
password = “test_token”

Thank you

you notice the part where you actually need to place your token?

The important is

 username = "Your token here"
 password = "token"

The Password token does not need a change - the username needs to be the token.

Thanks Jan, it worked. I miss interpreted the instructions. :grinning:

Thanks

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