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

show graphic

parent 57069824
No related branches found
No related tags found
No related merge requests found
......@@ -114,10 +114,6 @@ class Ifconfig extends AbstractSensor {
foreach ($lines as $line) {
$name = $this->pregMatchOne(self::IFNAME, $line);
if ($name !== false) {
if (!\starts_with($name, $allowed_prefixes)) {
continue;
}
// Starting the section of a new interface
$if = new NetworkInterface();
$interfaces[] = $if;
......@@ -137,9 +133,17 @@ class Ifconfig extends AbstractSensor {
$if->tx = $matches[2];
continue;
}
}
// filter out uninteresting interfaces
$filtered = [];
foreach ($interfaces as $interface) {
if (\starts_with($interface->name, $allowed_prefixes)) {
$filtered[] = $interface;
}
}
return $interfaces;
return $filtered;
}
public function pregMatchOne($pattern, $string) {
......
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