If disk name has '.', replace with '_'

graphite uses . as the separator between different metric parts

see cloudron/box#348
This commit is contained in:
Girish Ramakrishnan
2022-05-27 15:59:05 -07:00
parent f9c93ef039
commit b14e30504e

View File

@@ -77,9 +77,9 @@ angular.module('Application').controller('SystemController', ['$scope', '$locati
// render data of each disk
async.eachSeries(result.disks, function (disk, iteratorCallback) {
// /dev/sda1 -> sda1
// /dev/mapper/foo -> mapper_foo (see #348)
// /dev/mapper/foo.com -> mapper_foo_com (see #348)
var diskName = disk.filesystem.slice(disk.filesystem.indexOf('/', 1) + 1);
diskName = diskName.replace(/\//g, '_');
diskName = diskName.replace(/\/|\./g, '_');
// use collectd instead of df data so the timeframe matches with the du data
Client.graphs([