Hi ,
We currently have the telegraf input.vsphere set up and metric working.
However, there is a request to use the formular below to generate CPU ready:
CPU ready % = ((CPU Ready summation value in ms / number of vCPUs) / (<chart update interval in seconds, default of 20> * 1000 ms/s)) * 100
We have values from telegraf for the CPU ready summation in ms;
My question is how can the number of vCPUs be obtained;
Many thanks
Hello @user_007 ,
Are you looking to perform this calculation with telegraf or InfluxDB? If so what version of Influx are you using?
Otherwise check out these processor plugins:
# Execd Processor Plugin
The `execd` processor plugin runs an external program as a separate process and
pipes metrics in to the process's STDIN and reads processed metrics from its
STDOUT. The programs must accept influx line protocol on standard in (STDIN)
and output metrics in influx line protocol to standard output (STDOUT).
Program output on standard error is mirrored to the telegraf log.
Telegraf minimum version: Telegraf 1.15.0
## Caveats
- Metrics with tracking will be considered "delivered" as soon as they are passed
to the external process. There is currently no way to match up which metric
coming out of the execd process relates to which metric going in (keep in mind
that processors can add and drop metrics, and that this is all done
asynchronously).
- it's not currently possible to use a data_format other than "influx", due to
the requirement that it is serialize-parse symmetrical and does not lose any
This file has been truncated. show original
# Starlark Processor Plugin
The `starlark` processor calls a Starlark function for each matched metric,
allowing for custom programmatic metric processing.
The Starlark language is a dialect of Python, and will be familiar to those who
have experience with the Python language. However, there are major
[differences](#python-differences). Existing Python code is unlikely to work
unmodified. The execution environment is sandboxed, and it is not possible to
do I/O operations such as reading from files or sockets.
The **[Starlark specification][]** has details about the syntax and available
functions.
Telegraf minimum version: Telegraf 1.15.0
## Global configuration options <!-- @/docs/includes/plugin_config.md -->
In addition to the plugin-specific configuration settings, plugins support
additional global and plugin configuration settings. These settings are used to
This file has been truncated. show original
https://www.influxdata.com/blog/how-use-starlark-telegraf/
Thanks for your response. The first question I think I should have asked is that are you aware if the " [input.vsphere]" plugin outputs the number of vCPUs ?
Here is a snippet from my telegraf config
host_metric_exclude = [““]
vm_metric_exclude = [” ”]
collect_concurrency = 3
datastore_metric_exclude = [““]
cluster_metric_exclude = [” ”]
datacenter_metric_exclude = [“*”]
collect_concurrency = 5
discover_concurrency = 5
Currently The CPU ready summation data is being outputed; however I need to get a value for the vCPUs?
Hello @user_007 ,
I’m not sure.
Here are the metrics:
# Common vSphere Performance Metrics
The set of performance metrics in vSphere is open ended. Metrics may be added or removed in new releases
and the set of available metrics may vary depending hardware, as well as what plugins and add-on products
are installed. Therefore, providing a definitive list of available metrics is difficult. The metrics listed
below are the most commonly available as of vSphere 6.5.
For a complete list of metrics available from vSphere and the units they measure in, please reference the [VMWare Product Documentation](https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.monitoring.doc/GUID-FF7F87C7-91E7-4A2D-88B5-E3E04A76F51B.html) or the [VMWare Performance Manager Documentation](https://vdc-repo.vmware.com/vmwb-repository/dcr-public/eda658cb-b729-480e-99bc-d3c961055a38/dc769ba5-3cfa-44b1-a5f9-ad807521af19/doc/vim.PerformanceManager.html)
To list the exact set in your environment, please use the govc tool available [here](https://github.com/vmware/govmomi/tree/master/govc)
To obtain the set of metrics for e.g. a VM, you may use the following command:
```shell
govc metric.ls vm/*
```
## Virtual Machine Metrics
```metrics
This file has been truncated. show original
It doesn’t look like it includes count.
You might have to use a processor plugin like starlark or execd to calculate the count.
Or maybe even basicstat
for the count
# BasicStats Aggregator Plugin
The BasicStats aggregator plugin give us count,max,min,mean,sum,s2(variance), stdev for a set of values,
emitting the aggregate every `period` seconds.
### Configuration:
```toml
# Keep the aggregate basicstats of each metric passing through.
[[aggregators.basicstats]]
## General Aggregator Arguments:
## The period on which to flush & clear the aggregator.
period = "30s"
## If true, the original metric will be dropped by the
## aggregator and will not get sent to the output plugins.
drop_original = false
This file has been truncated. show original