forked from librenms/librenms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'librenms:master' into worknoc
- Loading branch information
Showing
427 changed files
with
710,062 additions
and
39,192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
/* | ||
* ArubaosCx.php | ||
* | ||
* NAC polling including 802.1x and device-profile entries. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
* @package LibreNMS | ||
* @link https://www.librenms.org | ||
*/ | ||
|
||
namespace LibreNMS\OS; | ||
|
||
use App\Models\PortsNac; | ||
use Illuminate\Support\Collection; | ||
use LibreNMS\Interfaces\Polling\NacPolling; | ||
use SnmpQuery; | ||
|
||
class ArubaosCx extends \LibreNMS\OS implements NacPolling | ||
{ | ||
public function pollNac() | ||
{ | ||
$nac = new Collection(); | ||
|
||
$rowSet = []; | ||
$ifIndex_map = $this->getDevice()->ports()->pluck('port_id', 'ifName'); | ||
$table = SnmpQuery::mibDir('arubaos-cx')->mibs(['ARUBAWIRED-PORT-ACCESS-MIB'])->hideMib()->enumStrings()->walk('arubaWiredPortAccessClientTable')->table(2); | ||
|
||
foreach ($table as $ifIndex => $entry) { | ||
foreach ($entry as $macKey => $macEntry) { | ||
$rowSet[$macKey] = [ | ||
'domain' => '', | ||
'ip_address' => '', | ||
'host_mode' => '', | ||
'authz_by' => '', | ||
'username' => '', | ||
'timeout' => '', | ||
]; | ||
$rowSet[$macKey]['authc_status'] = $macEntry['arubaWiredPacAuthState'] ?? ''; | ||
$rowSet[$macKey]['mac_address'] = $macKey; | ||
$rowSet[$macKey]['authz_by'] = $macEntry['arubaWiredPacOnboardedMethods'] ?? ''; | ||
$rowSet[$macKey]['authz_status'] = ''; | ||
$rowSet[$macKey]['username'] = $macEntry['arubaWiredPacUserName'] ?? ''; | ||
$rowSet[$macKey]['vlan'] = $macEntry['arubaWiredPacVlanId'] ?? null; | ||
$rowSet[$macKey]['port_id'] = $ifIndex_map->get($ifIndex, 0); | ||
$rowSet[$macKey]['auth_id'] = $ifIndex; | ||
$rowSet[$macKey]['method'] = $macEntry['arubaWiredPacOnboardedMethods'] ?? ''; | ||
} | ||
} | ||
|
||
foreach ($rowSet as $row) { | ||
var_dump($row); | ||
$nac->put($row['mac_address'], new PortsNac($row)); | ||
} | ||
|
||
return $nac; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<?php | ||
/* | ||
* Fortiextender.php | ||
* | ||
* -Description- | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
* @package LibreNMS | ||
* @link https://www.librenms.org | ||
* @copyright 2024 CTNET B.V. | ||
* @author Rudy Broersma <[email protected]> | ||
*/ | ||
|
||
namespace LibreNMS\OS; | ||
|
||
use LibreNMS\Device\WirelessSensor; | ||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessRsrpDiscovery; | ||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessRsrqDiscovery; | ||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessRssiDiscovery; | ||
use LibreNMS\Interfaces\Discovery\Sensors\WirelessSinrDiscovery; | ||
use LibreNMS\OS\Shared\Fortinet; | ||
|
||
class Fortiextender extends Fortinet implements | ||
WirelessSinrDiscovery, | ||
WirelessRsrpDiscovery, | ||
WirelessRsrqDiscovery, | ||
WirelessRssiDiscovery | ||
{ | ||
public function discoverWirelessSinr() | ||
{ | ||
$sinr_group = snmpwalk_group($this->getDeviceArray(), 'fextInfoModemStatusSINR', 'FORTINET-FORTIEXTENDER-MIB', 1); | ||
$oid = '.1.3.6.1.4.1.12356.121.21.3.1.1.28.'; | ||
|
||
$sinr = []; | ||
foreach ($sinr_group as $key => $sinr_entry) { | ||
$sinr[] = new WirelessSensor('sinr', $this->getDeviceId(), $oid . $key, 'fortiextender', $key, 'Modem ' . $key); | ||
} | ||
|
||
return $sinr; | ||
} | ||
|
||
public function discoverWirelessRsrp() | ||
{ | ||
$rsrp_group = snmpwalk_group($this->getDeviceArray(), 'fextInfoModemStatusSINR', 'FORTINET-FORTIEXTENDER-MIB', 1); | ||
$oid = '.1.3.6.1.4.1.12356.121.21.3.1.1.29.'; | ||
|
||
$rsrp = []; | ||
foreach ($rsrp_group as $key => $rsrp_entry) { | ||
$rsrp[] = new WirelessSensor('rsrp', $this->getDeviceId(), $oid . $key, 'fortiextender', $key, 'Modem ' . $key); | ||
} | ||
|
||
return $rsrp; | ||
} | ||
|
||
public function discoverWirelessRsrq() | ||
{ | ||
$rsrq_group = snmpwalk_group($this->getDeviceArray(), 'fextInfoModemStatusRSRQ', 'FORTINET-FORTIEXTENDER-MIB', 1); | ||
$oid = '.1.3.6.1.4.1.12356.121.21.3.1.1.30.'; | ||
|
||
$rsrq = []; | ||
foreach ($rsrq_group as $key => $rsrq_entry) { | ||
$rsrq[] = new WirelessSensor('rsrq', $this->getDeviceId(), $oid . $key, 'fortiextender', $key, 'Modem ' . $key); | ||
} | ||
|
||
return $rsrq; | ||
} | ||
|
||
public function discoverWirelessRssi() | ||
{ | ||
$rsrq_group = snmpwalk_group($this->getDeviceArray(), 'fextInfoModemStatusRSSI', 'FORTINET-FORTIEXTENDER-MIB', 1); | ||
$oid = '.1.3.6.1.4.1.12356.121.21.3.1.1.22.'; | ||
|
||
$rsrq = []; | ||
foreach ($rsrq_group as $key => $rsrq_entry) { | ||
$rsrq[] = new WirelessSensor('rssi', $this->getDeviceId(), $oid . $key, 'fortiextender', $key, 'Modem ' . $key); | ||
} | ||
|
||
return $rsrq; | ||
} | ||
} |
Oops, something went wrong.