telegraf: getsockopt: connection refused

Hi Team, It`s really a good tool to play around and go important stuff too. Kudos to your team. But today i am facing an issue related to flashing data into influx database. below are the below details. hope details are sufficient to reproduce it.

Bug report

Relevant telegraf.conf:

[global_tags] ServerName=“server_name” StackName=“stack1” AppId=“test” AppVersion=“VERSION”

[agent] debug = true quiet = false

Override default hostname, if empty use os.Hostname()

hostname = “”

[[inputs.jolokia]] context = “/jolokia/”

[[inputs.jolokia.servers]] host = “127.0.0.1” port = “8788”

[[inputs.jolokia.metrics]] name = “ReleaseCacheSize” mbean = “core.common.dataaccess.cache.consumer:name=core.release.cache.consumerCache,type=CacheConsumerImpl” attribute = “CacheSize”

[[inputs.jolokia.metrics]] name = “ConfigCacheSize” mbean = “core.common.dataaccess.cache.consumer:name=core.config.cache.consumerCache,type=CacheConsumerImpl” attribute = “CacheSize”

[[outputs.influxdb]]

urls = [“$url”] database = “test_health” username = “XXXX” precision = “s” user_agent = “CacheSize” password = “XXXXX” timeout = “5s”

Version: 1.3 OS; Linux 2.6.32-696.1.1.el6.x86_64 x86_64

Steps to reproduce:

We are not running telegraf as a service instead we are running through command. telegraf --config=/etc/telegraf/telegraf.d/telegraf.conf

Expected behavior:

It should write a data in influx database, as through window i am able to write data in influx db with same conf.

Actual behavior:

2017-07-14T17:01:17Z D! Attempting connection to output: influxdb 2017-07-14T17:01:17Z D! Successfully connected to output: influxdb 2017-07-14T17:01:17Z I! Starting Telegraf (version 1.3.0) 2017-07-14T17:01:17Z I! Loaded outputs: influxdb 2017-07-14T17:01:17Z I! Loaded inputs: inputs.jolokia inputs.jolokia … 2017-07-14T17:01:20Z E! Error in plugin [inputs.jolokia]: error performing request: Post http://localhost:8788/jolokia : dial tcp 127.0.0.1:8788: getsockopt: connection refused

Additional info:

As security reason, we have removed the important info from conf , telegraf command and log snippet

Desired behavior:

Telegraf should write a data into Influx db as it is doing correctly in Window OS.

Use case:

We need to monitor the in build cache in Grafana.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Noticed this behaviour as well, I was hoping that if a host is not available (e.g. the jvm is not running currently) then it either skips it, or has some form of up/down/health indication. I believe Prometheus reports a host not up if it can’t be scraped but is configured to be scraped. In my use case it would have been nice if I can start telegraf even with jolokia hosts being not reachable.