From 28634c59c8fb0ccaf3e4f880fbf8e04676bb1bae Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Tue, 20 Aug 2019 12:36:06 +0200 Subject: [PATCH] Get the correct df data from graphite --- src/views/graphs.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/views/graphs.js b/src/views/graphs.js index 9874c61dd..e6df87539 100644 --- a/src/views/graphs.js +++ b/src/views/graphs.js @@ -121,16 +121,17 @@ angular.module('Application').controller('GraphsController', ['$scope', '$locati $scope.disks = result.disks; - // /dev/sda1 -> sda1 - // /dev/mapper/foo -> mapper_foo (see #348) - var appDataDiskName = result.appsDataDisk.slice(result.appsDataDisk.indexOf('/', 1) + 1); - appDataDiskName = appDataDiskName.replace(/\//g, '_'); - + // lazy fetch graphite data $scope.disks.forEach(function (disk) { + // /dev/sda1 -> sda1 + // /dev/mapper/foo -> mapper_foo (see #348) + var diskName = disk.filesystem.slice(disk.filesystem.indexOf('/', 1) + 1); + diskName = diskName.replace(/\//g, '_'); + Client.graphs([ - 'absolute(collectd.localhost.df-' + appDataDiskName + '.df_complex-free)', - 'absolute(collectd.localhost.df-' + appDataDiskName + '.df_complex-reserved)', - 'absolute(collectd.localhost.df-' + appDataDiskName + '.df_complex-used)' + 'absolute(collectd.localhost.df-' + diskName + '.df_complex-free)', + 'absolute(collectd.localhost.df-' + diskName + '.df_complex-reserved)', + 'absolute(collectd.localhost.df-' + diskName + '.df_complex-used)' ], '-1min', function (error, data) { if (error) return console.log(error);