jorgedlcruz / vmware-grafana

A simple way to retrieve vCenter information and send it to InfluxDB, to present it later with Grafana
MIT License
185 stars 49 forks source link

[input.vsphere]: Error while getting metric metadata. #4

Closed Nornode closed 6 years ago

Nornode commented 6 years ago

Hi, Tried to implement the template telegraf.conf (Added InfluxDB as output) unfortunately my telegraf gives me following errors:

2018-10-23T12:19:47Z I! Starting Telegraf 1.8.1
2018-10-23T12:19:47Z I! Loaded inputs: inputs.vsphere
2018-10-23T12:19:47Z I! Loaded aggregators: 
2018-10-23T12:19:47Z I! Loaded processors: 
2018-10-23T12:19:47Z I! Loaded outputs: influxdb
2018-10-23T12:19:47Z I! Tags enabled: host=17e81504ea04
2018-10-23T12:19:47Z I! Agent Config: Interval:10s, Quiet:false, Hostname:"17e81504ea04", Flush Interval:10s 
2018-10-23T12:19:50Z E! [input.vsphere]: Error while getting metric metadata. Discovery will be incomplete. Error: ServerFaultCode: A specified parameter was not correct: entity
2018-10-23T12:19:50Z E! [input.vsphere]: Error while getting metric metadata. Discovery will be incomplete. Error: ServerFaultCode: A specified parameter was not correct: entity
2018-10-23T12:19:50Z E! [input.vsphere]: Error while getting metric metadata. Discovery will be incomplete. Error: ServerFaultCode: A specified parameter was not correct: entity
2018-10-23T12:19:50Z E! [input.vsphere]: Error while getting metric metadata. Discovery will be incomplete. Error: ServerFaultCode: A specified parameter was not correct: entity
2018-10-23T12:19:50Z E! [input.vsphere]: Error while getting metric metadata. Discovery will be incomplete. Error: ServerFaultCode: A specified parameter was not correct: entity
2018-10-23T12:19:50Z E! [input.vsphere]: Error while getting metric metadata. Discovery will be incomplete. Error: ServerFaultCode: A specified parameter was not correct: entity

The database has information about VM names e.al. but no performance metrics. Could you support with an idea of where things are going wrong?

Environment: HPE Proliant Microserver Gen8, Vmware ESXi 6.7.0 (Build 8169922) Custom HPE build (free version) Telegraf & InfluxDB running in a docker on the ESXi host.

telegraf.conf:

[[outputs.influxdb]]
      urls = ["http://192.168.10.14:8086"] # required
      database = "mumindalen_esxi" # required

      ## Write timeout (for the InfluxDB client), formatted as a string.
      ## If not provided, will default to 5s. 0s means no timeout (not recommended).
      timeout = "10s"
      username = "username"
      password = "password"
      ## Set the user agent for HTTP POSTs (can be useful for log differentiation)
      # user_agent = "telegraf"
      ## Set UDP payload size, defaults to InfluxDB UDP Client default (512 bytes)
      # udp_payload = 512

# Read metrics from one or many vCenters
[[inputs.vsphere]]
    ## List of vCenter URLs to be monitored. These three lines must be uncommented
  ## and edited for the plugin to work.
  vcenters = [ "https://mylocalIP/sdk" ]
  username = "" #Uing my normal password here (for webUI)
  password = "password"

  ## VMs
  ## Typical VM metrics (if omitted or empty, all metrics are collected)
  vm_metric_include = [
    "cpu.demand.average",
    "cpu.idle.summation",
    "cpu.latency.average",
    "cpu.readiness.average",
    "cpu.ready.summation",
    "cpu.run.summation",
    "cpu.usagemhz.average",
    "cpu.used.summation",
    "cpu.wait.summation",
    "mem.active.average",
    "mem.granted.average",
    "mem.latency.average",
    "mem.swapin.average",
    "mem.swapinRate.average",
    "mem.swapinRate.average",
    "mem.swapout.average",
    "mem.swapoutRate.average",
    "mem.usage.average",
    "mem.vmmemctl.average",
    "net.bytesRx.average",
    "net.bytesTx.average",
    "net.droppedRx.summation",
    "net.droppedTx.summation",
    "net.usage.average",
    "power.power.average",
    "virtualDisk.numberReadAveraged.average",
    "virtualDisk.numberWriteAveraged.average",
    "virtualDisk.read.average",
    "virtualDisk.readOIO.latest",
    "virtualDisk.throughput.usage.average",
    "virtualDisk.totalReadLatency.average",
    "virtualDisk.totalWriteLatency.average",
    "virtualDisk.write.average",
    "virtualDisk.writeOIO.latest",
    "sys.uptime.latest",
  ]
  # vm_metric_exclude = [] ## Nothing is excluded by default
  # vm_instances = true ## true by default

  ## Hosts
  ## Typical host metrics (if omitted or empty, all metrics are collected)
  host_metric_include = [
    "cpu.coreUtilization.average",
    "cpu.costop.summation",
    "cpu.demand.average",
    "cpu.idle.summation",
    "cpu.latency.average",
    "cpu.readiness.average",
    "cpu.ready.summation",
    "cpu.swapwait.summation",
    "cpu.usage.average",
    "cpu.usagemhz.average",
    "cpu.used.summation",
    "cpu.utilization.average",
    "cpu.wait.summation",
    "disk.deviceReadLatency.average",
    "disk.deviceWriteLatency.average",
    "disk.kernelReadLatency.average",
    "disk.kernelWriteLatency.average",
    "disk.numberReadAveraged.average",
    "disk.numberWriteAveraged.average",
    "disk.read.average",
    "disk.totalReadLatency.average",
    "disk.totalWriteLatency.average",
    "disk.write.average",
    "mem.active.average",
    "mem.latency.average",
    "mem.state.latest",
    "mem.swapin.average",
    "mem.swapinRate.average",
    "mem.swapout.average",
    "mem.swapoutRate.average",
    "mem.totalCapacity.average",
    "mem.usage.average",
    "mem.vmmemctl.average",
    "net.bytesRx.average",
    "net.bytesTx.average",
    "net.droppedRx.summation",
    "net.droppedTx.summation",
    "net.errorsRx.summation",
    "net.errorsTx.summation",
    "net.usage.average",
    "power.power.average",
    "storageAdapter.numberReadAveraged.average",
    "storageAdapter.numberWriteAveraged.average",
    "storageAdapter.read.average",
    "storageAdapter.write.average",
    "sys.uptime.latest",
  ]
  # host_metric_exclude = [] ## Nothing excluded by default
  # host_instances = true ## true by default

  ## Clusters
  # cluster_metric_include = [] ## if omitted or empty, all metrics are collected
