From a30888b3403bfd22358c30d9b706e73545fa5031 Mon Sep 17 00:00:00 2001 From: Bryan Sullivan Date: Tue, 21 Nov 2017 18:55:32 -0800 Subject: Add more collectd data to influx/grafana JIRA: VES-2 Disable uuid for "node" mode Change-Id: I055db4f52eee7a61438a4e7e63740b42dc3f1777 Signed-off-by: Bryan Sullivan --- tools/monitor.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'tools/monitor.py') diff --git a/tools/monitor.py b/tools/monitor.py index 91c0eae..9405b48 100644 --- a/tools/monitor.py +++ b/tools/monitor.py @@ -291,6 +291,60 @@ def save_event(body): pdata = pdata[:i] + ' ' + pdata[i+1:] send_to_influxdb("systemLoad", pdata) +# "cpuUsageArray": [ +# { +# "cpuIdentifier": "15", +# "cpuIdle": 99.8998998999, +# "cpuUsageInterrupt": 0, +# "cpuUsageNice": 0, +# "cpuUsageSoftIrq": 0, +# "cpuUsageSteal": 0, +# "cpuUsageSystem": 0, +# "cpuUsageUser": 0.1001001001, +# "cpuWait": 0, +# "percentUsage": 0.0 +# }, + + if 'cpuUsageArray' in jobj['event']['measurementsForVfScalingFields']: + print('Found diskUsageArray') + for disk in jobj['event']['measurementsForVfScalingFields']['cpuUsageArray']: + id=disk['cpuIdentifier'] + pdata = 'cpuUsage,system={},cpu={}'.format(source,id) + d = disk.items() + for key,val in d: + if key != 'cpuIdentifier': + pdata = pdata + ',{}={}'.format(key,val) + i=pdata.find(',', pdata.find('cpu=')) + pdata = pdata[:i] + ' ' + pdata[i+1:] + send_to_influxdb("cpuUsage", pdata) + +# "diskUsageArray": [ +# { +# "diskIdentifier": "sda", +# "diskIoTimeLast": 0.3996139893, +# "diskMergedReadLast": 0, +# "diskMergedWriteLast": 26.1747155344, +# "diskOctetsReadLast": 0, +# "diskOctetsWriteLast": 309767.93302, +# "diskOpsReadLast": 0, +# "diskOpsWriteLast": 10.9893839563, +# "diskTimeReadLast": 0, +# "diskTimeWriteLast": 0.699324445683 +# }, + + if 'diskUsageArray' in jobj['event']['measurementsForVfScalingFields']: + print('Found diskUsageArray') + for disk in jobj['event']['measurementsForVfScalingFields']['diskUsageArray']: + id=disk['diskIdentifier'] + pdata = 'diskUsage,system={},disk={}'.format(source,id) + d = disk.items() + for key,val in d: + if key != 'diskIdentifier': + pdata = pdata + ',{}={}'.format(key,val) + i=pdata.find(',', pdata.find('disk=')) + pdata = pdata[:i] + ' ' + pdata[i+1:] + send_to_influxdb("diskUsage", pdata) + # "memoryUsageArray": [ # { # "memoryBuffered": 269056.0, -- cgit 1.2.3-korg