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

show graphic

parent 6f2017e4
No related branches found
No related tags found
No related merge requests found
...@@ -102,6 +102,8 @@ class Ifconfig extends AbstractSensor { ...@@ -102,6 +102,8 @@ class Ifconfig extends AbstractSensor {
*/ */
public function parseIfconfig($string) { public function parseIfconfig($string) {
$allowed_prefixes = ["en", "eth"];
if ($string == null) { if ($string == null) {
return []; return [];
} }
...@@ -112,6 +114,10 @@ class Ifconfig extends AbstractSensor { ...@@ -112,6 +114,10 @@ class Ifconfig extends AbstractSensor {
foreach ($lines as $line) { foreach ($lines as $line) {
$name = $this->pregMatchOne(self::IFNAME, $line); $name = $this->pregMatchOne(self::IFNAME, $line);
if ($name !== false) { if ($name !== false) {
if (!\starts_with($name, $allowed_prefixes)) {
continue;
}
// Starting the section of a new interface // Starting the section of a new interface
$if = new NetworkInterface(); $if = new NetworkInterface();
$interfaces[] = $if; $interfaces[] = $if;
......
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