Replace all / with _ when querying graphite

Part of #348
This commit is contained in:
Girish Ramakrishnan
2017-06-06 21:17:04 -07:00
parent 03f1326073
commit c74fb07ff7

View File

@@ -111,8 +111,10 @@ angular.module('Application').controller('GraphsController', ['$scope', '$locati
Client.disks(function (error, disks) {
if (error) return console.log(error);
// We have to see if this is sufficient for all server configurations
var appDataDiskName = disks.appsDataDisk.slice(disks.appsDataDisk.lastIndexOf('/') + 1)
// /dev/sda1 -> sda1
// /dev/mapper/foo -> mapper_foo (see #348)
var appDataDiskName = disks.appsDataDisk.slice(disks.appsDataDisk.indexOf('/', 1) + 1)
appDataDiskName = appDataDiskName.replace(/\//g, '_');
Client.graphs([
'absolute(collectd.localhost.df-' + appDataDiskName + '.df_complex-free)',