f
This commit is contained in:
@@ -25,11 +25,11 @@ public class DiskMonitorRegistry : Registry, IDiskMonitorRegistry
|
|||||||
CreateNoWindow = true
|
CreateNoWindow = true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
process.Start();
|
process.Start();
|
||||||
var result = process.StandardOutput.ReadToEnd();
|
var result = process.StandardOutput.ReadToEnd();
|
||||||
process.WaitForExit();
|
process.WaitForExit();
|
||||||
|
|
||||||
var format = FormatResult(result);
|
var format = FormatResult(result);
|
||||||
|
|
||||||
Console.WriteLine(format);
|
Console.WriteLine(format);
|
||||||
@@ -57,13 +57,6 @@ public class DiskMonitorRegistry : Registry, IDiskMonitorRegistry
|
|||||||
|
|
||||||
private void WriteToInfluxDB(string result)
|
private void WriteToInfluxDB(string result)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
/wd/apps,916G,53,410G
|
|
||||||
/wd/volc,3.6T,69,1.1T
|
|
||||||
/wd/volb,3.6T,60,1.4T
|
|
||||||
/wd/vola,3.6T,88,440G
|
|
||||||
*/
|
|
||||||
|
|
||||||
var lines = result.Split("\n");
|
var lines = result.Split("\n");
|
||||||
|
|
||||||
using var client = new InfluxDBClient("http://influxdb:8086", "BD4A71llb9_XbCA5mmKDbc_yTYwadPPLwyk4nAQ0l_yR_WJmw_-dMOWIs0KlS7-pZtHot_HrejY5GcOohKElmA==");
|
using var client = new InfluxDBClient("http://influxdb:8086", "BD4A71llb9_XbCA5mmKDbc_yTYwadPPLwyk4nAQ0l_yR_WJmw_-dMOWIs0KlS7-pZtHot_HrejY5GcOohKElmA==");
|
||||||
@@ -75,6 +68,8 @@ public class DiskMonitorRegistry : Registry, IDiskMonitorRegistry
|
|||||||
|
|
||||||
var cols = line.Split(",", StringSplitOptions.RemoveEmptyEntries);
|
var cols = line.Split(",", StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
|
||||||
|
if(cols.Length != 4) continue;
|
||||||
|
|
||||||
var path = cols[0];
|
var path = cols[0];
|
||||||
var totalSize = cols[1];
|
var totalSize = cols[1];
|
||||||
var usedPercent = cols[2];
|
var usedPercent = cols[2];
|
||||||
|
|||||||
Reference in New Issue
Block a user