Telegraf+ Vsphere : multiple vsphere_inputs issue when one of vcenter isn't accessible;

Hello, I’m trying to setup monitoring using telegraf for vsphere in docker container .
The issue that when in config we mention 2 vcenters and one of them isn’t accessible the container stops to work.
Is there any possibility to not stop the container when one of vcenters isn’t accessible ?
telegraf.conf:
[[inputs.vsphere]]
vcenters = [ “https://vc1/sdk” ]
username = “svc-monitor”
password = “pass”

[[inputs.vsphere]]
vcenters = [ “https://vc3/sdk” ]
username = “svc-monitor2”
password = “pass2”

docker logs:

@Alexandr_Cubuz Welcome to Influxdata Community!

When one vCenter is unreachable, Telegraf stops the entire container because of how the plugin handles connection failures during startup.

Solution: Use disconnected_servers_behavior = "ignore"

Add this configuration parameter to your telegraf.conf:

[[inputs.vsphere]]
  vcenters = [ "https://vc1/sdk" ]
  username = "svc-monitor"
  password = "pass"
  disconnected_servers_behavior = "ignore"  # Add this line

[[inputs.vsphere]]
  vcenters = [ "https://vc3/sdk" ]
  username = "svc-monitor2"
  password = "pass2"
  disconnected_servers_behavior = "ignore"  # Add this line

This parameter controls how the plugin behaves when a server is unreachable:

  • "error" (default): Returns an error and stops
  • "ignore": Logs a warning and continues operation

The key setting is disconnected_servers_behavior = "ignore", which will allow Telegraf to continue running even when one vCenter is unreachable, and it will retry connections on subsequent collection cycles.

Great ! Thanks a lot!
It works!

1 Like