initial commit; version 22.5.12042

This commit is contained in:
2022-12-12 23:28:25 -05:00
commit af1b03d79f
17653 changed files with 22692970 additions and 0 deletions

View File

@ -0,0 +1,80 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
*
*/
// Here only discovery APs for enable polling
//$lwapps = snmpwalk_cache_oid($device, 'bsnAPDot3MacAddress', [], 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_index
$lwapps = snmpwalk_cache_oid($device, 'bsnAPName', [], 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_name
if (safe_count($lwapps)) {
$lwapps = snmpwalk_cache_oid($device, 'bsnAPNumOfSlots', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_number
$lwapps = snmpwalk_cache_oid($device, 'bsnApIpAddress', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_address
$lwapps = snmpwalk_cache_oid($device, 'bsnAPSerialNumber', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_serial
$lwapps = snmpwalk_cache_oid($device, 'bsnAPModel', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_model
$lwapps = snmpwalk_cache_oid($device, 'bsnAPLocation', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_location
$lwapps = snmpwalk_cache_oid($device, 'bsnAPAdminStatus', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_admin_status
$lwapps = snmpwalk_cache_oid($device, 'bsnAPOperationStatus', $lwapps, 'AIRESPACE-WIRELESS-MIB', NULL, OBS_SNMP_ALL_TABLE); //ap_status
}
$table_rows = [];
foreach ($lwapps as $ap_index => $aps) {
$index = format_mac(mac_zeropad($ap_index));
print_debug_vars($aps);
if ($aps['bsnAPAdminStatus'] === 'enable') {
switch($aps['bsnAPOperationStatus']) {
case 'associated': // AP is Up and running on the WLC.
$apstatus = "up";
break;
case 'disassociating': //AP is Unreachable and will be removed from WLC.
$apstatus = "down";
break;
case 'downloading': //AP is now being Added to WLC.
$apstatus = "init";
break;
}
} else {
$apstatus = "shutdown";
}
$ap_insert = [
//'device_id' => $device['device_id'],
'ap_mib' => $mib,
'ap_index' => $index,
'ap_number' => $aps['bsnAPNumOfSlots'],
'ap_name' => $aps['bsnAPName'],
'ap_address' => $aps['bsnApIpAddress'],
'ap_serial' => $aps['bsnAPSerialNumber'],
'ap_model' => $aps['bsnAPModel'],
'ap_location' => $aps['bsnAPLocation'],
'ap_status' => $apstatus,
'ap_admin_status' => $aps['bsnAPAdminStatus'],
];
discover_wifi_ap($device, $ap_insert);
$table_row = [];
$table_row[] = $index;
$table_row[] = $aps['bsnAPName'];
$table_row[] = $aps['bsnApIpAddress'];
$table_row[] = $aps['bsnAPSerialNumber'];
$table_row[] = $aps['bsnAPModel'];
$table_row[] = $aps['bsnAPLocation'];
$table_row[] = $aps['bsnAPOperationStatus'];
$table_row[] = $aps['bsnAPAdminStatus'];
$table_rows[] = $table_row;
}
$table_headers = array('%WAP MacAddress%n', '%WAP Name%n', '%WAP Address%n', '%WAP Serial%n', '%WAP Model%n', '%WAP Location%n', '%WAP OperStatus%n', '%WAP AdminStatus');
print_cli_table($table_rows, $table_headers);
unset($table_rows, $table_headers, $table_row, $lwapps, $aps);
// EOF

View File

@ -0,0 +1,53 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
// First attempt at radio polling. Could do with some improvement perhaps
// Getting Radios
$radios_snmp = snmpwalk_cache_oid($device, 'RuckusRadioTable', array(), 'RUCKUS-RADIO-MIB');
if ($GLOBALS['snmp_status'])
{
$radios_snmp = snmpwalk_cache_oid($device, 'ruckusRadioStatsNumSta', $radios_snmp, 'RUCKUS-RADIO-MIB');
if (OBS_DEBUG > 1) { print_vars($radios_snmp); }
}
// Goes through the SNMP radio data
foreach ($radios_snmp as $radio_number => $radio)
{
$radio['radio_mib'] = 'RUCKUS-RADIO-MIB';
$radio['radio_number'] = $radio_number;
$radio['radio_ap'] = 0; // Hardcoded since the AP is self.
$radio['radio_type'] = $radio['ruckusRadioMode'];
$radio['radio_status'] = 'unknown'; // Hardcoded, data doesn't exist in this MIB
$radio['radio_clients'] = $radio['ruckusRadioStatsNumSta'];
$radio['radio_txpower'] = $radio['ruckusRadioTxPower'];
$radio['radio_channel'] = $radio['ruckusRadioChannel'];
if ($radio['ruckusRadioBSSType'] == '1') { $radio['radio_status'] = 'station'; }
else if ($radio['ruckusRadioBSSType'] == '2') { $radio['radio_status'] = 'master'; }
else if ($radio['ruckusRadioBSSType'] == '3') { $radio['radio_status'] = 'independent'; }
else { $radio['radio_bsstype'] = 'unknown'; }
$radio['radio_protection'] = $radio['ruckusRadioProtectionMode'];
$radio['radio_mac'] = array('NULL'); // Hardcoded, data doesnt' exist in this MIB
if (OBS_DEBUG && count($radio)) { print_vars($radio); }
discover_wifi_radio($device['device_id'], $radio);
// $params = array('radio_ap', 'radio_number', 'radio_type', 'radio_status', 'radio_clients', 'radio_txpower', 'radio_channel', 'radio_mac', 'radio_protection', 'radio_bsstype', 'radio_mib');
}
unset($radios_snmp);
// EOF

View File

@ -0,0 +1,53 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
// First attempt at wlan polling. Could do with some improvement perhaps
// Getting WLANs
// Entries in this table are indexed by ifIndex.
$wlan_table = snmpwalk_cache_oid($device, 'RuckusWLANTable', array(), 'RUCKUS-WLAN-MIB');
if (OBS_DEBUG > 1) { print_vars($wlan_table); }
// Goes through the SNMP wlan data
foreach ($wlan_table as $wlan_ifIndex => $wlan)
{
$wlan['wlan_mib'] = 'RUCKUS-WLAN-MIB';
$wlan['wlan_index'] = $wlan_ifIndex; // Interface index.
$wlan['wlan_vlan_id'] = $wlan['ruckusWLANVlanID']; // Specifies the VLAN ID of the WLAN. If VLAN ID is 1, packets from this WLAN will be untagged.
$wlan['wlan_name'] = $wlan['ruckusWLANName']; // Name of the WLAN
$wlan['wlan_ssid'] = $wlan['ruckusWLANSSID']; // Specifies the name of the SSID.
$wlan['wlan_ssid_bcast'] = $wlan['ruckusWLANSSIDBcastDisable']; // Setting to 1, cause the ssid will not be broadcast in the beacons. True/False
$wlan['wlan_bssid'] = $wlan['ruckusWLANBSSID']; // This attribute is the unique identifier in this BSS. It is the 48-bit MAC address of the wireless interface.
$wlan['wlan_bss_type'] = $wlan['ruckusWLANBSSType']; // Specifies the bss type. station(1), master(2), independent(3)
$wlan['wlan_channel'] = $wlan['ruckusWLANChannel']; // Specifies the current operating channel.
$wlan['wlan_radio_mode'] = $wlan['ruckusWLANRadioMode']; // Specifies the radio mode. ieee802dot11b(1), ieee802dot11g(2), auto(3), ieee802dot11a(4), ieee802dot11ng(5), ieee802dot11na(6), ieee802dot11ac(7)
//$wlan['wlan_admin_status'] = $wlan['ruckusWLANAdminStatus']; // Administrative status of the WLAN interface. up(1), down(2)
if ($wlan['ruckusWLANAdminStatus'] == 'down') { $wlan['wlan_admin_status'] = 0; } else { $wlan['wlan_admin_status'] = 1; }
$wlan['wlan_beacon_period'] = $wlan['ruckusWLANBeaconPeriod']; // The number of milliseconds that a station will use for scheduling Beacon transmissions.
$wlan['wlan_dtim_period'] = $wlan['ruckusWLANDTIMPeriod']; // The number of TU that a station will use for scheduling Beacon transmissions.
$wlan['wlan_frag_thresh'] = $wlan['ruckusWLANFragmentationThreshold']; // The current maximum size, in octets, of the MPDU that may be delivered to the PHY.
$wlan['wlan_igmp_snoop'] = $wlan['ruckusWLANIGMPSnooping']; // enable(1), disable(2)
$wlan['wlan_prot_mode'] = $wlan['ruckusWLANProtectionMode']; // Enabled when 11g and 11b clients exist on the same network. none(1), ctsOnly(2), ctsRts(3)
$wlan['wlan_wds_enable'] = $wlan['ruckusWLANWDSEnable']; // Specifies if the WDS is enabled or disabled on this interface. True/False
$wlan['wlan_rts_thresh'] = $wlan['ruckusWLANRTSThreshold']; // The number of octets in an MPDU, below which an RTS/CTS handshake will not be performed.
if (OBS_DEBUG && count($wlan)) { print_vars($wlan); }
discover_wifi_wlan($device['device_id'], $wlan);
}
unset($wlans_snmp);
// EOF

View File

@ -0,0 +1,113 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage discovery
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
// Discovery of Juniper Wireless (ex Trapeze) APs and radios
//
// TRAPEZE-NETWORKS-AP-CONFIG-MIB
// Getting APs
$accesspoints_snmp = snmpwalk_cache_oid($device, "trpzApConfApConfigTable", [], "TRAPEZE-NETWORKS-AP-CONFIG-MIB", NULL, OBS_SNMP_ALL_NUMERIC_INDEX);
if (OBS_DEBUG > 1) { print_vars($accesspoints_snmp); }
$accesspoints_db = dbFetchRows("SELECT `name`, `model`, `location`, `fingerprint`, `serial`, `device_id`, `ap_number` FROM `wifi_accesspoints` WHERE `device_id` = ?", array($device['device_id']));
foreach ($accesspoints_db as $accesspoint_db)
{
$ap_db[$accesspoint_db['ap_number']] = $accesspoint_db;
}
// Mapping OIDs<>DB
$db_oids = [
'trpzApConfApConfigRemoteSiteName' => 'location',
'trpzApConfApConfigApName' => 'name',
'trpzApConfApConfigApModelName' => 'model',
'trpzApConfApConfigFingerprint' => 'fingerprint',
'trpzApConfApConfigApSerialNum' => 'serial'
];
// Goes through the SNMP APs data
foreach ($accesspoints_snmp as $ap_number => $accesspoint_snmp) {
$db_insert = [];
foreach ($db_oids as $db_oid => $db_value) {
$db_insert[$db_value] = $accesspoint_snmp[$db_oid];
} // DB: wifi_accesspoint_id, device_id, number, name, serial, model, location, fingerprint, delete
$db_insert['device_id'] = $device['device_id'];
$db_insert['ap_number'] = $ap_number;
print_debug_vars($db_insert);
if (!is_array($ap_db[$ap_number])) {
$accesspoint_id = dbInsert($db_insert, 'wifi_accesspoints');
echo('+');
}
else if (array_diff($ap_db[$ap_number], $db_insert))
{
if (OBS_DEBUG > 1) { print_vars(array_diff($ap_db[$new_index], $db_insert)); }
$updated = dbUpdate($db_insert, 'wifi_accesspoints', '`ap_number` = ? AND `device_id` = ?', array($ap_number, $device['device_id']));
echo("U");
}
else
{
echo(".");
}
}
unset($accesspoints_db, $accesspoints_snmp, $ap_db, $db_insert);
// Getting Radios
$radios_snmp = snmpwalk_cache_twopart_oid($device, "trpzApConfRadioConfigTable", $radios_snmp, "TRAPEZE-NETWORKS-AP-CONFIG-MIB");
if (OBS_DEBUG > 1) { print_vars($radios_snmp); }
$accesspoints_db = dbFetchRows("SELECT `wifi_accesspoint_id`, `ap_number` FROM `wifi_accesspoints` WHERE `device_id` = ?", array($device['device_id']));
foreach ($accesspoints_db as $accesspoint_db)
{
$ap_db[$accesspoint_db['ap_number']] = $accesspoint_db;
}
// Mapping OIDs<>DB
$db_oids = array('trpzApStatRadioStatusMacRadioNum' => 'radio_number',
'trpzApConfRadioConfigRadioType' => 'radio_type',
'trpzApConfRadioConfigRadioMode' => 'radio_status',
'trpzApConfRadioConfigTxPower' => 'radio_txpower',
'trpzApConfRadioConfigChannel' => 'radio_channel');
// Goes through the SNMP radio data
foreach ($radios_snmp as $ap_number => $ap_radios)
{
$accesspoint_id = $ap_db[$ap_number]['wifi_accesspoint_id'];
foreach ($ap_radios as $radio_number => $radio)
{
foreach ($db_oids as $db_oid => $db_value)
{
$radio[$db_value] = $radio[$db_oid];
}
$radio['radio_number'] = $radio_number;
$radio['radio_ap'] = $accesspoint_id;
$radio['radio_mib'] = 'TRAPEZE-NETWORKS-AP-CONFIG-MIB';
$radio['radio_protection'] = 'unknown';
$radio['radio_bsstype'] = 'unknown';
if (OBS_DEBUG) { print_vars($radio); }
discover_wifi_radio($device['device_id'], $radio);
// $params = array('radio_ap', 'radio_number', 'radio_type', 'radio_status', 'radio_clients', 'radio_txpower', 'radio_channel', 'radio_mac', 'radio_protection', 'radio_bsstype', 'radio_mib');
}
}
unset($radios_snmp, $radio);
// EOF