Skip to content
Snippets Groups Projects
Commit b64424df authored by Tibo's avatar Tibo
Browse files

Support nfs

parent 6affd7f2
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ namespace App\Sensor;
*/
class Disks extends \App\AbstractSensor {
const REGEXP = "/\\n([A-z\/0-9\\-\\.]+)\s*([0-9]+)\s*([0-9]+)\s*([0-9]+)\s*([0-9]+)%\s*([A-z\/0-9]+)/";
const REGEXP = "/\\n([A-z\/0-9:\\-\\.]+)\s*([0-9]+)\s*([0-9]+)\s*([0-9]+)\s*([0-9]+)%\s*([A-z\/0-9]+)/";
public function report() {
$record = $this->getLastRecord("disks");
......
......@@ -9,7 +9,7 @@ namespace App\Sensor;
*/
class Inodes extends \App\AbstractSensor {
const REGEXP = "/\\n([A-z\/0-9\\-\\.]+)\s*([0-9]+)\s*([0-9]+)\s*([0-9]+)\s*([0-9]+)%\s*([A-z\/0-9]+)/";
const REGEXP = "/\\n([A-z\/0-9:\\-\\.]+)\s*([0-9]+)\s*([0-9]+)\s*([0-9]+)\s*([0-9]+)%\s*([A-z\/0-9]+)/";
public function report() {
$record = $this->getLastRecord("inodes");
......
......@@ -43,9 +43,9 @@ class ExampleTest extends TestCase
$string = file_get_contents(__DIR__ . "/df");
$sensor = new Disks(new \App\Server());
$disks = $sensor->parse($string);
$this->assertEquals(7, count($disks));
$this->assertEquals("/dev/sda1", $disks[2]->filesystem);
$this->assertEquals(1128926648, $disks[2]->blocks);
$this->assertEquals(3, count($disks));
$this->assertEquals("/dev/sda1", $disks[1]->filesystem);
$this->assertEquals(1128926648, $disks[1]->blocks);
}
public function testUpdates() {
......
......@@ -6,3 +6,4 @@ tmpfs 12258572 4 12258568 1% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 12258572 0 12258572 0% /sys/fs/cgroup
tmpfs 2451716 0 2451716 0% /run/user/1000
172.20.0.4:/srv/nfs/cylab03 1729930240 94934016 1547097088 6% /mnt/nfs
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment