mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Update code in includes to be PSR-2 compliant (#4220)
refactor: Update code in /includes to be psr2 compliant #4220
This commit is contained in:
committed by
Neil Lathwood
parent
3c0fcdd46b
commit
9284bc60ff
@@ -18,7 +18,7 @@ if (is_numeric($transmitPower)) {
|
||||
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-250-transmitPower', $tags, $fields);
|
||||
$graphs['cambium_250_transmitPower'] = TRUE;
|
||||
$graphs['cambium_250_transmitPower'] = true;
|
||||
}
|
||||
|
||||
$receivePower = snmp_get($device, "receivePower.0", "-Ovqn", "CAMBIUM-PTP250-MIB");
|
||||
@@ -35,7 +35,7 @@ if (is_numeric($receivePower)) {
|
||||
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-250-receivePower', $tags, $fields);
|
||||
$graphs['cambium_250_receivePower'] = TRUE;
|
||||
$graphs['cambium_250_receivePower'] = true;
|
||||
}
|
||||
|
||||
$txModulation = snmp_get($device, ".1.3.6.1.4.1.17713.250.5.9.0", "-Ovqn", "");
|
||||
@@ -52,7 +52,7 @@ if (is_numeric($txModulation) && is_numeric($rxModulation)) {
|
||||
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-250-modulationMode', $tags, $fields);
|
||||
$graphs['cambium_250_modulationMode'] = TRUE;
|
||||
$graphs['cambium_250_modulationMode'] = true;
|
||||
}
|
||||
|
||||
$receiveDataRate = snmp_get($device, "receiveDataRate.0", "-Ovqn", "CAMBIUM-PTP250-MIB");
|
||||
@@ -72,7 +72,7 @@ if (is_numeric($receiveDataRate) && is_numeric($transmitDataRate) && is_numeric(
|
||||
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-250-dataRate', $tags, $fields);
|
||||
$graphs['cambium_250_dataRate'] = TRUE;
|
||||
$graphs['cambium_250_dataRate'] = true;
|
||||
}
|
||||
|
||||
$ssr = snmp_get($device, "signalStrengthRatio.0", "-Ovqn", "CAMBIUM-PTP250-MIB");
|
||||
@@ -84,5 +84,5 @@ if (is_numeric($ssr)) {
|
||||
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-250-ssr', $tags, $fields);
|
||||
$graphs['cambium_250_ssr'] = TRUE;
|
||||
}
|
||||
$graphs['cambium_250_ssr'] = true;
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ if (is_numeric($transmitPower)) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-650-transmitPower', $tags, $fields);
|
||||
$graphs['cambium_650_transmitPower'] = TRUE;
|
||||
$graphs['cambium_650_transmitPower'] = true;
|
||||
}
|
||||
|
||||
$rawReceivePower = snmp_get($device, "rawReceivePower.0", "-Ovqn", "CAMBIUM-PTP650-MIB");
|
||||
@@ -28,7 +28,7 @@ if (is_numeric($rawReceivePower)) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-650-rawReceivePower', $tags, $fields);
|
||||
$graphs['cambium_650_rawReceivePower'] = TRUE;
|
||||
$graphs['cambium_650_rawReceivePower'] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ if (is_numeric($txModulation) && is_numeric($rxModulation)) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-650-modulationMode', $tags, $fields);
|
||||
$graphs['cambium_650_modulationMode'] = TRUE;
|
||||
$graphs['cambium_650_modulationMode'] = true;
|
||||
}
|
||||
|
||||
$receiveDataRate = snmp_get($device, "receiveDataRate.0", "-Ovqn", "CAMBIUM-PTP650-MIB");
|
||||
@@ -64,7 +64,7 @@ if (is_numeric($receiveDataRate) && is_numeric($transmitDataRate) && is_numeric(
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-650-dataRate', $tags, $fields);
|
||||
$graphs['cambium_650_dataRate'] = TRUE;
|
||||
$graphs['cambium_650_dataRate'] = true;
|
||||
}
|
||||
|
||||
$ssr = snmp_get($device, "signalStrengthRatio.0", "-Ovqn", "CAMBIUM-PTP650-MIB");
|
||||
@@ -75,46 +75,37 @@ if (is_numeric($ssr)) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-650-ssr', $tags, $fields);
|
||||
$graphs['cambium_650_ssr'] = TRUE;
|
||||
$graphs['cambium_650_ssr'] = true;
|
||||
}
|
||||
|
||||
$gps = snmp_get($device, "tDDSynchronizationStatus.0", "-Ovqn", "CAMBIUM-PTP650-MIB");
|
||||
if ($gps == 'locked') {
|
||||
$gps = 0;
|
||||
}
|
||||
else if ($gps == 'holdover') {
|
||||
} elseif ($gps == 'holdover') {
|
||||
$gps = 1;
|
||||
}
|
||||
else if ($gps == 'holdoverNoGPSSyncIn') {
|
||||
$gps = 2;
|
||||
}
|
||||
else if ($gps == 'notSynchronized') {
|
||||
$gps = 3;
|
||||
}
|
||||
else if ($gps == 'notSynchronizedNoGPSSyncIn') {
|
||||
$gps = 4;
|
||||
}
|
||||
else if ($gps == 'pTPSYNCNotConnected') {
|
||||
$gps = 5;
|
||||
}
|
||||
else if ($gps == 'initialising') {
|
||||
$gps = 6;
|
||||
}
|
||||
else if ($gps == 'clusterTimingMaster') {
|
||||
$gps = 7;
|
||||
}
|
||||
else if ($gps == 'acquiringLock') {
|
||||
$gps = 8;
|
||||
}
|
||||
else if ($gps == 'inactive') {
|
||||
$gps = 9;
|
||||
}
|
||||
} elseif ($gps == 'holdoverNoGPSSyncIn') {
|
||||
$gps = 2;
|
||||
} elseif ($gps == 'notSynchronized') {
|
||||
$gps = 3;
|
||||
} elseif ($gps == 'notSynchronizedNoGPSSyncIn') {
|
||||
$gps = 4;
|
||||
} elseif ($gps == 'pTPSYNCNotConnected') {
|
||||
$gps = 5;
|
||||
} elseif ($gps == 'initialising') {
|
||||
$gps = 6;
|
||||
} elseif ($gps == 'clusterTimingMaster') {
|
||||
$gps = 7;
|
||||
} elseif ($gps == 'acquiringLock') {
|
||||
$gps = 8;
|
||||
} elseif ($gps == 'inactive') {
|
||||
$gps = 9;
|
||||
}
|
||||
if (is_numeric($gps)) {
|
||||
$rrd_def = 'DS:gps:GAUGE:600:0:10';
|
||||
$fields = array(
|
||||
'gps' => $gps,
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-650-gps', $tags, $fields);
|
||||
$graphs['cambium_650_gps'] = TRUE;
|
||||
}
|
||||
'gps' => $gps,
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-650-gps', $tags, $fields);
|
||||
$graphs['cambium_650_gps'] = true;
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ if (is_numeric($cambiumSTADLRSSI) && is_numeric($cambiumSTADLSNR)) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-epmp-RFStatus', $tags, $fields);
|
||||
$graphs['cambium_epmp_RFStatus'] = TRUE;
|
||||
$graphs['cambium_epmp_RFStatus'] = true;
|
||||
}
|
||||
|
||||
$cambiumGPSNumTrackedSat = snmp_get($device, "cambiumGPSNumTrackedSat.0", "-Ovqn", "CAMBIUM-PMP80211-MIB");
|
||||
@@ -35,7 +35,7 @@ if (is_numeric($cambiumGPSNumTrackedSat) && is_numeric($cambiumGPSNumVisibleSat)
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-epmp-gps', $tags, $fields);
|
||||
$graphs['cambium_epmp_gps'] = TRUE;
|
||||
$graphs['cambium_epmp_gps'] = true;
|
||||
}
|
||||
|
||||
$cambiumSTAUplinkMCSMode = snmp_get($device, "cambiumSTAUplinkMCSMode.0", "-Ovqn", "CAMBIUM-PMP80211-MIB");
|
||||
@@ -51,7 +51,7 @@ if (is_numeric($cambiumSTAUplinkMCSMode) && is_numeric($cambiumSTADownlinkMCSMod
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-epmp-modulation', $tags, $fields);
|
||||
$graphs['cambium_epmp_modulation'] = TRUE;
|
||||
$graphs['cambium_epmp_modulation'] = true;
|
||||
}
|
||||
|
||||
$registeredSM = snmp_get($device, "cambiumAPNumberOfConnectedSTA.0", "-Ovqn", "CAMBIUM-PMP80211-MIB");
|
||||
@@ -62,7 +62,7 @@ if (is_numeric($registeredSM)) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-epmp-registeredSM', $tags, $fields);
|
||||
$graphs['cambium_epmp_registeredSM'] = TRUE;
|
||||
$graphs['cambium_epmp_registeredSM'] = true;
|
||||
}
|
||||
|
||||
$sysNetworkEntryAttempt = snmp_get($device, "sysNetworkEntryAttempt.0", "-Ovqn", "CAMBIUM-PMP80211-MIB");
|
||||
@@ -81,7 +81,7 @@ if (is_numeric($sysNetworkEntryAttempt) && is_numeric($sysNetworkEntrySuccess) &
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-epmp-access', $tags, $fields);
|
||||
$graphs['cambium_epmp_access'] = TRUE;
|
||||
$graphs['cambium_epmp_access'] = true;
|
||||
}
|
||||
|
||||
$gpsSync = snmp_get($device, "cambiumEffectiveSyncSource.0", "-Ovqn", "CAMBIUM-PMP80211-MIB");
|
||||
@@ -92,7 +92,7 @@ if (is_numeric($gpsSync)) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-epmp-gpsSync', $tags, $fields);
|
||||
$graphs['cambium_epmp_gpsSync'] = TRUE;
|
||||
$graphs['cambium_epmp_gpsSync'] = true;
|
||||
}
|
||||
|
||||
$freq = snmp_get($device, "cambiumSTAConnectedRFFrequency.0", "-Ovqn", "CAMBIUM-PMP80211-MIB");
|
||||
@@ -103,5 +103,5 @@ if (is_numeric($freq)) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-epmp-freq', $tags, $fields);
|
||||
$graphs['cambium_epmp_freq'] = TRUE;
|
||||
$graphs['cambium_epmp_freq'] = true;
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ if (strstr($hardware, 'CMM') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-errorCount', $tags, $fields);
|
||||
$graphs['cambium_generic_errorCount'] = TRUE;
|
||||
$graphs['cambium_generic_errorCount'] = true;
|
||||
unset($rrd_filename,$fecInErrorsCount,$fecOutErrorsCount);
|
||||
}
|
||||
|
||||
@@ -34,11 +34,11 @@ if (strstr($hardware, 'CMM') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-crcErrors', $tags, $fields);
|
||||
$graphs['cambium_generic_crcErrors'] = TRUE;
|
||||
$graphs['cambium_generic_crcErrors'] = true;
|
||||
}
|
||||
|
||||
$vertical = str_replace('"',"",snmp_get($device, ".1.3.6.1.4.1.161.19.3.2.2.117.0", "-Ovqn", ""));
|
||||
$horizontal = str_replace('"',"",snmp_get($device, ".1.3.6.1.4.1.161.19.3.2.2.118.0", "-Ovqn", ""));
|
||||
$vertical = str_replace('"', "", snmp_get($device, ".1.3.6.1.4.1.161.19.3.2.2.117.0", "-Ovqn", ""));
|
||||
$horizontal = str_replace('"', "", snmp_get($device, ".1.3.6.1.4.1.161.19.3.2.2.118.0", "-Ovqn", ""));
|
||||
$combined = snmp_get($device, "1.3.6.1.4.1.161.19.3.2.2.21.0", "-Ovqn", "");
|
||||
if (is_numeric($vertical) && is_numeric($horizontal) && is_numeric($combined)) {
|
||||
$rrd_def = array(
|
||||
@@ -53,7 +53,7 @@ if (strstr($hardware, 'CMM') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-signalHV', $tags, $fields);
|
||||
$graphs['cambium_generic_signalHV'] = TRUE;
|
||||
$graphs['cambium_generic_signalHV'] = true;
|
||||
unset($rrd_filename,$vertical,$horizontal,$combined);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ if (strstr($hardware, 'CMM') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-rssi', $tags, $fields);
|
||||
$graphs['cambium_generic_rssi'] = TRUE;
|
||||
$graphs['cambium_generic_rssi'] = true;
|
||||
unset($rrd_filename,$rssi);
|
||||
}
|
||||
|
||||
@@ -77,12 +77,12 @@ if (strstr($hardware, 'CMM') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-jitter', $tags, $fields);
|
||||
$graphs['cambium_generic_jitter'] = TRUE;
|
||||
$graphs['cambium_generic_jitter'] = true;
|
||||
unset($rrd_filename,$jitter);
|
||||
}
|
||||
|
||||
$horizontal = str_replace('"',"",snmp_get($device, "radioDbmHorizontal.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
$vertical = str_replace('"',"",snmp_get($device, "radioDbmVertical.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
$horizontal = str_replace('"', "", snmp_get($device, "radioDbmHorizontal.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
$vertical = str_replace('"', "", snmp_get($device, "radioDbmVertical.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
if (is_numeric($horizontal) && is_numeric($vertical)) {
|
||||
$rrd_def = array(
|
||||
'DS:horizontal:GAUGE:600:-100:100',
|
||||
@@ -94,11 +94,11 @@ if (strstr($hardware, 'CMM') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-450-slaveHV', $tags, $fields);
|
||||
$graphs['cambium_generic_450_slaveHV'] = TRUE;
|
||||
$graphs['cambium_generic_450_slaveHV'] = true;
|
||||
unset($rrd_filename,$horizontal,$vertical);
|
||||
}
|
||||
|
||||
$ssr = str_replace('"',"",snmp_get($device, "signalStrengthRatio.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
$ssr = str_replace('"', "", snmp_get($device, "signalStrengthRatio.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
if (is_numeric($ssr)) {
|
||||
$rrd_def = 'DS:ssr:GAUGE:600:-150:150';
|
||||
$fields = array(
|
||||
@@ -106,12 +106,12 @@ if (strstr($hardware, 'CMM') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-450-slaveSSR', $tags, $fields);
|
||||
$graphs['cambium_generic_450_slaveSSR'] = TRUE;
|
||||
$graphs['cambium_generic_450_slaveSSR'] = true;
|
||||
unset($rrd_filename,$ssr);
|
||||
}
|
||||
|
||||
$horizontal = str_replace('"',"",snmp_get($device, "signalToNoiseRatioSMHorizontal.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
$vertical = str_replace('"',"",snmp_get($device, "signalToNoiseRatioSMVertical.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
$horizontal = str_replace('"', "", snmp_get($device, "signalToNoiseRatioSMHorizontal.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
$vertical = str_replace('"', "", snmp_get($device, "signalToNoiseRatioSMVertical.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
if (is_numeric($horizontal) && is_numeric($vertical)) {
|
||||
$rrd_def = array(
|
||||
'DS:horizontal:GAUGE:600:0:100',
|
||||
@@ -123,7 +123,7 @@ if (strstr($hardware, 'CMM') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-450-slaveSNR', $tags, $fields);
|
||||
$graphs['cambium_generic_450_slaveSNR'] = TRUE;
|
||||
$graphs['cambium_generic_450_slaveSNR'] = true;
|
||||
unset($rrd_filename,$horizontal,$vertical);
|
||||
}
|
||||
}
|
||||
@@ -132,11 +132,9 @@ if (strstr($hardware, 'AP') || strstr($hardware, 'Master') || strstr($hardware,
|
||||
$gpsStatus = snmp_get($device, "whispGPSStats.0", "-Ovqn", "WHISP-APS-MIB");
|
||||
if ($gpsStatus == 'generatingSync') {
|
||||
$gpsStatus = 3;
|
||||
}
|
||||
else if ($gpsStatus == 'gpsLostSync') {
|
||||
} elseif ($gpsStatus == 'gpsLostSync') {
|
||||
$gpsStatus = 2;
|
||||
}
|
||||
else if ($gpsStatus == 'gpsSynchronized') {
|
||||
} elseif ($gpsStatus == 'gpsSynchronized') {
|
||||
$gpsStatus = 1;
|
||||
}
|
||||
if (is_numeric($gpsStatus)) {
|
||||
@@ -146,12 +144,12 @@ if (strstr($hardware, 'AP') || strstr($hardware, 'Master') || strstr($hardware,
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-whispGPSStats', $tags, $fields);
|
||||
$graphs['cambium_generic_whispGPSStats'] = TRUE;
|
||||
$graphs['cambium_generic_whispGPSStats'] = true;
|
||||
unset($rrd_filename,$gpsStatus);
|
||||
}
|
||||
|
||||
$visible = str_replace('"',"",snmp_get($device, ".1.3.6.1.4.1.161.19.3.4.4.7.0", "-Ovqn", ""));
|
||||
$tracked = str_replace('"',"",snmp_get($device, ".1.3.6.1.4.1.161.19.3.4.4.8.0", "-Ovqn", ""));
|
||||
$visible = str_replace('"', "", snmp_get($device, ".1.3.6.1.4.1.161.19.3.4.4.7.0", "-Ovqn", ""));
|
||||
$tracked = str_replace('"', "", snmp_get($device, ".1.3.6.1.4.1.161.19.3.4.4.8.0", "-Ovqn", ""));
|
||||
if (is_numeric($visible) && is_numeric($tracked)) {
|
||||
$rrd_def = array(
|
||||
'DS:visible:GAUGE:600:0:1000',
|
||||
@@ -163,26 +161,26 @@ if (strstr($hardware, 'AP') || strstr($hardware, 'Master') || strstr($hardware,
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-gpsStats', $tags, $fields);
|
||||
$graphs['cambium_generic_gpsStats'] = TRUE;
|
||||
$graphs['cambium_generic_gpsStats'] = true;
|
||||
unset($rrd_filename,$visible,$tracked);
|
||||
}
|
||||
}
|
||||
//PTP Equipment
|
||||
$lastLevel = str_replace('"',"",snmp_get($device, "lastPowerLevel.2", "-Ovqn", "WHISP-APS-MIB"));
|
||||
if (is_numeric($lastLevel)) {
|
||||
$rrd_def = 'DS:last:GAUGE:600:-100:0';
|
||||
$fields = array(
|
||||
'last' => $lastLevel,
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-450-powerlevel', $tags, $fields);
|
||||
$graphs['cambium_generic_450_powerlevel'] = TRUE;
|
||||
unset($lastLevel);
|
||||
}
|
||||
$lastLevel = str_replace('"', "", snmp_get($device, "lastPowerLevel.2", "-Ovqn", "WHISP-APS-MIB"));
|
||||
if (is_numeric($lastLevel)) {
|
||||
$rrd_def = 'DS:last:GAUGE:600:-100:0';
|
||||
$fields = array(
|
||||
'last' => $lastLevel,
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-450-powerlevel', $tags, $fields);
|
||||
$graphs['cambium_generic_450_powerlevel'] = true;
|
||||
unset($lastLevel);
|
||||
}
|
||||
|
||||
if (strstr($version, 'AP') == false) {
|
||||
$horizontal = str_replace('"',"",snmp_get($device, "linkRadioDbmHorizontal.2", "-Ovqn", "WHISP-APS-MIB"));
|
||||
$vertical = str_replace('"',"",snmp_get($device, "linkRadioDbmVertical.2", "-Ovqn", "WHISP-APS-MIB"));
|
||||
$horizontal = str_replace('"', "", snmp_get($device, "linkRadioDbmHorizontal.2", "-Ovqn", "WHISP-APS-MIB"));
|
||||
$vertical = str_replace('"', "", snmp_get($device, "linkRadioDbmVertical.2", "-Ovqn", "WHISP-APS-MIB"));
|
||||
if (is_numeric($horizontal) && is_numeric($vertical)) {
|
||||
$rrd_def = array(
|
||||
'DS:horizontal:GAUGE:600:-100:0',
|
||||
@@ -194,12 +192,12 @@ if (strstr($version, 'AP') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-450-linkRadioDbm', $tags, $fields);
|
||||
$graphs['cambium_generic_450_linkRadioDbm'] = TRUE;
|
||||
$graphs['cambium_generic_450_linkRadioDbm'] = true;
|
||||
unset($rrd_filename,$horizontal,$horizontal);
|
||||
}
|
||||
|
||||
$horizontal = str_replace('"',"",snmp_get($device, "signalToNoiseRatioHorizontal.2", "-Ovqn", "WHISP-APS-MIB"));
|
||||
$vertical = str_replace('"',"",snmp_get($device, "signalToNoiseRatioVertical.2", "-Ovqn", "WHISP-APS-MIB"));
|
||||
$horizontal = str_replace('"', "", snmp_get($device, "signalToNoiseRatioHorizontal.2", "-Ovqn", "WHISP-APS-MIB"));
|
||||
$vertical = str_replace('"', "", snmp_get($device, "signalToNoiseRatioVertical.2", "-Ovqn", "WHISP-APS-MIB"));
|
||||
if (is_numeric($horizontal) && is_numeric($vertical)) {
|
||||
$rrd_def = array(
|
||||
'DS:horizontal:GAUGE:600:0:100',
|
||||
@@ -211,27 +209,27 @@ if (strstr($version, 'AP') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-450-ptpSNR', $tags, $fields);
|
||||
$graphs['cambium_generic_450_ptpSNR'] = TRUE;
|
||||
$graphs['cambium_generic_450_ptpSNR'] = true;
|
||||
unset($rrd_filename,$horizontal,$horizontal);
|
||||
}
|
||||
|
||||
$ssr = str_replace('"',"",snmp_get($device, "linkSignalStrengthRatio.2", "-Ovqn", "WHISP-APS-MIB"));
|
||||
$ssr = str_replace('"', "", snmp_get($device, "linkSignalStrengthRatio.2", "-Ovqn", "WHISP-APS-MIB"));
|
||||
if (is_numeric($ssr)) {
|
||||
$rrd_def = 'DS:ssr:GAUGE:600:-150:150';
|
||||
$fields = array(
|
||||
$rrd_def = 'DS:ssr:GAUGE:600:-150:150';
|
||||
$fields = array(
|
||||
'ssr' => $ssr,
|
||||
);
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-450-masterSSR', $tags, $fields);
|
||||
$graphs['cambium_generic_450_masterSSR'] = TRUE;
|
||||
unset($rrd_filename,$ssr);
|
||||
$graphs['cambium_generic_450_masterSSR'] = true;
|
||||
unset($rrd_filename,$ssr);
|
||||
}
|
||||
|
||||
if (strstr($hardware, 'PTP 230')) {
|
||||
$dbmRadio = str_replace('"',"",snmp_get($device, "radioDbmInt.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
$minRadio = str_replace('"',"",snmp_get($device, "minRadioDbm.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
$maxRadio = str_replace('"',"",snmp_get($device, "maxRadioDbm.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
$avgRadio = str_replace('"',"",snmp_get($device, "radioDbmAvg.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
if (strstr($hardware, 'PTP 230')) {
|
||||
$dbmRadio = str_replace('"', "", snmp_get($device, "radioDbmInt.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
$minRadio = str_replace('"', "", snmp_get($device, "minRadioDbm.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
$maxRadio = str_replace('"', "", snmp_get($device, "maxRadioDbm.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
$avgRadio = str_replace('"', "", snmp_get($device, "radioDbmAvg.0", "-Ovqn", "WHISP-SM-MIB"));
|
||||
|
||||
if (is_numeric($dbmRadio) && is_numeric($minRadio) && is_numeric($maxRadio) && is_numeric($avgRadio)) {
|
||||
$rrd_def = array(
|
||||
@@ -248,7 +246,7 @@ if (strstr($version, 'AP') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-radioDbm', $tags, $fields);
|
||||
$graphs['cambium_generic_radioDbm'] = TRUE;
|
||||
$graphs['cambium_generic_radioDbm'] = true;
|
||||
unset($rrd_filename,$dbmRadio,$minRadio,$maxRadio,$avgRadio);
|
||||
}
|
||||
}
|
||||
@@ -256,8 +254,8 @@ if (strstr($version, 'AP') == false) {
|
||||
|
||||
//AP Equipment
|
||||
if (strstr($version, 'AP')) {
|
||||
$registered = str_replace('"',"",snmp_get($device, "regCount.0", "-Ovqn", "WHISP-APS-MIB"));
|
||||
$failed = str_replace('"',"",snmp_get($device, "regFailureCount.0", "-Ovqn", "WHISP-APS-MIB"));
|
||||
$registered = str_replace('"', "", snmp_get($device, "regCount.0", "-Ovqn", "WHISP-APS-MIB"));
|
||||
$failed = str_replace('"', "", snmp_get($device, "regFailureCount.0", "-Ovqn", "WHISP-APS-MIB"));
|
||||
if (is_numeric($registered) && is_numeric($failed)) {
|
||||
$rrd_def = array(
|
||||
'DS:regCount:GAUGE:600:0:15000',
|
||||
@@ -269,17 +267,16 @@ if (strstr($version, 'AP')) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-regCount', $tags, $fields);
|
||||
$graphs['cambium_generic_regCount'] = TRUE;
|
||||
$graphs['cambium_generic_regCount'] = true;
|
||||
unset($rrd_filename,$registered,$failed);
|
||||
}
|
||||
|
||||
$freq = str_replace('"',"",snmp_get($device, "currentRadioFreqCarrier.0", "-Ovqn", "WHISP-APS-MIB"));
|
||||
$freq = str_replace('"', "", snmp_get($device, "currentRadioFreqCarrier.0", "-Ovqn", "WHISP-APS-MIB"));
|
||||
if (is_numeric($freq)) {
|
||||
$rrd_def = 'DS:freq:GAUGE:600:0:100000';
|
||||
if ($freq > 99999) {
|
||||
$freq = $freq / 100000;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$freq = $freq / 10000;
|
||||
}
|
||||
$fields = array(
|
||||
@@ -287,7 +284,7 @@ if (strstr($version, 'AP')) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cambium-generic-freq', $tags, $fields);
|
||||
$graphs['cambium_generic_freq'] = TRUE;
|
||||
$graphs['cambium_generic_freq'] = true;
|
||||
unset($rrd_filename,$freq);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ if (strstr($hardware, 'CMM') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-errorCount', $tags, $fields);
|
||||
$graphs['canopy_generic_errorCount'] = TRUE;
|
||||
$graphs['canopy_generic_errorCount'] = true;
|
||||
unset($rrd_filename, $fecInErrorsCount, $fecOutErrorsCount);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ if (strstr($hardware, 'CMM') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-crcErrors', $tags, $fields);
|
||||
$graphs['canopy_generic_crcErrors'] = TRUE;
|
||||
$graphs['canopy_generic_crcErrors'] = true;
|
||||
}
|
||||
|
||||
$vertical = str_replace('"', "", snmp_get($device, ".1.3.6.1.4.1.161.19.3.2.2.117.0", "-Ovqn", ""));
|
||||
@@ -54,7 +54,7 @@ if (strstr($hardware, 'CMM') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-signalHV', $tags, $fields);
|
||||
$graphs['canopy_generic_signalHV'] = TRUE;
|
||||
$graphs['canopy_generic_signalHV'] = true;
|
||||
unset($rrd_filename, $vertical, $horizontal, $combined);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ if (strstr($hardware, 'CMM') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-rssi', $tags, $fields);
|
||||
$graphs['canopy_generic_rssi'] = TRUE;
|
||||
$graphs['canopy_generic_rssi'] = true;
|
||||
unset($rrd_filename, $rssi);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ if (strstr($hardware, 'CMM') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-jitter', $tags, $fields);
|
||||
$graphs['canopy_generic_jitter'] = TRUE;
|
||||
$graphs['canopy_generic_jitter'] = true;
|
||||
unset($rrd_filename, $jitter);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ if (strstr($hardware, 'CMM') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-450-slaveHV', $tags, $fields);
|
||||
$graphs['canopy_generic_450_slaveHV'] = TRUE;
|
||||
$graphs['canopy_generic_450_slaveHV'] = true;
|
||||
unset($rrd_filename, $horizontal, $vertical);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ if (strstr($hardware, 'CMM') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-450-slaveSSR', $tags, $fields);
|
||||
$graphs['canopy_generic_450_slaveSSR'] = TRUE;
|
||||
$graphs['canopy_generic_450_slaveSSR'] = true;
|
||||
unset($rrd_filename, $ssr);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ if (strstr($hardware, 'CMM') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-450-slaveSNR', $tags, $fields);
|
||||
$graphs['canopy_generic_450_slaveSNR'] = TRUE;
|
||||
$graphs['canopy_generic_450_slaveSNR'] = true;
|
||||
unset($rrd_filename, $horizontal, $vertical);
|
||||
}
|
||||
}
|
||||
@@ -134,9 +134,9 @@ if (strstr($hardware, 'AP') || strstr($hardware, 'Master') || strstr($hardware,
|
||||
$gpsStatus = snmp_get($device, "whispGPSStats.0", "-Ovqn", "WHISP-APS-MIB");
|
||||
if ($gpsStatus == 'generatingSync') {
|
||||
$gpsStatus = 3;
|
||||
} else if ($gpsStatus == 'gpsLostSync') {
|
||||
} elseif ($gpsStatus == 'gpsLostSync') {
|
||||
$gpsStatus = 2;
|
||||
} else if ($gpsStatus == 'gpsSynchronized') {
|
||||
} elseif ($gpsStatus == 'gpsSynchronized') {
|
||||
$gpsStatus = 1;
|
||||
}
|
||||
if (is_numeric($gpsStatus)) {
|
||||
@@ -146,7 +146,7 @@ if (strstr($hardware, 'AP') || strstr($hardware, 'Master') || strstr($hardware,
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-whispGPSStats', $tags, $fields);
|
||||
$graphs['canopy_generic_whispGPSStats'] = TRUE;
|
||||
$graphs['canopy_generic_whispGPSStats'] = true;
|
||||
unset($rrd_filename, $gpsStatus);
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ if (strstr($hardware, 'AP') || strstr($hardware, 'Master') || strstr($hardware,
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-gpsStats', $tags, $fields);
|
||||
$graphs['canopy_generic_gpsStats'] = TRUE;
|
||||
$graphs['canopy_generic_gpsStats'] = true;
|
||||
unset($rrd_filename, $visible, $tracked);
|
||||
}
|
||||
}
|
||||
@@ -182,7 +182,7 @@ if (strstr($version, 'AP') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-450-linkRadioDbm', $tags, $fields);
|
||||
$graphs['canopy_generic_450_linkRadioDbm'] = TRUE;
|
||||
$graphs['canopy_generic_450_linkRadioDbm'] = true;
|
||||
unset($rrd_filename, $horizontal, $horizontal);
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ if (strstr($version, 'AP') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-450-powerlevel', $tags, $fields);
|
||||
$graphs['canopy_generic_450_powerlevel'] = TRUE;
|
||||
$graphs['canopy_generic_450_powerlevel'] = true;
|
||||
unset($lastLevel);
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ if (strstr($version, 'AP') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-450-ptpSNR', $tags, $fields);
|
||||
$graphs['canopy_generic_450_ptpSNR'] = TRUE;
|
||||
$graphs['canopy_generic_450_ptpSNR'] = true;
|
||||
unset($rrd_filename, $horizontal, $horizontal);
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ if (strstr($version, 'AP') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-450-masterSSR', $tags, $fields);
|
||||
$graphs['canopy_generic_450_masterSSR'] = TRUE;
|
||||
$graphs['canopy_generic_450_masterSSR'] = true;
|
||||
unset($rrd_filename, $ssr);
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ if (strstr($version, 'AP') == false) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-radioDbm', $tags, $fields);
|
||||
$graphs['canopy_generic_radioDbm'] = TRUE;
|
||||
$graphs['canopy_generic_radioDbm'] = true;
|
||||
unset($rrd_filename, $dbmRadio, $minRadio, $maxRadio, $avgRadio);
|
||||
}
|
||||
}
|
||||
@@ -270,7 +270,7 @@ if (strstr($version, 'AP')) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-regCount', $tags, $fields);
|
||||
$graphs['canopy_generic_regCount'] = TRUE;
|
||||
$graphs['canopy_generic_regCount'] = true;
|
||||
unset($rrd_filename, $registered, $failed);
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ if (strstr($version, 'AP')) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'canopy-generic-freq', $tags, $fields);
|
||||
$graphs['canopy_generic_freq'] = TRUE;
|
||||
$graphs['canopy_generic_freq'] = true;
|
||||
unset($rrd_filename, $freq);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ if (is_numeric($rssi)) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cisco-wwan-rssi', $tags, $fields);
|
||||
$graphs['cisco_wwan_rssi'] = TRUE;
|
||||
$graphs['cisco_wwan_rssi'] = true;
|
||||
}
|
||||
|
||||
$mnc = snmp_get($device, "CISCO-WAN-3G-MIB::c3gGsmMnc.13", "-Ovqn", "CISCO-WAN-3G-MIB");
|
||||
@@ -28,6 +28,6 @@ if (is_numeric($mnc)) {
|
||||
);
|
||||
$tags = compact('rrd_def');
|
||||
data_update($device, 'cisco-wwan-rssi', $tags, $fields);
|
||||
$graphs['cisco-wwan-mnc'] = TRUE;
|
||||
$graphs['cisco-wwan-mnc'] = true;
|
||||
}
|
||||
unset($rrd_def, $rssi, $mnc, $fields, $tags);
|
||||
|
@@ -5,7 +5,7 @@ $dataRate = snmpwalk_cache_oid($device, 'XIRRUS-MIB::realtimeMonitorAverageDataR
|
||||
$noiseFloor = snmpwalk_cache_oid($device, 'XIRRUS-MIB::realtimeMonitorNoiseFloor', array(), 'XIRRUS-MIB');
|
||||
$associations=array();
|
||||
|
||||
foreach($radios as $idx => $radio) {
|
||||
foreach ($radios as $idx => $radio) {
|
||||
$radioName = $radio['realtimeMonitorIfaceName'];
|
||||
$associations[$radioName]=0;
|
||||
|
||||
@@ -32,13 +32,14 @@ if ($config['xirrus_disable_stations']!=true) {
|
||||
// station associations
|
||||
// custom RRDs and graph as each AP may have 16 radios
|
||||
$assoc = snmpwalk_cache_oid($device, 'XIRRUS-MIB::stationAssociationIAP', array(), 'XIRRUS-MIB');
|
||||
foreach($assoc as $s) {
|
||||
foreach ($assoc as $s) {
|
||||
$radio = array_pop($s);
|
||||
$associations[$radio]++;
|
||||
}
|
||||
unset($radio); unset($assoc);
|
||||
unset($radio);
|
||||
unset($assoc);
|
||||
// write to rrds
|
||||
foreach($associations as $radio => $count) {
|
||||
foreach ($associations as $radio => $count) {
|
||||
$measurement = 'xirrus_users';
|
||||
$rrd_name = array($measurement, $radio);
|
||||
$rrd_def = 'DS:stations:GAUGE:600:0:3200';
|
||||
@@ -48,15 +49,15 @@ if ($config['xirrus_disable_stations']!=true) {
|
||||
$tags = compact('radio', 'rrd_name', 'rrd_def');
|
||||
data_update($device, $measurement, $tags, $fields);
|
||||
}
|
||||
$graphs['xirrus_stations'] = TRUE;
|
||||
$graphs['xirrus_stations'] = true;
|
||||
} else {
|
||||
$graphs['xirrus_stations'] = FALSE;
|
||||
$graphs['xirrus_stations'] = false;
|
||||
}
|
||||
|
||||
$graphs['xirrus_rssi'] = TRUE;
|
||||
$graphs['xirrus_dataRates'] = TRUE;
|
||||
$graphs['xirrus_noiseFloor'] = TRUE;
|
||||
$graphs['xirrus_stations'] = TRUE;
|
||||
$graphs['xirrus_rssi'] = true;
|
||||
$graphs['xirrus_dataRates'] = true;
|
||||
$graphs['xirrus_noiseFloor'] = true;
|
||||
$graphs['xirrus_stations'] = true;
|
||||
|
||||
// cleanup
|
||||
unset($rrd_def, $radios, $rssi, $radioName, $associations, $tags, $fields, $measurement);
|
||||
unset($rrd_def, $radios, $rssi, $radioName, $associations, $tags, $fields, $measurement);
|
||||
|
Reference in New Issue
Block a user