dnaeon / py-vpoller

Distributed vSphere API Proxy
Other
83 stars 31 forks source link

Wrong format / interpretation of metric values #241

Open rockaut opened 6 years ago

rockaut commented 6 years ago

As an example: zabbix_agentd -t vpoller["cluster.perf.metric.get",xxx,xxx,"value",null,null,null,"cpu.usage.percent.average",null,"Past day"] zabbix_agentd [690]: vPoller module version 0.5.7 zabbix_agentd [690]: Loading vPoller module configuration file /etc/zabbix/vpoller_module.conf vpoller[cluster.perf.metric.get,xxx,xxx,value,null,null,null,cpu.usage.percent.average,null,Past day] [s|772]

first shouldn't it be an [f|] instead of [s|#] ? second 772 omitts the floating point! It should read 7.72.

rockaut commented 6 years ago

vpoller-client outputs that: {"timestamp": "2018-03-29 07:10:00+00:00", "counterId": "cpu.usage.percent.average", "interval": 300, "value": 762, "instance": ""}

while here it is an number instead of a string it still omits the point.

rockaut commented 6 years ago

As a quick workaround - at least in 3.4 - you can preprocess the value in zabbix with an regex: Expression: (\d+)(\d\d) Output: \1.\2

rockaut commented 6 years ago

I've run again in this problem on a very low utilized host ( sub 1% cpu usage) as with my workaround only recognizes above 1%. Any idea where i can look to solve that?

rockaut commented 6 years ago

New workaround is a modified regex (\d{0,3})(\d{2}) and \1.\2