# cluster_metric_exclude = ["*"] ## Nothing excluded by default
  # cluster_instances = true ## true by default

  ## Datastores
  # datastore_metric_include = [] ## if omitted or empty, all metrics are collected
  # datastore_metric_exclude = [] ## Nothing excluded by default
  # datastore_instances = false ## false by default for Datastores only

  ## Datacenters
  datacenter_metric_include = [] ## if omitted or empty, all metrics are collected
  datacenter_metric_exclude = [ "*" ] ## Datacenters are not collected by default.
  # datacenter_instances = false ## false by default for Datastores only

  ## Plugin Settings
  ## separator character to use for measurement and field names (default: "_")
  # separator = "_"

  ## number of objects to retreive per query for realtime resources (vms and hosts)
  ## set to 64 for vCenter 5.5 and 6.0 (default: 256)
   max_query_objects = 256

  ## number of metrics to retreive per query for non-realtime resources (clusters and datastores)
  ## set to 64 for vCenter 5.5 and 6.0 (default: 256)
   max_query_metrics = 256

  ## number of go routines to use for collection and discovery of objects and metrics
  collect_concurrency = 1
  discover_concurrency = 1

  ## whether or not to force discovery of new objects on initial gather call before collecting metrics
  ## when true for large environments this may cause errors for time elapsed while collecting metrics
  ## when false (default) the first collection cycle may result in no or limited metrics while objects are discovered
  force_discover_on_init = false

  ## the interval before (re)discovering objects subject to metrics collection (default: 300s)
  object_discovery_interval = "600s"

  ## timeout applies to any of the api request made to vcenter
  timeout = "20s"

  ## Optional SSL Config
  # ssl_ca = "/path/to/cafile"
  # ssl_cert = "/path/to/certfile"
  # ssl_key = "/path/to/keyfile"
  ## Use SSL but skip chain & host verification
  insecure_skip_verify = true
jorgedlcruz commented 6 years ago

Hello, do you have a vCenter? The plugin works only with vSphere vCenter SDK, not with ESXi, so you need vCenter. Thank you for trying it !

I am building one using SNMP, which works with all versions, but not yet quite ready.

Nornode commented 6 years ago

Hi, no, unfortunately, I don't! - I only have the free version running at home?! Do you know if it's possible to add in the SDK without a vCentre licence? If not, I'll eagerly await your SNMP solution! - Let me know if you want a beta tester! Thanks!

em-key commented 5 years ago

Hi, I just tested the same setup with my home server. (ESXi 6.5 single host ESXi without vCenter) I can poll almost all of the metrics but have the same issue like described from the initial post "A specified parameter was not correct: entity". Which spams the telegraf service log.

Since it would be hard to reinvent the wheel using snmp as well as to keep the compatibility to the existing predefined grafana dashboards it would be much better to have an option to choose single host esxi or vcenter setup. I'm not familiar with programming 'go' or plugins for telegraf but wouldn't it be an easy extension of the code to add this ability?

Nornode commented 5 years ago

@robot22: can you please share your config as I wasn't able to poll mine... (esxi 6.7)

cyberkitsune commented 5 years ago

I have the same issue as OP; Oddly enough it appeared to collect metrics for about 30 minutes then it broke. Any ideas?

yurividal commented 4 years ago

anyone managed to collect data form single esxi instead of vcenter? i dont have vcenter either and keep getting the error Error: ServerFaultCode: A specified parameter was not correct: entity

jorgedlcruz commented 4 years ago

Hello Yuri, This specific telegraf plugin requires vcenter SDK for now, I am working on an standalone version using SNMP, but it will take me some time.

Best regards

exetico commented 4 years ago

I would love to see a plugin for a single ESXi instance :-)

chennakesava1 commented 4 years ago

@jorgedlcruz, Could you please let us know if you completed the standalone version using SNMP with out having vCenter to monitor getting esxi matrices.

ronnyandre commented 3 years ago

Any progress on this work?

em-key commented 3 years ago

@robot22: can you please share your config as I wasn't able to poll mine... (esxi 6.7)

Hi Nornode, sorry I have not seen your message till now :-/ . In my current confiugration I put in the credentials of my esxi single host like this:

vcenters = [ "https://server-address/sdk" ] username = "readonly" password = "xxx"

Then I've excluded the VM metrics (because I'll poll them just from the VM directly) vm_metric_exclude = [ "*" ]

For monitoring the host itself I configured the few values I'm intrested in. host_metric_include = [ "cpu.usage.average","mem.usage.average","sys.uptime.latest" ]

Since it's long time ago I confiugred it i'm not sure anymore what other values I've tested. Since I'm doing passthough of my onboard sata controller which was not working for me on 6.7 I do not have experience with other versions.

I would guess that you found another solution in the meantime but maybe this helps others. :)

Best regards