Skip to content

Commit

Permalink
Update telegraf_pfifgw.php
Browse files Browse the repository at this point in the history
I think it solves issues VictorRobellini#60 and VictorRobellini#64.

I added a definition for wifi cards (associated) and corrected from "status" to "iftstaus" on the first printf.
  • Loading branch information
jorlandobr authored Dec 14, 2022
1 parent 248c91b commit 224ac33
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugins/telegraf_pfifgw.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
}
if (strtolower($ifstatus) == "active") {
$ifstatus = 1;
}
if (strtolower($ifstatus) == "associated") {
$ifstatus = 1;
}
if (strtolower($ifstatus) == "active") {
$ifstatus = 1;
}
if (strtolower($ifstatus) == "no carrier") {
$ifstatus = 0;
Expand Down Expand Up @@ -61,7 +67,7 @@


printf(
"interface,host=%s,name=%s,ip4_address=%s,ip4_subnet=%s,ip6_address=%s,ip6_subnet=%s,mac_address=%s,friendlyname=%s,source=%s status=%s\n",
"interface,host=%s,name=%s,ip4_address=%s,ip4_subnet=%s,ip6_address=%s,ip6_subnet=%s,mac_address=%s,friendlyname=%s,source=%s ifstatus=%s\n",
$host,
$realif,
$ip4addr,
Expand Down Expand Up @@ -176,4 +182,4 @@
$substatus
);
};
?>
?>

0 comments on commit 224ac33

Please sign in to comment.