Apply fixes from StyleCI (#14899)

Co-authored-by: StyleCI Bot <bot@styleci.io>
This commit is contained in:
Jellyfrog 2023-03-13 22:32:22 +01:00 committed by GitHub
parent 0e322ae5d5
commit 68e0b3df28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
220 changed files with 2050 additions and 2035 deletions

View File

@ -39,7 +39,6 @@ class AlertRules
{ {
public function runRules($device_id) public function runRules($device_id)
{ {
//Check to see if under maintenance //Check to see if under maintenance
if (AlertUtil::isMaintenance($device_id) > 0) { if (AlertUtil::isMaintenance($device_id) > 0) {
echo "Under Maintenance, skipping alert rules check.\r\n"; echo "Under Maintenance, skipping alert rules check.\r\n";

View File

@ -70,7 +70,7 @@ class Alertmanager extends Transport
unset($api['url']); unset($api['url']);
foreach ($api as $label => $value) { foreach ($api as $label => $value) {
// To allow dynamic values // To allow dynamic values
if ((preg_match('/^extra_[A-Za-z0-9_]+$/', $label)) && (! empty($obj['faults'][1][$value]))) { if (preg_match('/^extra_[A-Za-z0-9_]+$/', $label) && (! empty($obj['faults'][1][$value]))) {
$data[0]['labels'][$label] = $obj['faults'][1][$value]; $data[0]['labels'][$label] = $obj['faults'][1][$value];
} else { } else {
$data[0]['labels'][$label] = $value; $data[0]['labels'][$label] = $value;

View File

@ -90,7 +90,6 @@ class Boxcar extends Transport
default: default:
$title_text = $severity; $title_text = $severity;
break; break;
} }
$data['notification[title]'] = $title_text . ' - ' . $obj['hostname'] . ' - ' . $obj['name']; $data['notification[title]'] = $title_text . ' - ' . $obj['hostname'] . ' - ' . $obj['name'];
$message_text = 'Timestamp: ' . $obj['timestamp']; $message_text = 'Timestamp: ' . $obj['timestamp'];

View File

@ -21,6 +21,7 @@
* *
* @copyright 2018 Ryan Finney * @copyright 2018 Ryan Finney
* @author https://github.com/theherodied/ * @author https://github.com/theherodied/
*
* @contributer f0o, sdef2 * @contributer f0o, sdef2
* Thanks to F0o <f0o@devilcode.org> for creating the Slack transport which is the majority of this code. * Thanks to F0o <f0o@devilcode.org> for creating the Slack transport which is the majority of this code.
* Thanks to sdef2 for figuring out the differences needed to make Discord work. * Thanks to sdef2 for figuring out the differences needed to make Discord work.

View File

@ -56,7 +56,7 @@ class Telegram extends Transport
if (! empty($data['message_thread_id'])) { if (! empty($data['message_thread_id'])) {
$messageThreadId = '&message_thread_id=' . $data['message_thread_id']; $messageThreadId = '&message_thread_id=' . $data['message_thread_id'];
} }
curl_setopt($curl, CURLOPT_URL, ("https://api.telegram.org/bot{$data['token']}/sendMessage?chat_id={$data['chat_id']}$messageThreadId&text=$text{$format}")); curl_setopt($curl, CURLOPT_URL, "https://api.telegram.org/bot{$data['token']}/sendMessage?chat_id={$data['chat_id']}$messageThreadId&text=$text{$format}");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$ret = curl_exec($curl); $ret = curl_exec($curl);
$code = curl_getinfo($curl, CURLINFO_HTTP_CODE); $code = curl_getinfo($curl, CURLINFO_HTTP_CODE);

View File

@ -70,7 +70,7 @@ class QueryBuilderFilter implements \JsonSerializable
continue; // don't include the time based macros, they don't work like that continue; // don't include the time based macros, they don't work like that
} }
if ((Str::endsWith($key, '_usage_perc')) || (Str::startsWith($key, 'packet_loss_'))) { if (Str::endsWith($key, '_usage_perc') || Str::startsWith($key, 'packet_loss_')) {
$this->filter[$field] = [ $this->filter[$field] = [
'id' => $field, 'id' => $field,
'type' => 'integer', 'type' => 'integer',

View File

@ -347,11 +347,11 @@ class NetSnmpQuery implements SnmpQueryInterface
case 'authpriv': case 'authpriv':
array_push($cmd, '-x', $this->device->cryptoalgo); array_push($cmd, '-x', $this->device->cryptoalgo);
array_push($cmd, '-X', $this->device->cryptopass); array_push($cmd, '-X', $this->device->cryptopass);
// fallthrough // fallthrough
case 'authnopriv': case 'authnopriv':
array_push($cmd, '-a', $this->device->authalgo); array_push($cmd, '-a', $this->device->authalgo);
array_push($cmd, '-A', $this->device->authpass); array_push($cmd, '-A', $this->device->authpass);
// fallthrough // fallthrough
case 'noauthnopriv': case 'noauthnopriv':
array_push($cmd, '-u', $this->device->authname ?: 'root'); array_push($cmd, '-u', $this->device->authname ?: 'root');
break; break;

View File

@ -656,9 +656,9 @@ class Rrd extends BaseDatastore
$substr_count_length = $length <= 0 ? null : min(strlen($descr), $length); $substr_count_length = $length <= 0 ? null : min(strlen($descr), $length);
$extra = substr_count($descr, ':', 0, $substr_count_length); $extra = substr_count($descr, ':', 0, $substr_count_length);
$result = substr(str_pad($result, $length), 0, ($length + $extra)); $result = substr(str_pad($result, $length), 0, $length + $extra);
if ($extra > 0) { if ($extra > 0) {
$result = substr($result, 0, (-1 * $extra)); $result = substr($result, 0, -1 * $extra);
} }
} }

View File

@ -27,7 +27,7 @@ namespace LibreNMS\Enum;
use LibreNMS\Config; use LibreNMS\Config;
enum ImageFormat : string enum ImageFormat: string
{ {
case png = 'png'; case png = 'png';
case svg = 'svg'; case svg = 'svg';

View File

@ -225,7 +225,7 @@ class IRCBot
return false; return false;
} }
if (($this->socket['alert'] = fopen($f, 'r+'))) { if ($this->socket['alert'] = fopen($f, 'r+')) {
$this->log('Opened Alert-File'); $this->log('Opened Alert-File');
stream_set_blocking($this->socket['alert'], false); stream_set_blocking($this->socket['alert'], false);
@ -246,7 +246,7 @@ class IRCBot
$r = strlen($r); $r = strlen($r);
if (strstr($this->buff[$buff], "\n")) { if (strstr($this->buff[$buff], "\n")) {
$tmp = explode("\n", $this->buff[$buff], 2); $tmp = explode("\n", $this->buff[$buff], 2);
$this->buff[$buff] = substr($this->buff[$buff], (strlen($tmp[0]) + 1)); $this->buff[$buff] = substr($this->buff[$buff], strlen($tmp[0]) + 1);
if ($this->debug) { if ($this->debug) {
$this->log("Returning buffer '$buff': '" . trim($tmp[0]) . "'"); $this->log("Returning buffer '$buff': '" . trim($tmp[0]) . "'");
} }
@ -369,7 +369,7 @@ class IRCBot
} }
} }
if (($this->config['irc_ctcp']) && (preg_match('/^:' . chr(1) . '.*/', $ex[3]))) { if ($this->config['irc_ctcp'] && preg_match('/^:' . chr(1) . '.*/', $ex[3])) {
// Handle CTCP // Handle CTCP
$ctcp = trim(preg_replace('/[^A-Z]/', '', $ex[3])); $ctcp = trim(preg_replace('/[^A-Z]/', '', $ex[3]));
$ctcp_reply = null; $ctcp_reply = null;
@ -529,7 +529,7 @@ class IRCBot
if ($try > $this->max_retry) { if ($try > $this->max_retry) {
$this->log('Failed too many connection attempts, aborting'); $this->log('Failed too many connection attempts, aborting');
return exit(); return exit;
} }
$this->log('Trying to connect (' . ($try + 1) . ') to ' . $this->server . ':' . $this->port . ($this->ssl ? ' (SSL)' : '')); $this->log('Trying to connect (' . ($try + 1) . ') to ' . $this->server . ':' . $this->port . ($this->ssl ? ' (SSL)' : ''));
@ -612,7 +612,7 @@ class IRCBot
} catch (\PDOException $e) { } catch (\PDOException $e) {
$this->log('Cannot connect to MySQL: ' . $e->getMessage()); $this->log('Cannot connect to MySQL: ' . $e->getMessage());
return exit(); return exit;
} }
} }
@ -765,7 +765,7 @@ class IRCBot
if ($this->user['level'] == 10) { if ($this->user['level'] == 10) {
$this->ircRaw('QUIT :Requested'); $this->ircRaw('QUIT :Requested');
return exit(); return exit;
} else { } else {
return $this->respond('Permission denied.'); return $this->respond('Permission denied.');
} }

View File

@ -112,7 +112,7 @@ class PrinterSupplies implements Module
'toner', 'toner',
Alert::NOTICE, Alert::NOTICE,
$toner['supply_id'] $toner['supply_id']
); );
} }
$toner->supply_current = $tonerperc; $toner->supply_current = $tonerperc;

View File

@ -89,7 +89,7 @@ class Allied extends OS implements OSDiscovery
$serial = snmp_get($this->getDeviceArray(), 'arBoardSerialNumber.1', '-OsvQU', 'AT-INTERFACES-MIB'); $serial = snmp_get($this->getDeviceArray(), 'arBoardSerialNumber.1', '-OsvQU', 'AT-INTERFACES-MIB');
//AT-GS950/24 Gigabit Ethernet WebSmart Switch //AT-GS950/24 Gigabit Ethernet WebSmart Switch
//Also requires system description as no OIDs provide $hardware //Also requires system description as no OIDs provide $hardware
} elseif ($d == 'WebSmart' && $e == 'Switch') { } elseif ($d == 'WebSmart' && $e == 'Switch') {
$version = snmp_get($this->getDeviceArray(), 'swhub.167.81.1.3.0', '-OsvQU', 'AtiL2-MIB'); $version = snmp_get($this->getDeviceArray(), 'swhub.167.81.1.3.0', '-OsvQU', 'AtiL2-MIB');
$version = $d . ' ' . $version; $version = $d . ' ' . $version;

View File

@ -34,9 +34,9 @@ use LibreNMS\OS\Shared\Fortinet;
use LibreNMS\RRD\RrdDefinition; use LibreNMS\RRD\RrdDefinition;
class Fortigate extends Fortinet implements class Fortigate extends Fortinet implements
OSPolling, OSPolling,
WirelessClientsDiscovery, WirelessClientsDiscovery,
WirelessApCountDiscovery WirelessApCountDiscovery
{ {
public function discoverOS(Device $device): void public function discoverOS(Device $device): void
{ {

View File

@ -13,8 +13,7 @@ class Ruckuswireless extends OS implements
{ {
public function discoverWirelessClients() public function discoverWirelessClients()
{ {
// Find Per SSID Client Count
// Find Per SSID Client Count
$sensors = []; $sensors = [];
$ssids = $this->getCacheByIndex('ruckusZDWLANSSID', 'RUCKUS-ZD-WLAN-MIB'); $ssids = $this->getCacheByIndex('ruckusZDWLANSSID', 'RUCKUS-ZD-WLAN-MIB');
$counts = $this->getCacheByIndex('ruckusZDWLANNumSta', 'RUCKUS-ZD-WLAN-MIB'); $counts = $this->getCacheByIndex('ruckusZDWLANNumSta', 'RUCKUS-ZD-WLAN-MIB');
@ -42,7 +41,7 @@ class Ruckuswireless extends OS implements
if (count($total_oids) > 1) { if (count($total_oids) > 1) {
// Find Total Client Count // Find Total Client Count
$oid = '.1.3.6.1.4.1.25053.1.2.1.1.1.15.2.0'; //RUCKUS-ZD-SYSTEM-MIB::ruckusZDSystemStatsNumSta.0 $oid = '.1.3.6.1.4.1.25053.1.2.1.1.1.15.2.0'; //RUCKUS-ZD-SYSTEM-MIB::ruckusZDSystemStatsNumSta.0
array_push($sensors, new WirelessSensor('clients', $this->getDeviceId(), $oid, 'ruckuswireless', ($index + 1), 'System Total:')); array_push($sensors, new WirelessSensor('clients', $this->getDeviceId(), $oid, 'ruckuswireless', $index + 1, 'System Total:'));
} }
return $sensors; return $sensors;
@ -56,13 +55,13 @@ class Ruckuswireless extends OS implements
$oidtotal = '.1.3.6.1.4.1.25053.1.2.1.1.1.15.15.0'; //RUCKUS-ZD-SYSTEM-MIB::ruckusZDSystemStatsNumRegisteredAP.0 $oidtotal = '.1.3.6.1.4.1.25053.1.2.1.1.1.15.15.0'; //RUCKUS-ZD-SYSTEM-MIB::ruckusZDSystemStatsNumRegisteredAP.0
$sensorindex = 0; $sensorindex = 0;
$sensors[] = new WirelessSensor( $sensors[] = new WirelessSensor(
'ap-count', 'ap-count',
$this->getDeviceId(), $this->getDeviceId(),
$oidconnected, $oidconnected,
'ruckuswireless', 'ruckuswireless',
++$sensorindex, ++$sensorindex,
'Connected APs' 'Connected APs'
); );
array_push($sensors, new WirelessSensor('ap-count', $this->getDeviceId(), $oidtotal, 'ruckuswireless', ++$sensorindex, 'Total APs')); array_push($sensors, new WirelessSensor('ap-count', $this->getDeviceId(), $oidtotal, 'ruckuswireless', ++$sensorindex, 'Total APs'));

View File

@ -55,7 +55,7 @@ class RuckuswirelessSz extends OS implements
if (count($total_oids) > 1) { if (count($total_oids) > 1) {
// clients - Discover System Total Client Count // clients - Discover System Total Client Count
$oid = '.1.3.6.1.4.1.25053.1.4.1.1.1.15.2.0'; //RUCKUS-SZ-SYSTEM-MIB::ruckusSZSystemStatsNumSta.0 $oid = '.1.3.6.1.4.1.25053.1.4.1.1.1.15.2.0'; //RUCKUS-SZ-SYSTEM-MIB::ruckusSZSystemStatsNumSta.0
array_push($sensors, new WirelessSensor('clients', $this->getDeviceId(), $oid, 'ruckuswireless-sz', ($index + 1), 'System Total:')); array_push($sensors, new WirelessSensor('clients', $this->getDeviceId(), $oid, 'ruckuswireless-sz', $index + 1, 'System Total:'));
} }
return $sensors; return $sensors;

View File

@ -430,7 +430,7 @@ class Cisco extends OS implements
$rtt_type = $sla->rtt_type; $rtt_type = $sla->rtt_type;
// Lets process each SLA // Lets process each SLA
$unixtime = intval(($data[$sla_nr]['rttMonLatestRttOperTime'] / 100 + $time_offset)); $unixtime = intval($data[$sla_nr]['rttMonLatestRttOperTime'] / 100 + $time_offset);
$time = date('Y-m-d H:i:s', $unixtime); $time = date('Y-m-d H:i:s', $unixtime);
// Save data // Save data

View File

@ -57,7 +57,7 @@ class Zyxel extends OS
return; return;
} }
$device->hardware = $data['.1.3.6.1.4.1.890.1.15.3.1.11.0'] ?? null; $device->hardware = $data['.1.3.6.1.4.1.890.1.15.3.1.11.0'] ?? null;
[$device->version,] = explode(' | ', $data['.1.3.6.1.4.1.890.1.15.3.1.6.0'] ?? null); [$device->version] = explode(' | ', $data['.1.3.6.1.4.1.890.1.15.3.1.6.0'] ?? null);
$device->serial = $data['.1.3.6.1.4.1.890.1.15.3.1.12.0'] ?? null; $device->serial = $data['.1.3.6.1.4.1.890.1.15.3.1.12.0'] ?? null;
} }
} }

View File

@ -37,7 +37,7 @@ class ThreeCom extends OS implements OSDiscovery
if (Str::contains($device->sysDescr, 'Software')) { if (Str::contains($device->sysDescr, 'Software')) {
$device->hardware = str_replace('3Com ', '', substr($device->sysDescr, 0, strpos($device->sysDescr, 'Software'))); $device->hardware = str_replace('3Com ', '', substr($device->sysDescr, 0, strpos($device->sysDescr, 'Software')));
// Version is the last word in the sysDescr's first line // Version is the last word in the sysDescr's first line
[$device->version] = explode("\n", substr($device->sysDescr, (strpos($device->sysDescr, 'Version') + 8))); [$device->version] = explode("\n", substr($device->sysDescr, strpos($device->sysDescr, 'Version') + 8));
return; return;
} }

View File

@ -467,7 +467,7 @@ class Vrp extends OS implements
// We have at least 1 SSID, so we can count the total of STA // We have at least 1 SSID, so we can count the total of STA
$sensors[] = new WirelessSensor( $sensors[] = new WirelessSensor(
'clients', 'clients',
$this->getDeviceId(), $this->getDeviceId(),
$ssid_total_oid_array, $ssid_total_oid_array,
'vrp-clients', 'vrp-clients',
'total-all-ssids', 'total-all-ssids',

View File

@ -20,18 +20,18 @@ class HpFault implements SnmptrapHandler
{ {
$type = $trap->getOidData($trap->findOid('HP-ICF-FAULT-FINDER-MIB::hpicfFfLogFaultType')); $type = $trap->getOidData($trap->findOid('HP-ICF-FAULT-FINDER-MIB::hpicfFfLogFaultType'));
switch ($type) { switch ($type) {
case 'badXcvr': case 'badXcvr':
$trap->log('Fault - CRC Error ' . $trap->getOidData($trap->findOid('HP-ICF-FAULT-FINDER-MIB::hpicfFfFaultInfoURL')), 4, $type); $trap->log('Fault - CRC Error ' . $trap->getOidData($trap->findOid('HP-ICF-FAULT-FINDER-MIB::hpicfFfFaultInfoURL')), 4, $type);
break; break;
case 'badCable': case 'badCable':
$trap->log('Fault - Bad Cable ' . $trap->getOidData($trap->findOid('HP-ICF-FAULT-FINDER-MIB::hpicfFfFaultInfoURL')), 4, $type); $trap->log('Fault - Bad Cable ' . $trap->getOidData($trap->findOid('HP-ICF-FAULT-FINDER-MIB::hpicfFfFaultInfoURL')), 4, $type);
break; break;
case 'bcastStorm': case 'bcastStorm':
$trap->log('Fault - Broadcaststorm ' . $trap->getOidData($trap->findOid('HP-ICF-FAULT-FINDER-MIB::hpicfFfFaultInfoURL')), 5, $type); $trap->log('Fault - Broadcaststorm ' . $trap->getOidData($trap->findOid('HP-ICF-FAULT-FINDER-MIB::hpicfFfFaultInfoURL')), 5, $type);
break; break;
default: default:
$trap->log('Fault - Unhandled ' . $trap->getOidData($trap->findOid('HP-ICF-FAULT-FINDER-MIB::hpicfFfFaultInfoURL')), 2, $type); $trap->log('Fault - Unhandled ' . $trap->getOidData($trap->findOid('HP-ICF-FAULT-FINDER-MIB::hpicfFfFaultInfoURL')), 2, $type);
break; break;
} }
} }
} }

View File

@ -295,7 +295,7 @@ SVG;
$px = (int) ((imagesx($img) - 7.5 * strlen($text)) / 2); $px = (int) ((imagesx($img) - 7.5 * strlen($text)) / 2);
$font = $width < 200 ? 3 : 5; $font = $width < 200 ? 3 : 5;
imagestring($img, $font, $px, ($height / 2 - 8), $text, imagecolorallocate($img, ...$color)); imagestring($img, $font, $px, $height / 2 - 8, $text, imagecolorallocate($img, ...$color));
// Output the image // Output the image
ob_start(); ob_start();

View File

@ -489,7 +489,7 @@ class ModuleTestHelper
foreach ($snmprec_data as $line) { foreach ($snmprec_data as $line) {
if (! empty($line)) { if (! empty($line)) {
[$oid,] = explode('|', $line, 2); [$oid] = explode('|', $line, 2);
$result[$oid] = $line; $result[$oid] = $line;
} }
} }

View File

@ -45,14 +45,14 @@ class Number
if ($value >= '0.1') { if ($value >= '0.1') {
$sizes = ['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']; $sizes = ['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'];
$ext = $sizes[0]; $ext = $sizes[0];
for ($i = 1; (($i < count($sizes)) && ($value >= 1000)); $i++) { for ($i = 1; ($i < count($sizes)) && ($value >= 1000); $i++) {
$value = $value / 1000; $value = $value / 1000;
$ext = $sizes[$i]; $ext = $sizes[$i];
} }
} else { } else {
$sizes = ['', 'm', 'u', 'n', 'p']; $sizes = ['', 'm', 'u', 'n', 'p'];
$ext = $sizes[0]; $ext = $sizes[0];
for ($i = 1; (($i < count($sizes)) && ($value != 0) && ($value <= 0.1)); $i++) { for ($i = 1; ($i < count($sizes)) && ($value != 0) && ($value <= 0.1); $i++) {
$value = $value * 1000; $value = $value * 1000;
$ext = $sizes[$i]; $ext = $sizes[$i];
} }
@ -74,7 +74,7 @@ class Number
} }
$sizes = ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi', 'Yi']; $sizes = ['', 'Ki', 'Mi', 'Gi', 'Ti', 'Pi', 'Ei', 'Zi', 'Yi'];
$ext = $sizes[0]; $ext = $sizes[0];
for ($i = 1; (($i < count($sizes)) && ($value >= 1024)); $i++) { for ($i = 1; ($i < count($sizes)) && ($value >= 1024); $i++) {
$value = $value / 1024; $value = $value / 1024;
$ext = $sizes[$i]; $ext = $sizes[$i];
} }

View File

@ -155,7 +155,7 @@ class Rewrite
*/ */
public static function readableOUI($mac) public static function readableOUI($mac)
{ {
$cached = Cache::get('OUIDB-' . (substr($mac, 0, 6)), ''); $cached = Cache::get('OUIDB-' . substr($mac, 0, 6), '');
if ($cached == 'IEEE Registration Authority') { if ($cached == 'IEEE Registration Authority') {
// Then we may have a shorter prefix, so let's try them one ater the other, ordered by probability // Then we may have a shorter prefix, so let's try them one ater the other, ordered by probability
return Cache::get('OUIDB-' . substr($mac, 0, 9)) ?: Cache::get('OUIDB-' . substr($mac, 0, 7)); return Cache::get('OUIDB-' . substr($mac, 0, 9)) ?: Cache::get('OUIDB-' . substr($mac, 0, 7));

View File

@ -50,7 +50,7 @@ class CheckDatabaseServerVersion implements Validation
trans('validation.validations.database.CheckDatabaseServerVersion.fix', ['server' => 'MariaDB', 'suggested' => Database::MARIADB_RECOMMENDED_VERSION]), trans('validation.validations.database.CheckDatabaseServerVersion.fix', ['server' => 'MariaDB', 'suggested' => Database::MARIADB_RECOMMENDED_VERSION]),
); );
} }
break; break;
case 'MySQL': case 'MySQL':
if (version_compare($version, Database::MYSQL_MIN_VERSION, '<=')) { if (version_compare($version, Database::MYSQL_MIN_VERSION, '<=')) {
return ValidationResult::fail( return ValidationResult::fail(
@ -58,7 +58,7 @@ class CheckDatabaseServerVersion implements Validation
trans('validation.validations.database.CheckDatabaseServerVersion.fix', ['server' => 'MySQL', 'suggested' => Database::MYSQL_RECOMMENDED_VERSION]), trans('validation.validations.database.CheckDatabaseServerVersion.fix', ['server' => 'MySQL', 'suggested' => Database::MYSQL_RECOMMENDED_VERSION]),
); );
} }
break; break;
} }
return ValidationResult::ok(trans('validation.validations.database.CheckDatabaseServerVersion.ok')); return ValidationResult::ok(trans('validation.validations.database.CheckDatabaseServerVersion.ok'));

View File

@ -111,7 +111,6 @@ class Updates extends BaseValidation
$modifiedcmd = 'git diff --name-only --exit-code'; $modifiedcmd = 'git diff --name-only --exit-code';
$validator->execAsUser($modifiedcmd, $cmdoutput, $code); $validator->execAsUser($modifiedcmd, $cmdoutput, $code);
if ($code !== 0 && ! empty($cmdoutput)) { if ($code !== 0 && ! empty($cmdoutput)) {
// Check so it's not only plugins that "pests" the diff // Check so it's not only plugins that "pests" the diff
if (! ($cmdoutput === ['composer.json', 'composer.lock'] && ComposerHelper::getPlugins())) { if (! ($cmdoutput === ['composer.json', 'composer.lock'] && ComposerHelper::getPlugins())) {
$result = ValidationResult::warn( $result = ValidationResult::warn(

View File

@ -116,14 +116,14 @@ class DevSimulate extends LnmsCommand
{ {
if (function_exists('pcntl_signal')) { if (function_exists('pcntl_signal')) {
pcntl_signal(SIGINT, function () { pcntl_signal(SIGINT, function () {
exit(); // exit normally on SIGINT exit; // exit normally on SIGINT
}); });
} }
register_shutdown_function(function () use ($device_id) { register_shutdown_function(function () use ($device_id) {
Device::findOrNew($device_id)->delete(); Device::findOrNew($device_id)->delete();
$this->info(trans('commands.dev:simulate.removed', ['id' => $device_id])); $this->info(trans('commands.dev:simulate.removed', ['id' => $device_id]));
exit(); exit;
}); });
} }

View File

@ -97,8 +97,8 @@ class KeyRotate extends LnmsCommand
if ($this->option('generate-new-key')) { if ($this->option('generate-new-key')) {
$old = $new; // use key in env as existing key $old = $new; // use key in env as existing key
$new = 'base64:' . base64_encode( $new = 'base64:' . base64_encode(
Encrypter::generateKey($this->laravel['config']['app.cipher']) Encrypter::generateKey($this->laravel['config']['app.cipher'])
); );
} }
$this->line(trans('commands.key:rotate.old_key', ['key' => $old])); $this->line(trans('commands.key:rotate.old_key', ['key' => $old]));

View File

@ -35,7 +35,7 @@ class NetflowController implements DeviceTab
{ {
if (Config::get('nfsen_enable')) { if (Config::get('nfsen_enable')) {
foreach ((array) Config::get('nfsen_rrds', []) as $nfsenrrds) { foreach ((array) Config::get('nfsen_rrds', []) as $nfsenrrds) {
if ($nfsenrrds[(strlen($nfsenrrds) - 1)] != '/') { if ($nfsenrrds[strlen($nfsenrrds) - 1] != '/') {
$nfsenrrds .= '/'; $nfsenrrds .= '/';
} }

View File

@ -104,7 +104,7 @@ class ShowConfigController extends Controller implements DeviceTab
if (Config::has('rancid_configs.0')) { if (Config::has('rancid_configs.0')) {
$device = DeviceCache::getPrimary(); $device = DeviceCache::getPrimary();
foreach (Config::get('rancid_configs') as $configs) { foreach (Config::get('rancid_configs') as $configs) {
if ($configs[(strlen($configs) - 1)] != '/') { if ($configs[strlen($configs) - 1] != '/') {
$configs .= '/'; $configs .= '/';
} }

View File

@ -76,6 +76,7 @@ abstract class PaginatedAjaxController extends Controller
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @return array * @return array
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/ */
protected function searchFields($request) protected function searchFields($request)
@ -88,6 +89,7 @@ abstract class PaginatedAjaxController extends Controller
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @return array * @return array
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/ */
protected function filterFields($request) protected function filterFields($request)
@ -100,6 +102,7 @@ abstract class PaginatedAjaxController extends Controller
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @return array * @return array
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/ */
protected function sortFields($request) protected function sortFields($request)

View File

@ -49,6 +49,7 @@ class EventlogController extends SelectController
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @return array * @return array
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/ */
protected function sortFields($request) protected function sortFields($request)

View File

@ -35,6 +35,7 @@ class LocationController extends TableController
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @return array * @return array
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter) * @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/ */
public function searchFields($request) public function searchFields($request)

View File

@ -113,7 +113,7 @@ class OutagesController extends TableController
} }
$output = "<span style='display:inline;'>"; $output = "<span style='display:inline;'>";
$output .= (Carbon::createFromTimestamp($timestamp))->format(Config::get('dateformat.compact')); // Convert epoch to local time $output .= Carbon::createFromTimestamp($timestamp)->format(Config::get('dateformat.compact')); // Convert epoch to local time
$output .= '</span>'; $output .= '</span>';
return $output; return $output;

View File

@ -27,7 +27,6 @@ class QueryDebugListener
public function handle(QueryExecuted $query) public function handle(QueryExecuted $query)
{ {
if (Debug::queryDebugIsEnabled()) { if (Debug::queryDebugIsEnabled()) {
// collect bindings and make them a little more readable // collect bindings and make them a little more readable
$bindings = collect($query->bindings)->map(function ($item) { $bindings = collect($query->bindings)->map(function ($item) {
if ($item instanceof \Carbon\Carbon) { if ($item instanceof \Carbon\Carbon) {

View File

@ -23,6 +23,7 @@ use LibreNMS\Alert\Transport;
* @method static \Illuminate\Database\Eloquent\Builder|AlertTransport whereTransportId($value) * @method static \Illuminate\Database\Eloquent\Builder|AlertTransport whereTransportId($value)
* @method static \Illuminate\Database\Eloquent\Builder|AlertTransport whereTransportName($value) * @method static \Illuminate\Database\Eloquent\Builder|AlertTransport whereTransportName($value)
* @method static \Illuminate\Database\Eloquent\Builder|AlertTransport whereTransportType($value) * @method static \Illuminate\Database\Eloquent\Builder|AlertTransport whereTransportType($value)
*
* @mixin \Eloquent * @mixin \Eloquent
*/ */
class AlertTransport extends Model class AlertTransport extends Model

View File

@ -106,7 +106,7 @@ class Port extends DeviceRelatedModel
*/ */
public function getDescription(): string public function getDescription(): string
{ {
return (string) ($this->ifAlias); return (string) $this->ifAlias;
} }
/** /**

View File

@ -42,7 +42,6 @@ class EventServiceProvider extends ServiceProvider
*/ */
public function boot() public function boot()
{ {
// //
} }
} }

View File

@ -38,7 +38,6 @@ class RouteServiceProvider extends ServiceProvider
//$this->configureRateLimiting(); //$this->configureRateLimiting();
$this->routes(function () { $this->routes(function () {
/** /**
* Define the "api" routes for the application. * Define the "api" routes for the application.
* *

View File

@ -8,250 +8,250 @@
| request an environment variable to be created upstream or send a pull request. | request an environment variable to be created upstream or send a pull request.
*/ */
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Application Name | Application Name
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This value is the name of your application. This value is used when the | This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or | framework needs to place the application's name in a notification or
| any other location as required by the application or its packages. | any other location as required by the application or its packages.
| |
*/ */
'name' => env('APP_NAME', 'LibreNMS'), 'name' => env('APP_NAME', 'LibreNMS'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Application Environment | Application Environment
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This value determines the "environment" your application is currently | This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various | running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file. | services the application utilizes. Set this in your ".env" file.
| |
*/ */
'env' => env('APP_ENV', 'production'), 'env' => env('APP_ENV', 'production'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Application Debug Mode | Application Debug Mode
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| When your application is in debug mode, detailed error messages with | When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your | stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown. | application. If disabled, a simple generic error page is shown.
| |
*/ */
'debug' => (bool) env('APP_DEBUG', false), 'debug' => (bool) env('APP_DEBUG', false),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Application URL | Application URL
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This URL is used by the console to properly generate URLs when using | This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of | the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks. | your application so that it is used when running Artisan tasks.
| |
*/ */
'url' => env('APP_URL', 'http://localhost'), 'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL', null), 'asset_url' => env('ASSET_URL', null),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Application Timezone | Application Timezone
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here you may specify the default timezone for your application, which | Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone | will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box. | ahead and set this to a sensible default for you out of the box.
| |
*/ */
'timezone' => ini_get('date.timezone') ?: 'UTC', // use existing timezone 'timezone' => ini_get('date.timezone') ?: 'UTC', // use existing timezone
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Application Locale Configuration | Application Locale Configuration
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| The application locale determines the default locale that will be used | The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value | by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application. | to any of the locales which will be supported by the application.
| |
*/ */
'locale' => env('APP_LOCALE', 'en'), 'locale' => env('APP_LOCALE', 'en'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Application Fallback Locale | Application Fallback Locale
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| The fallback locale determines the locale to use when the current one | The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of | is not available. You may change the value to correspond to any of
| the language folders that are provided through your application. | the language folders that are provided through your application.
| |
*/ */
'fallback_locale' => 'en', 'fallback_locale' => 'en',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Faker Locale | Faker Locale
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This locale will be used by the Faker PHP library when generating fake | This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get | data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more. | localized telephone numbers, street address information and more.
| |
*/ */
'faker_locale' => 'en_US', 'faker_locale' => 'en_US',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Encryption Key | Encryption Key
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This key is used by the Illuminate encrypter service and should be set | This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings | to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application! | will not be safe. Please do this before deploying an application!
| |
*/ */
'key' => env('APP_KEY'), 'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC', 'cipher' => 'AES-256-CBC',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Autoloaded Service Providers | Autoloaded Service Providers
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| The service providers listed here will be automatically loaded on the | The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to | request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications. | this array to grant expanded functionality to your applications.
| |
*/ */
'providers' => [ 'providers' => [
/* /*
* Laravel Framework Service Providers... * Laravel Framework Service Providers...
*/ */
Illuminate\Auth\AuthServiceProvider::class, Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class, Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class, Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class, Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class, Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class, Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class, Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class, Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class, Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class, Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class, Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class, Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class, Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class, Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class, Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class, Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class, Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class, Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class, Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class, Illuminate\View\ViewServiceProvider::class,
/* /*
* Package Service Providers... * Package Service Providers...
*/ */
/* /*
* LibreNMS Service Providers... * LibreNMS Service Providers...
*/ */
App\Providers\ConfigServiceProvider::class, App\Providers\ConfigServiceProvider::class,
App\Providers\ErrorReportingProvider::class, // This should always be after the config is loaded App\Providers\ErrorReportingProvider::class, // This should always be after the config is loaded
App\Providers\AppServiceProvider::class, App\Providers\AppServiceProvider::class,
App\Providers\CliServiceProvider::class, App\Providers\CliServiceProvider::class,
App\Providers\AuthServiceProvider::class, App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class, // App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class, App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class, App\Providers\RouteServiceProvider::class,
App\Providers\ComposerServiceProvider::class, App\Providers\ComposerServiceProvider::class,
App\Providers\DatastoreServiceProvider::class, App\Providers\DatastoreServiceProvider::class,
App\Providers\SnmptrapProvider::class, App\Providers\SnmptrapProvider::class,
App\Providers\PluginProvider::class, App\Providers\PluginProvider::class,
], ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Class Aliases | Class Aliases
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This array of class aliases will be registered when this application | This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as | is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance. | the aliases are "lazy" loaded so they don't hinder performance.
| |
*/ */
'aliases' => [ 'aliases' => [
'App' => Illuminate\Support\Facades\App::class, 'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class, 'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class, 'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class, 'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class, 'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class, 'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class, 'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class, 'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class, 'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class, 'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class, 'Crypt' => Illuminate\Support\Facades\Crypt::class,
'Date' => Illuminate\Support\Facades\Date::class, 'Date' => Illuminate\Support\Facades\Date::class,
'DB' => Illuminate\Support\Facades\DB::class, 'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class, 'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class, 'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class, 'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class, 'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class, 'Hash' => Illuminate\Support\Facades\Hash::class,
'Http' => Illuminate\Support\Facades\Http::class, 'Http' => Illuminate\Support\Facades\Http::class,
'Lang' => Illuminate\Support\Facades\Lang::class, 'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class, 'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class, 'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class, 'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class, 'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class, 'Queue' => Illuminate\Support\Facades\Queue::class,
'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class, 'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class, 'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class, 'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class, 'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class, 'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class, 'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class, 'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class, 'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class, 'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class, 'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class, 'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class, 'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class, 'View' => Illuminate\Support\Facades\View::class,
'Debugbar' => Barryvdh\Debugbar\Facades\Debugbar::class, 'Debugbar' => Barryvdh\Debugbar\Facades\Debugbar::class,
'Flare' => Facade\Ignition\Facades\Flare::class, 'Flare' => Facade\Ignition\Facades\Flare::class,
// LibreNMS // LibreNMS
'Permissions' => \App\Facades\Permissions::class, 'Permissions' => \App\Facades\Permissions::class,
'PluginManager' => \App\Facades\PluginManager::class, 'PluginManager' => \App\Facades\PluginManager::class,
'DeviceCache' => \App\Facades\DeviceCache::class, 'DeviceCache' => \App\Facades\DeviceCache::class,
'Rrd' => \App\Facades\Rrd::class, 'Rrd' => \App\Facades\Rrd::class,
'SnmpQuery' => \App\Facades\FacadeAccessorSnmp::class, 'SnmpQuery' => \App\Facades\FacadeAccessorSnmp::class,
], ],
'charset' => env('CHARSET', ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8'), 'charset' => env('CHARSET', ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8'),
]; ];

View File

@ -8,129 +8,129 @@
| request an environment variable to be created upstream or send a pull request. | request an environment variable to be created upstream or send a pull request.
*/ */
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Authentication Defaults | Authentication Defaults
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This option controls the default authentication "guard" and password | This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults | reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications. | as required, but they're a perfect start for most applications.
| |
*/ */
'defaults' => [ 'defaults' => [
'guard' => 'web', 'guard' => 'web',
'passwords' => 'users', 'passwords' => 'users',
], ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Authentication Guards | Authentication Guards
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Next, you may define every authentication guard for your application. | Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you | Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider. | here which uses session storage and the Eloquent user provider.
| |
| All authentication drivers have a user provider. This defines how the | All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage | users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data. | mechanisms used by this application to persist your user's data.
| |
| Supported: "session" | Supported: "session"
| |
*/ */
'guards' => [ 'guards' => [
'web' => [ 'web' => [
'driver' => 'session', 'driver' => 'session',
'provider' => 'legacy', 'provider' => 'legacy',
], ],
'api' => [ 'api' => [
'driver' => 'token', 'driver' => 'token',
'provider' => 'users', 'provider' => 'users',
'hash' => false, 'hash' => false,
], ],
'token' => [ 'token' => [
'driver' => 'token_driver', 'driver' => 'token_driver',
'provider' => 'token_provider', 'provider' => 'token_provider',
'hash' => false, 'hash' => false,
], ],
], ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| User Providers | User Providers
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| All authentication drivers have a user provider. This defines how the | All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage | users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data. | mechanisms used by this application to persist your user's data.
| |
| If you have multiple user tables or models you may configure multiple | If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then | sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined. | be assigned to any extra authentication guards you have defined.
| |
| Supported: "database", "eloquent" | Supported: "database", "eloquent"
| |
*/ */
'providers' => [ 'providers' => [
'users' => [ 'users' => [
'driver' => 'eloquent', 'driver' => 'eloquent',
'model' => App\Models\User::class, 'model' => App\Models\User::class,
], ],
'legacy' => [ 'legacy' => [
'driver' => 'legacy', 'driver' => 'legacy',
'model' => App\Models\User::class, 'model' => App\Models\User::class,
], ],
// 'users' => [ // 'users' => [
// 'driver' => 'database', // 'driver' => 'database',
// 'table' => 'users', // 'table' => 'users',
// ], // ],
], ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Resetting Passwords | Resetting Passwords
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| You may specify multiple password reset configurations if you have more | You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have | than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types. | separate password reset settings based on the specific user types.
| |
| The expire time is the number of minutes that the reset token should be | The expire time is the number of minutes that the reset token should be
| considered valid. This security feature keeps tokens short-lived so | considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed. | they have less time to be guessed. You may change this as needed.
| |
*/ */
'passwords' => [ 'passwords' => [
'users' => [ 'users' => [
'provider' => 'users', 'provider' => 'users',
'table' => 'password_resets', 'table' => 'password_resets',
'expire' => 60, 'expire' => 60,
'throttle' => 60, 'throttle' => 60,
], ],
], ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Password Confirmation Timeout | Password Confirmation Timeout
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here you may define the amount of seconds before a password confirmation | Here you may define the amount of seconds before a password confirmation
| times out and the user is prompted to re-enter their password via the | times out and the user is prompted to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours. | confirmation screen. By default, the timeout lasts for three hours.
| |
*/ */
'password_timeout' => 10800, 'password_timeout' => 10800,
]; ];

View File

@ -8,65 +8,65 @@
| request an environment variable to be created upstream or send a pull request. | request an environment variable to be created upstream or send a pull request.
*/ */
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Default Broadcaster | Default Broadcaster
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This option controls the default broadcaster that will be used by the | This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to | framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below. | any of the connections defined in the "connections" array below.
| |
| Supported: "pusher", "ably", "redis", "log", "null" | Supported: "pusher", "ably", "redis", "log", "null"
| |
*/ */
'default' => env('BROADCAST_DRIVER', 'null'), 'default' => env('BROADCAST_DRIVER', 'null'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Broadcast Connections | Broadcast Connections
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here you may define all of the broadcast connections that will be used | Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of | to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array. | each available type of connection are provided inside this array.
| |
*/ */
'connections' => [ 'connections' => [
'pusher' => [ 'pusher' => [
'driver' => 'pusher', 'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'), 'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'), 'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'), 'app_id' => env('PUSHER_APP_ID'),
'options' => [ 'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'), 'cluster' => env('PUSHER_APP_CLUSTER'),
'useTLS' => true, 'useTLS' => true,
], ],
], ],
'ably' => [ 'ably' => [
'driver' => 'ably', 'driver' => 'ably',
'key' => env('ABLY_KEY'), 'key' => env('ABLY_KEY'),
], ],
'redis' => [ 'redis' => [
'driver' => 'redis', 'driver' => 'redis',
'connection' => 'default', 'connection' => 'default',
], ],
'log' => [ 'log' => [
'driver' => 'log', 'driver' => 'log',
], ],
'null' => [ 'null' => [
'driver' => 'null', 'driver' => 'null',
], ],
], ],
]; ];

View File

@ -8,111 +8,111 @@
| request an environment variable to be created upstream or send a pull request. | request an environment variable to be created upstream or send a pull request.
*/ */
use Illuminate\Support\Str; use Illuminate\Support\Str;
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Default Cache Store | Default Cache Store
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This option controls the default cache connection that gets used while | This option controls the default cache connection that gets used while
| using this caching library. This connection is used when another is | using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function. | not explicitly specified when executing a given caching function.
| |
*/ */
'default' => env('CACHE_DRIVER', 'database'), 'default' => env('CACHE_DRIVER', 'database'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Cache Stores | Cache Stores
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here you may define all of the cache "stores" for your application as | Here you may define all of the cache "stores" for your application as
| well as their drivers. You may even define multiple stores for the | well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches. | same cache driver to group types of items stored in your caches.
| |
| Supported drivers: "apc", "array", "database", "file", | Supported drivers: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb", "octane", "null" | "memcached", "redis", "dynamodb", "octane", "null"
| |
*/ */
'stores' => [ 'stores' => [
'apc' => [ 'apc' => [
'driver' => 'apc', 'driver' => 'apc',
], ],
'array' => [ 'array' => [
'driver' => 'array', 'driver' => 'array',
'serialize' => false, 'serialize' => false,
], ],
'database' => [ 'database' => [
'driver' => 'database', 'driver' => 'database',
'table' => 'cache', 'table' => 'cache',
'connection' => null, 'connection' => null,
'lock_connection' => null, 'lock_connection' => null,
], ],
'file' => [ 'file' => [
'driver' => 'file', 'driver' => 'file',
'path' => storage_path('framework/cache/data'), 'path' => storage_path('framework/cache/data'),
], ],
'memcached' => [ 'memcached' => [
'driver' => 'memcached', 'driver' => 'memcached',
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
'sasl' => [ 'sasl' => [
env('MEMCACHED_USERNAME'), env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'), env('MEMCACHED_PASSWORD'),
], ],
'options' => [ 'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000, // Memcached::OPT_CONNECT_TIMEOUT => 2000,
], ],
'servers' => [ 'servers' => [
[ [
'host' => env('MEMCACHED_HOST', '127.0.0.1'), 'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211), 'port' => env('MEMCACHED_PORT', 11211),
'weight' => 100, 'weight' => 100,
], ],
], ],
], ],
'redis' => [ 'redis' => [
'driver' => 'redis', 'driver' => 'redis',
'connection' => 'cache', 'connection' => 'cache',
'lock_connection' => 'default', 'lock_connection' => 'default',
], ],
'dynamodb' => [ 'dynamodb' => [
'driver' => 'dynamodb', 'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'), 'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'), 'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'), 'endpoint' => env('DYNAMODB_ENDPOINT'),
], ],
'octane' => [ 'octane' => [
'driver' => 'octane', 'driver' => 'octane',
], ],
], ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Cache Key Prefix | Cache Key Prefix
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| When utilizing a RAM based store such as APC or Memcached, there might | When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a | be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions. | value to get prefixed to all our keys so we can avoid collisions.
| |
*/ */
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'), 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'),
]; ];

View File

@ -8,225 +8,225 @@
| request an environment variable to be created upstream or send a pull request. | request an environment variable to be created upstream or send a pull request.
*/ */
use Illuminate\Support\Str; use Illuminate\Support\Str;
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Default Database Connection Name | Default Database Connection Name
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here you may specify which of the database connections below you wish | Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course | to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library. | you may use many connections at once using the Database library.
| |
*/ */
'default' => env('DB_CONNECTION', env('DBTEST') ? 'testing' : 'mysql'), 'default' => env('DB_CONNECTION', env('DBTEST') ? 'testing' : 'mysql'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Database Connections | Database Connections
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here are each of the database connections setup for your application. | Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is | Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple. | supported by Laravel is shown below to make development simple.
| |
| |
| All database work in Laravel is done through the PHP PDO facilities | All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of | so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development. | choice installed on your machine before you begin development.
| |
*/ */
'connections' => [ 'connections' => [
'sqlite' => [ 'sqlite' => [
'driver' => 'sqlite', 'driver' => 'sqlite',
'url' => env('DATABASE_URL'), 'url' => env('DATABASE_URL'),
'database' => env('DB_DATABASE', storage_path('librenms.sqlite')), 'database' => env('DB_DATABASE', storage_path('librenms.sqlite')),
'prefix' => '', 'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
], ],
'mysql' => [ 'mysql' => [
'driver' => 'mysql', 'driver' => 'mysql',
'url' => env('DATABASE_URL'), 'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'), 'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '3306'), 'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'librenms'), 'database' => env('DB_DATABASE', 'librenms'),
'username' => env('DB_USERNAME', 'librenms'), 'username' => env('DB_USERNAME', 'librenms'),
'password' => env('DB_PASSWORD', ''), 'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''), 'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4', 'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci', 'collation' => 'utf8mb4_unicode_ci',
'prefix' => '', 'prefix' => '',
'prefix_indexes' => true, 'prefix_indexes' => true,
'strict' => true, 'strict' => true,
'engine' => null, 'engine' => null,
'sslmode' => env('DB_SSLMODE', 'disabled'), 'sslmode' => env('DB_SSLMODE', 'disabled'),
'options' => extension_loaded('pdo_mysql') ? array_filter([ 'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [], ]) : [],
], ],
'mysql_cluster' => [ 'mysql_cluster' => [
'read' => [ 'read' => [
'host' => [ 'host' => [
env('DB_HOST', 'localhost'), env('DB_HOST', 'localhost'),
env('DB_HOST_R2', ''), env('DB_HOST_R2', ''),
env('DB_HOST_R3', ''), env('DB_HOST_R3', ''),
env('DB_HOST_R4', ''), env('DB_HOST_R4', ''),
env('DB_HOST_R5', ''), env('DB_HOST_R5', ''),
env('DB_HOST_R6', ''), env('DB_HOST_R6', ''),
env('DB_HOST_R7', ''), env('DB_HOST_R7', ''),
env('DB_HOST_R8', ''), env('DB_HOST_R8', ''),
env('DB_HOST_R9', ''), env('DB_HOST_R9', ''),
], ],
], ],
'write' => [ 'write' => [
'host' => [ 'host' => [
env('DB_HOST', 'localhost'), env('DB_HOST', 'localhost'),
env('DB_HOST_W2', ''), env('DB_HOST_W2', ''),
env('DB_HOST_W3', ''), env('DB_HOST_W3', ''),
env('DB_HOST_W4', ''), env('DB_HOST_W4', ''),
env('DB_HOST_W5', ''), env('DB_HOST_W5', ''),
env('DB_HOST_W6', ''), env('DB_HOST_W6', ''),
env('DB_HOST_W7', ''), env('DB_HOST_W7', ''),
env('DB_HOST_W8', ''), env('DB_HOST_W8', ''),
env('DB_HOST_W9', ''), env('DB_HOST_W9', ''),
], ],
], ],
'sticky' => env('DB_STICKY', null), 'sticky' => env('DB_STICKY', null),
'driver' => 'mysql', 'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'), 'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '3306'), 'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'librenms'), 'database' => env('DB_DATABASE', 'librenms'),
'username' => env('DB_USERNAME', 'librenms'), 'username' => env('DB_USERNAME', 'librenms'),
'password' => env('DB_PASSWORD', ''), 'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''), 'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4', 'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci', 'collation' => 'utf8mb4_unicode_ci',
'prefix' => '', 'prefix' => '',
'prefix_indexes' => true, 'prefix_indexes' => true,
'strict' => true, 'strict' => true,
'engine' => null, 'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([ 'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [], ]) : [],
], ],
'testing' => [ 'testing' => [
'driver' => env('DB_TEST_DRIVER', 'mysql'), 'driver' => env('DB_TEST_DRIVER', 'mysql'),
'host' => env('DB_TEST_HOST', 'localhost'), 'host' => env('DB_TEST_HOST', 'localhost'),
'port' => env('DB_TEST_PORT', '3306'), 'port' => env('DB_TEST_PORT', '3306'),
'database' => env('DB_TEST_DATABASE', 'librenms_phpunit_78hunjuybybh'), 'database' => env('DB_TEST_DATABASE', 'librenms_phpunit_78hunjuybybh'),
'username' => env('DB_TEST_USERNAME', 'root'), 'username' => env('DB_TEST_USERNAME', 'root'),
'password' => env('DB_TEST_PASSWORD', ''), 'password' => env('DB_TEST_PASSWORD', ''),
'unix_socket' => env('DB_TEST_SOCKET', ''), 'unix_socket' => env('DB_TEST_SOCKET', ''),
'charset' => 'utf8mb4', 'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci', 'collation' => 'utf8mb4_unicode_ci',
'prefix' => '', 'prefix' => '',
'strict' => true, 'strict' => true,
'engine' => null, 'engine' => null,
], ],
'pgsql' => [ 'pgsql' => [
'driver' => 'pgsql', 'driver' => 'pgsql',
'url' => env('DATABASE_URL'), 'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'), 'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'), 'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'), 'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'), 'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''), 'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8', 'charset' => 'utf8',
'prefix' => '', 'prefix' => '',
'prefix_indexes' => true, 'prefix_indexes' => true,
'schema' => 'public', 'schema' => 'public',
'sslmode' => 'prefer', 'sslmode' => 'prefer',
], ],
'sqlsrv' => [ 'sqlsrv' => [
'driver' => 'sqlsrv', 'driver' => 'sqlsrv',
'url' => env('DATABASE_URL'), 'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'), 'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'), 'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'), 'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'), 'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''), 'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8', 'charset' => 'utf8',
'prefix' => '', 'prefix' => '',
'prefix_indexes' => true, 'prefix_indexes' => true,
], ],
'testing_memory' => [ 'testing_memory' => [
'driver' => 'sqlite', 'driver' => 'sqlite',
'database' => ':memory:', 'database' => ':memory:',
'prefix' => '', 'prefix' => '',
'foreign_key_constraints' => true, 'foreign_key_constraints' => true,
], ],
'testing_persistent' => [ 'testing_persistent' => [
'driver' => 'sqlite', 'driver' => 'sqlite',
'database' => storage_path('testing.sqlite'), 'database' => storage_path('testing.sqlite'),
'prefix' => '', 'prefix' => '',
'foreign_key_constraints' => true, 'foreign_key_constraints' => true,
], ],
], ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Migration Repository Table | Migration Repository Table
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This table keeps track of all the migrations that have already run for | This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of | your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database. | the migrations on disk haven't actually been run in the database.
| |
*/ */
'migrations' => 'migrations', 'migrations' => 'migrations',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Redis Databases | Redis Databases
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Redis is an open source, fast, and advanced key-value store that also | Redis is an open source, fast, and advanced key-value store that also
| provides a richer body of commands than a typical key-value system | provides a richer body of commands than a typical key-value system
| such as APC or Memcached. Laravel makes it easy to dig right in. | such as APC or Memcached. Laravel makes it easy to dig right in.
| |
*/ */
'redis' => [ 'redis' => [
'client' => env('REDIS_CLIENT', 'predis'), 'client' => env('REDIS_CLIENT', 'predis'),
'options' => [ 'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'), 'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'),
], ],
'default' => [ 'default' => [
'scheme' => env('REDIS_SCHEME', 'tcp'), 'scheme' => env('REDIS_SCHEME', 'tcp'),
'url' => env('REDIS_URL'), 'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'), 'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null), 'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', '6379'), 'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'), 'database' => env('REDIS_DB', '0'),
], ],
'cache' => [ 'cache' => [
'url' => env('REDIS_URL'), 'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'), 'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null), 'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', '6379'), 'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'), 'database' => env('REDIS_CACHE_DB', '1'),
], ],
], ],
]; ];

View File

@ -8,204 +8,204 @@
| request an environment variable to be created upstream or send a pull request. | request an environment variable to be created upstream or send a pull request.
*/ */
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Debugbar Settings | Debugbar Settings
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Debugbar is enabled by default, when debug is set to true in app.php. | Debugbar is enabled by default, when debug is set to true in app.php.
| You can override the value by setting enable to true or false instead of null. | You can override the value by setting enable to true or false instead of null.
| |
| You can provide an array of URI's that must be ignored (eg. 'api/*') | You can provide an array of URI's that must be ignored (eg. 'api/*')
| |
*/ */
'enabled' => env('DEBUGBAR_ENABLED', null), 'enabled' => env('DEBUGBAR_ENABLED', null),
'except' => [ 'except' => [
'api*', 'api*',
'graph*', 'graph*',
'push*', 'push*',
], ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Storage settings | Storage settings
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| DebugBar stores data for session/ajax requests. | DebugBar stores data for session/ajax requests.
| You can disable this, so the debugbar stores data in headers/session, | You can disable this, so the debugbar stores data in headers/session,
| but this can cause problems with large data collectors. | but this can cause problems with large data collectors.
| By default, file storage (in the storage folder) is used. Redis and PDO | By default, file storage (in the storage folder) is used. Redis and PDO
| can also be used. For PDO, run the package migrations first. | can also be used. For PDO, run the package migrations first.
| |
*/ */
'storage' => [ 'storage' => [
'enabled' => true, 'enabled' => true,
'driver' => 'file', // redis, file, pdo, custom 'driver' => 'file', // redis, file, pdo, custom
'path' => storage_path('debugbar'), // For file driver 'path' => storage_path('debugbar'), // For file driver
'connection' => null, // Leave null for default connection (Redis/PDO) 'connection' => null, // Leave null for default connection (Redis/PDO)
'provider' => '', // Instance of StorageInterface for custom driver 'provider' => '', // Instance of StorageInterface for custom driver
], ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Vendors | Vendors
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Vendor files are included by default, but can be set to false. | Vendor files are included by default, but can be set to false.
| This can also be set to 'js' or 'css', to only include javascript or css vendor files. | This can also be set to 'js' or 'css', to only include javascript or css vendor files.
| Vendor files are for css: font-awesome (including fonts) and highlight.js (css files) | Vendor files are for css: font-awesome (including fonts) and highlight.js (css files)
| and for js: jquery and and highlight.js | and for js: jquery and and highlight.js
| So if you want syntax highlighting, set it to true. | So if you want syntax highlighting, set it to true.
| jQuery is set to not conflict with existing jQuery scripts. | jQuery is set to not conflict with existing jQuery scripts.
| |
*/ */
'include_vendors' => true, 'include_vendors' => true,
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Capture Ajax Requests | Capture Ajax Requests
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors), | The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors),
| you can use this option to disable sending the data through the headers. | you can use this option to disable sending the data through the headers.
| |
| Optionally, you can also send ServerTiming headers on ajax requests for the Chrome DevTools. | Optionally, you can also send ServerTiming headers on ajax requests for the Chrome DevTools.
*/ */
'capture_ajax' => true, 'capture_ajax' => true,
'add_ajax_timing' => false, 'add_ajax_timing' => false,
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Custom Error Handler for Deprecated warnings | Custom Error Handler for Deprecated warnings
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| When enabled, the Debugbar shows deprecated warnings for Symfony components | When enabled, the Debugbar shows deprecated warnings for Symfony components
| in the Messages tab. | in the Messages tab.
| |
*/ */
'error_handler' => false, 'error_handler' => false,
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Clockwork integration | Clockwork integration
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| The Debugbar can emulate the Clockwork headers, so you can use the Chrome | The Debugbar can emulate the Clockwork headers, so you can use the Chrome
| Extension, without the server-side code. It uses Debugbar collectors instead. | Extension, without the server-side code. It uses Debugbar collectors instead.
| |
*/ */
'clockwork' => false, 'clockwork' => false,
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| DataCollectors | DataCollectors
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Enable/disable DataCollectors | Enable/disable DataCollectors
| |
*/ */
'collectors' => [ 'collectors' => [
'phpinfo' => true, // Php version 'phpinfo' => true, // Php version
'messages' => true, // Messages 'messages' => true, // Messages
'time' => true, // Time Datalogger 'time' => true, // Time Datalogger
'memory' => true, // Memory usage 'memory' => true, // Memory usage
'exceptions' => true, // Exception displayer 'exceptions' => true, // Exception displayer
'log' => true, // Logs from Monolog (merged in messages if enabled) 'log' => true, // Logs from Monolog (merged in messages if enabled)
'db' => true, // Show database (PDO) queries and bindings 'db' => true, // Show database (PDO) queries and bindings
'views' => true, // Views with their data 'views' => true, // Views with their data
'route' => true, // Current route information 'route' => true, // Current route information
'auth' => true, // Display Laravel authentication status 'auth' => true, // Display Laravel authentication status
'gate' => true, // Display Laravel Gate checks 'gate' => true, // Display Laravel Gate checks
'session' => true, // Display session data 'session' => true, // Display session data
'symfony_request' => true, // Only one can be enabled.. 'symfony_request' => true, // Only one can be enabled..
'mail' => true, // Catch mail messages 'mail' => true, // Catch mail messages
'laravel' => false, // Laravel version and environment 'laravel' => false, // Laravel version and environment
'events' => false, // All events fired 'events' => false, // All events fired
'default_request' => false, // Regular or special Symfony request logger 'default_request' => false, // Regular or special Symfony request logger
'logs' => false, // Add the latest log messages 'logs' => false, // Add the latest log messages
'files' => false, // Show the included files 'files' => false, // Show the included files
'config' => false, // Display config settings 'config' => false, // Display config settings
'cache' => false, // Display cache events 'cache' => false, // Display cache events
], ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Extra options | Extra options
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Configure some DataCollectors | Configure some DataCollectors
| |
*/ */
'options' => [ 'options' => [
'auth' => [ 'auth' => [
'show_name' => true, // Also show the users name/email in the debugbar 'show_name' => true, // Also show the users name/email in the debugbar
], ],
'db' => [ 'db' => [
'with_params' => true, // Render SQL with the parameters substituted 'with_params' => true, // Render SQL with the parameters substituted
'backtrace' => true, // Use a backtrace to find the origin of the query in your files. 'backtrace' => true, // Use a backtrace to find the origin of the query in your files.
'timeline' => false, // Add the queries to the timeline 'timeline' => false, // Add the queries to the timeline
'explain' => [ // Show EXPLAIN output on queries 'explain' => [ // Show EXPLAIN output on queries
'enabled' => false, 'enabled' => false,
'types' => ['SELECT'], // // workaround ['SELECT'] only. https://github.com/barryvdh/laravel-debugbar/issues/888 ['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+ 'types' => ['SELECT'], // // workaround ['SELECT'] only. https://github.com/barryvdh/laravel-debugbar/issues/888 ['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+
], ],
'hints' => true, // Show hints for common mistakes 'hints' => true, // Show hints for common mistakes
], ],
'mail' => [ 'mail' => [
'full_log' => false, 'full_log' => false,
], ],
'views' => [ 'views' => [
'data' => false, //Note: Can slow down the application, because the data can be quite large.. 'data' => false, //Note: Can slow down the application, because the data can be quite large..
], ],
'route' => [ 'route' => [
'label' => true, // show complete route on bar 'label' => true, // show complete route on bar
], ],
'logs' => [ 'logs' => [
'file' => null, 'file' => null,
], ],
'cache' => [ 'cache' => [
'values' => true, // collect cache values 'values' => true, // collect cache values
], ],
], ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Inject Debugbar in Response | Inject Debugbar in Response
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Usually, the debugbar is added just before </body>, by listening to the | Usually, the debugbar is added just before </body>, by listening to the
| Response after the App is done. If you disable this, you have to add them | Response after the App is done. If you disable this, you have to add them
| in your template yourself. See http://phpdebugbar.com/docs/rendering.html | in your template yourself. See http://phpdebugbar.com/docs/rendering.html
| |
*/ */
'inject' => true, 'inject' => true,
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| DebugBar route prefix | DebugBar route prefix
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Sometimes you want to set route prefix to be used by DebugBar to load | Sometimes you want to set route prefix to be used by DebugBar to load
| its resources from. Usually the need comes from misconfigured web server or | its resources from. Usually the need comes from misconfigured web server or
| from trying to overcome bugs like this: http://trac.nginx.org/nginx/ticket/97 | from trying to overcome bugs like this: http://trac.nginx.org/nginx/ticket/97
| |
*/ */
'route_prefix' => '_debugbar', 'route_prefix' => '_debugbar',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| DebugBar route domain | DebugBar route domain
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| By default DebugBar route served from the same domain that request served. | By default DebugBar route served from the same domain that request served.
| To override default domain, specify it as a non-empty value. | To override default domain, specify it as a non-empty value.
*/ */
'route_domain' => null, 'route_domain' => null,
]; ];

View File

@ -8,79 +8,79 @@
| request an environment variable to be created upstream or send a pull request. | request an environment variable to be created upstream or send a pull request.
*/ */
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Default Filesystem Disk | Default Filesystem Disk
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here you may specify the default filesystem disk that should be used | Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud | by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away! | based disks are available to your application. Just store away!
| |
*/ */
'default' => env('FILESYSTEM_DRIVER', 'local'), 'default' => env('FILESYSTEM_DRIVER', 'local'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Filesystem Disks | Filesystem Disks
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here you may configure as many filesystem "disks" as you wish, and you | Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have | may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options. | been setup for each driver as an example of the required options.
| |
| Supported Drivers: "local", "ftp", "sftp", "s3" | Supported Drivers: "local", "ftp", "sftp", "s3"
| |
*/ */
'disks' => [ 'disks' => [
'local' => [ 'local' => [
'driver' => 'local', 'driver' => 'local',
'root' => storage_path('app'), 'root' => storage_path('app'),
], ],
'base' => [ 'base' => [
'driver' => 'local', 'driver' => 'local',
'root' => base_path(), 'root' => base_path(),
], ],
'public' => [ 'public' => [
'driver' => 'local', 'driver' => 'local',
'root' => storage_path('app/public'), 'root' => storage_path('app/public'),
'url' => env('APP_URL') . '/storage', 'url' => env('APP_URL') . '/storage',
'visibility' => 'public', 'visibility' => 'public',
], ],
's3' => [ 's3' => [
'driver' => 's3', 'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'), 'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'), 'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'), 'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'), 'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'), 'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'), 'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
], ],
], ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Symbolic Links | Symbolic Links
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here you may configure the symbolic links that will be created when the | Here you may configure the symbolic links that will be created when the
| `storage:link` Artisan command is executed. The array keys should be | `storage:link` Artisan command is executed. The array keys should be
| the locations of the links and the values should be their targets. | the locations of the links and the values should be their targets.
| |
*/ */
'links' => [ 'links' => [
public_path('storage') => storage_path('app/public'), public_path('storage') => storage_path('app/public'),
], ],
]; ];

View File

@ -8,63 +8,63 @@
| request an environment variable to be created upstream or send a pull request. | request an environment variable to be created upstream or send a pull request.
*/ */
return [ return [
/* /*
| |
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Flare API key | Flare API key
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Specify Flare's API key below to enable error reporting to the service. | Specify Flare's API key below to enable error reporting to the service.
| |
| More info: https://flareapp.io/docs/general/projects | More info: https://flareapp.io/docs/general/projects
| |
*/ */
'key' => env('FLARE_KEY', 'quYFBTFNKHLBqFCoeo5yDVOQNbs6muV1'), 'key' => env('FLARE_KEY', 'quYFBTFNKHLBqFCoeo5yDVOQNbs6muV1'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Reporting Options | Reporting Options
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| These options determine which information will be transmitted to Flare. | These options determine which information will be transmitted to Flare.
| |
*/ */
'reporting' => [ 'reporting' => [
'anonymize_ips' => true, 'anonymize_ips' => true,
'collect_git_information' => false, 'collect_git_information' => false,
'report_queries' => true, 'report_queries' => true,
'maximum_number_of_collected_queries' => 50, 'maximum_number_of_collected_queries' => 50,
'report_query_bindings' => true, 'report_query_bindings' => true,
'report_view_data' => true, 'report_view_data' => true,
'grouping_type' => null, 'grouping_type' => null,
'report_logs' => false, 'report_logs' => false,
'maximum_number_of_collected_logs' => 50, 'maximum_number_of_collected_logs' => 50,
'censor_request_body_fields' => ['username', 'password', 'sysContact', 'community', 'authname', 'authpass', 'cryptopass'], 'censor_request_body_fields' => ['username', 'password', 'sysContact', 'community', 'authname', 'authpass', 'cryptopass'],
], ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Reporting Log statements | Reporting Log statements
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| If this setting is `false` log statements won't be sent as events to Flare, | If this setting is `false` log statements won't be sent as events to Flare,
| no matter which error level you specified in the Flare log channel. | no matter which error level you specified in the Flare log channel.
| |
*/ */
'send_logs_as_events' => false, 'send_logs_as_events' => false,
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Censor request body fields | Censor request body fields
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| These fields will be censored from your request when sent to Flare. | These fields will be censored from your request when sent to Flare.
| |
*/ */
'censor_request_body_fields' => ['username', 'password', 'sysContact', 'community', 'authname', 'authpass', 'cryptopass'], 'censor_request_body_fields' => ['username', 'password', 'sysContact', 'community', 'authname', 'authpass', 'cryptopass'],
]; ];

View File

@ -8,53 +8,53 @@
| request an environment variable to be created upstream or send a pull request. | request an environment variable to be created upstream or send a pull request.
*/ */
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Default Hash Driver | Default Hash Driver
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This option controls the default hash driver that will be used to hash | This option controls the default hash driver that will be used to hash
| passwords for your application. By default, the bcrypt algorithm is | passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish. | used; however, you remain free to modify this option if you wish.
| |
| Supported: "bcrypt", "argon", "argon2id" | Supported: "bcrypt", "argon", "argon2id"
| |
*/ */
'driver' => 'bcrypt', 'driver' => 'bcrypt',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Bcrypt Options | Bcrypt Options
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here you may specify the configuration options that should be used when | Here you may specify the configuration options that should be used when
| passwords are hashed using the Bcrypt algorithm. This will allow you | passwords are hashed using the Bcrypt algorithm. This will allow you
| to control the amount of time it takes to hash the given password. | to control the amount of time it takes to hash the given password.
| |
*/ */
'bcrypt' => [ 'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 10), 'rounds' => env('BCRYPT_ROUNDS', 10),
], ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Argon Options | Argon Options
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here you may specify the configuration options that should be used when | Here you may specify the configuration options that should be used when
| passwords are hashed using the Argon algorithm. These will allow you | passwords are hashed using the Argon algorithm. These will allow you
| to control the amount of time it takes to hash the given password. | to control the amount of time it takes to hash the given password.
| |
*/ */
'argon' => [ 'argon' => [
'memory' => 1024, 'memory' => 1024,
'threads' => 2, 'threads' => 2,
'time' => 2, 'time' => 2,
], ],
]; ];

View File

@ -8,49 +8,49 @@
| request an environment variable to be created upstream or send a pull request. | request an environment variable to be created upstream or send a pull request.
*/ */
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| User | User
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This value is the user LibreNMS runs as. It is used to secure permissions | This value is the user LibreNMS runs as. It is used to secure permissions
| and grant access to things needed. Defaults to librenms. | and grant access to things needed. Defaults to librenms.
*/ */
'user' => env('LIBRENMS_USER', 'librenms'), 'user' => env('LIBRENMS_USER', 'librenms'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Group | Group
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This value is the group LibreNMS runs as. It is used to secure permissions | This value is the group LibreNMS runs as. It is used to secure permissions
| and grant access to things needed. Defaults to the same as LIBRENMS_USER. | and grant access to things needed. Defaults to the same as LIBRENMS_USER.
*/ */
'group' => env('LIBRENMS_GROUP', env('LIBRENMS_USER', 'librenms')), 'group' => env('LIBRENMS_GROUP', env('LIBRENMS_USER', 'librenms')),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Install | Install
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This value sets if the install process needs to be run. | This value sets if the install process needs to be run.
| You may also specify which install steps to present with a comma separated list. | You may also specify which install steps to present with a comma separated list.
*/ */
'install' => env('INSTALL', false), 'install' => env('INSTALL', false),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| NODE ID | NODE ID
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Unique value to identify this node. Primarily used for distributed polling. | Unique value to identify this node. Primarily used for distributed polling.
*/ */
'node_id' => env('NODE_ID'), 'node_id' => env('NODE_ID'),
]; ];

View File

@ -8,144 +8,144 @@
| request an environment variable to be created upstream or send a pull request. | request an environment variable to be created upstream or send a pull request.
*/ */
use Monolog\Handler\NullHandler; use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler; use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler; use Monolog\Handler\SyslogUdpHandler;
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Default Log Channel | Default Log Channel
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This option defines the default log channel that gets used when writing | This option defines the default log channel that gets used when writing
| messages to the logs. The name specified in this option should match | messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array. | one of the channels defined in the "channels" configuration array.
| |
*/ */
'default' => env('LOG_CHANNEL', 'stack'), 'default' => env('LOG_CHANNEL', 'stack'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Log Channels | Log Channels
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here you may configure the log channels for your application. Out of | Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives | the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize. | you a variety of powerful log handlers / formatters to utilize.
| |
| Available Drivers: "single", "daily", "slack", "syslog", | Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog", | "errorlog", "monolog",
| "custom", "stack" | "custom", "stack"
| |
*/ */
'channels' => [ 'channels' => [
'stack' => [ 'stack' => [
'driver' => 'stack', 'driver' => 'stack',
'channels' => ['single', 'flare'], 'channels' => ['single', 'flare'],
'ignore_exceptions' => false, 'ignore_exceptions' => false,
], ],
'console' => [ 'console' => [
'driver' => 'stack', 'driver' => 'stack',
'channels' => ['single', 'stdout', 'flare'], 'channels' => ['single', 'stdout', 'flare'],
'ignore_exceptions' => false, 'ignore_exceptions' => false,
], ],
'console_debug' => [ 'console_debug' => [
'driver' => 'stack', 'driver' => 'stack',
'channels' => ['single', 'stdout_debug'], 'channels' => ['single', 'stdout_debug'],
'ignore_exceptions' => false, 'ignore_exceptions' => false,
], ],
'single' => [ 'single' => [
'driver' => 'single', 'driver' => 'single',
'path' => env('APP_LOG', \LibreNMS\Config::get('log_file', base_path('logs/librenms.log'))), 'path' => env('APP_LOG', \LibreNMS\Config::get('log_file', base_path('logs/librenms.log'))),
'formatter' => \App\Logging\NoColorFormatter::class, 'formatter' => \App\Logging\NoColorFormatter::class,
'level' => env('LOG_LEVEL', 'error'), 'level' => env('LOG_LEVEL', 'error'),
], ],
'daily' => [ 'daily' => [
'driver' => 'daily', 'driver' => 'daily',
'path' => env('APP_LOG', \LibreNMS\Config::get('log_file', base_path('logs/librenms.log'))), 'path' => env('APP_LOG', \LibreNMS\Config::get('log_file', base_path('logs/librenms.log'))),
'formatter' => \App\Logging\NoColorFormatter::class, 'formatter' => \App\Logging\NoColorFormatter::class,
'level' => env('LOG_LEVEL', 'error'), 'level' => env('LOG_LEVEL', 'error'),
'days' => 14, 'days' => 14,
], ],
'slack' => [ 'slack' => [
'driver' => 'slack', 'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'), 'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log', 'username' => 'Laravel Log',
'emoji' => ':boom:', 'emoji' => ':boom:',
'level' => env('LOG_LEVEL', 'critical'), 'level' => env('LOG_LEVEL', 'critical'),
], ],
'papertrail' => [ 'papertrail' => [
'driver' => 'monolog', 'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'), 'level' => env('LOG_LEVEL', 'debug'),
'handler' => SyslogUdpHandler::class, 'handler' => SyslogUdpHandler::class,
'handler_with' => [ 'handler_with' => [
'host' => env('PAPERTRAIL_URL'), 'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'), 'port' => env('PAPERTRAIL_PORT'),
], ],
], ],
'stderr' => [ 'stderr' => [
'driver' => 'monolog', 'driver' => 'monolog',
'handler' => StreamHandler::class, 'handler' => StreamHandler::class,
'formatter' => \App\Logging\CliColorFormatter::class, 'formatter' => \App\Logging\CliColorFormatter::class,
'with' => [ 'with' => [
'stream' => 'php://stderr', 'stream' => 'php://stderr',
], ],
'level' => 'debug', 'level' => 'debug',
], ],
'stdout_debug' => [ 'stdout_debug' => [
'driver' => 'monolog', 'driver' => 'monolog',
'handler' => StreamHandler::class, 'handler' => StreamHandler::class,
'formatter' => \App\Logging\CliColorFormatter::class, 'formatter' => \App\Logging\CliColorFormatter::class,
'with' => [ 'with' => [
'stream' => 'php://output', 'stream' => 'php://output',
], ],
'level' => 'debug', 'level' => 'debug',
], ],
'stdout' => [ 'stdout' => [
'driver' => 'monolog', 'driver' => 'monolog',
'handler' => StreamHandler::class, 'handler' => StreamHandler::class,
'formatter' => \App\Logging\CliColorFormatter::class, 'formatter' => \App\Logging\CliColorFormatter::class,
'with' => [ 'with' => [
'stream' => 'php://output', 'stream' => 'php://output',
], ],
'level' => 'info', 'level' => 'info',
], ],
'syslog' => [ 'syslog' => [
'driver' => 'syslog', 'driver' => 'syslog',
'level' => env('LOG_LEVEL', 'debug'), 'level' => env('LOG_LEVEL', 'debug'),
], ],
'errorlog' => [ 'errorlog' => [
'driver' => 'errorlog', 'driver' => 'errorlog',
'level' => env('LOG_LEVEL', 'debug'), 'level' => env('LOG_LEVEL', 'debug'),
], ],
'null' => [ 'null' => [
'driver' => 'monolog', 'driver' => 'monolog',
'handler' => NullHandler::class, 'handler' => NullHandler::class,
], ],
'emergency' => [ 'emergency' => [
'path' => storage_path('logs/laravel.log'), 'path' => storage_path('logs/laravel.log'),
], ],
'flare' => [ 'flare' => [
'driver' => 'flare', 'driver' => 'flare',
], ],
], ],
]; ];

View File

@ -8,94 +8,94 @@
| request an environment variable to be created upstream or send a pull request. | request an environment variable to be created upstream or send a pull request.
*/ */
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Default Queue Connection Name | Default Queue Connection Name
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Laravel's queue API supports an assortment of back-ends via a single | Laravel's queue API supports an assortment of back-ends via a single
| API, giving you convenient access to each back-end using the same | API, giving you convenient access to each back-end using the same
| syntax for every one. Here you may define a default connection. | syntax for every one. Here you may define a default connection.
| |
*/ */
'default' => env('QUEUE_CONNECTION', 'sync'), 'default' => env('QUEUE_CONNECTION', 'sync'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Queue Connections | Queue Connections
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Here you may configure the connection information for each server that | Here you may configure the connection information for each server that
| is used by your application. A default configuration has been added | is used by your application. A default configuration has been added
| for each back-end shipped with Laravel. You are free to add more. | for each back-end shipped with Laravel. You are free to add more.
| |
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
| |
*/ */
'connections' => [ 'connections' => [
'sync' => [ 'sync' => [
'driver' => 'sync', 'driver' => 'sync',
], ],
'database' => [ 'database' => [
'driver' => 'database', 'driver' => 'database',
'table' => 'jobs', 'table' => 'jobs',
'queue' => 'default', 'queue' => 'default',
'retry_after' => 90, 'retry_after' => 90,
'after_commit' => false, 'after_commit' => false,
], ],
'beanstalkd' => [ 'beanstalkd' => [
'driver' => 'beanstalkd', 'driver' => 'beanstalkd',
'host' => 'localhost', 'host' => 'localhost',
'queue' => 'default', 'queue' => 'default',
'retry_after' => 90, 'retry_after' => 90,
'block_for' => 0, 'block_for' => 0,
'after_commit' => false, 'after_commit' => false,
], ],
'sqs' => [ 'sqs' => [
'driver' => 'sqs', 'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'), 'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'), 'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'default'), 'queue' => env('SQS_QUEUE', 'default'),
'suffix' => env('SQS_SUFFIX'), 'suffix' => env('SQS_SUFFIX'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'after_commit' => false, 'after_commit' => false,
], ],
'redis' => [ 'redis' => [
'driver' => 'redis', 'driver' => 'redis',
'connection' => 'default', 'connection' => 'default',
'queue' => env('REDIS_QUEUE', 'default'), 'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90, 'retry_after' => 90,
'block_for' => null, 'block_for' => null,
'after_commit' => false, 'after_commit' => false,
], ],
], ],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Failed Queue Jobs | Failed Queue Jobs
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| These options configure the behavior of failed queue job logging so you | These options configure the behavior of failed queue job logging so you
| can control which database and table are used to store the jobs that | can control which database and table are used to store the jobs that
| have failed. You may change them to any database / table you wish. | have failed. You may change them to any database / table you wish.
| |
*/ */
'failed' => [ 'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
'database' => env('DB_CONNECTION', 'mysql'), 'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs', 'table' => 'failed_jobs',
], ],
]; ];

View File

@ -8,34 +8,34 @@
| request an environment variable to be created upstream or send a pull request. | request an environment variable to be created upstream or send a pull request.
*/ */
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Third Party Services | Third Party Services
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| This file is for storing the credentials for third party services such | This file is for storing the credentials for third party services such
| as Mailgun, Postmark, AWS and more. This file provides the de facto | as Mailgun, Postmark, AWS and more. This file provides the de facto
| location for this type of information, allowing packages to have | location for this type of information, allowing packages to have
| a conventional file to locate the various service credentials. | a conventional file to locate the various service credentials.
| |
*/ */
'mailgun' => [ 'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'), 'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'), 'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
], ],
'postmark' => [ 'postmark' => [
'token' => env('POSTMARK_TOKEN'), 'token' => env('POSTMARK_TOKEN'),
], ],
'ses' => [ 'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'), 'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'), 'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
], ],
]; ];

View File

@ -8,19 +8,19 @@
| request an environment variable to be created upstream or send a pull request. | request an environment variable to be created upstream or send a pull request.
*/ */
return [ return [
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Alias Blacklist | Alias Blacklist
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| |
| Typically, Tinker automatically aliases classes as you require them in | Typically, Tinker automatically aliases classes as you require them in
| Tinker. However, you may wish to never alias certain classes, which | Tinker. However, you may wish to never alias certain classes, which
| you may accomplish by listing the classes in the following array. | you may accomplish by listing the classes in the following array.
| |
*/ */
'dont_alias' => [], 'dont_alias' => [],
]; ];

View File

@ -8,6 +8,6 @@
| request an environment variable to be created upstream or send a pull request. | request an environment variable to be created upstream or send a pull request.
*/ */
return [ return [
'options' => [], 'options' => [],
]; ];

View File

@ -164,8 +164,8 @@ if ($options['f'] === 'handle_notifiable') {
Notifications::create($title, "The daily update script (daily.sh) has failed on $poller_name." Notifications::create($title, "The daily update script (daily.sh) has failed on $poller_name."
. 'Please check output by hand. If you need assistance, ' . 'Please check output by hand. If you need assistance, '
. 'visit the <a href="https://www.librenms.org/#support">LibreNMS Website</a> to find out how.', . 'visit the <a href="https://www.librenms.org/#support">LibreNMS Website</a> to find out how.',
'daily.sh', 'daily.sh',
2 2
); );
} }
} elseif ($options['t'] === 'phpver') { } elseif ($options['t'] === 'phpver') {

View File

@ -168,7 +168,7 @@ if (isset($_GET['format']) && preg_match('/^[a-z]*$/', $_GET['format'])) {
if ($_GET['debug'] == 1) { if ($_GET['debug'] == 1) {
echo '<pre>$map</pre>'; echo '<pre>$map</pre>';
exit(); exit;
} }
switch ($_GET['format']) { switch ($_GET['format']) {
@ -179,7 +179,7 @@ if (isset($_GET['format']) && preg_match('/^[a-z]*$/', $_GET['format'])) {
break; break;
case 'dot': case 'dot':
echo $map; echo $map;
exit(); exit;
default: default:
$_GET['format'] = 'png:gd'; $_GET['format'] = 'png:gd';
} }

View File

@ -123,7 +123,7 @@ function get95thagg($bill_id, $datefrom, $dateto)
$mq_sql = 'SELECT count(delta) FROM bill_data WHERE bill_id = ?'; $mq_sql = 'SELECT count(delta) FROM bill_data WHERE bill_id = ?';
$mq_sql .= ' AND timestamp > ? AND timestamp <= ?'; $mq_sql .= ' AND timestamp > ? AND timestamp <= ?';
$measurements = dbFetchCell($mq_sql, [$bill_id, $datefrom, $dateto]); $measurements = dbFetchCell($mq_sql, [$bill_id, $datefrom, $dateto]);
$measurement_95th = (round(($measurements / 100 * 95)) - 1); $measurement_95th = (round($measurements / 100 * 95) - 1);
$q_95_sql = 'SELECT (delta / period * 8) AS rate FROM bill_data WHERE bill_id = ?'; $q_95_sql = 'SELECT (delta / period * 8) AS rate FROM bill_data WHERE bill_id = ?';
$q_95_sql .= ' AND timestamp > ? AND timestamp <= ? ORDER BY rate ASC'; $q_95_sql .= ' AND timestamp > ? AND timestamp <= ? ORDER BY rate ASC';
@ -138,7 +138,7 @@ function get95thIn($bill_id, $datefrom, $dateto)
$mq_sql = 'SELECT count(delta) FROM bill_data WHERE bill_id = ?'; $mq_sql = 'SELECT count(delta) FROM bill_data WHERE bill_id = ?';
$mq_sql .= ' AND timestamp > ? AND timestamp <= ?'; $mq_sql .= ' AND timestamp > ? AND timestamp <= ?';
$measurements = dbFetchCell($mq_sql, [$bill_id, $datefrom, $dateto]); $measurements = dbFetchCell($mq_sql, [$bill_id, $datefrom, $dateto]);
$measurement_95th = (round(($measurements / 100 * 95)) - 1); $measurement_95th = (round($measurements / 100 * 95) - 1);
$q_95_sql = 'SELECT (in_delta / period * 8) AS rate FROM bill_data WHERE bill_id = ?'; $q_95_sql = 'SELECT (in_delta / period * 8) AS rate FROM bill_data WHERE bill_id = ?';
$q_95_sql .= ' AND timestamp > ? AND timestamp <= ? ORDER BY rate ASC'; $q_95_sql .= ' AND timestamp > ? AND timestamp <= ? ORDER BY rate ASC';
@ -153,7 +153,7 @@ function get95thout($bill_id, $datefrom, $dateto)
$mq_sql = 'SELECT count(delta) FROM bill_data WHERE bill_id = ?'; $mq_sql = 'SELECT count(delta) FROM bill_data WHERE bill_id = ?';
$mq_sql .= ' AND timestamp > ? AND timestamp <= ?'; $mq_sql .= ' AND timestamp > ? AND timestamp <= ?';
$measurements = dbFetchCell($mq_sql, [$bill_id, $datefrom, $dateto]); $measurements = dbFetchCell($mq_sql, [$bill_id, $datefrom, $dateto]);
$measurement_95th = (round(($measurements / 100 * 95)) - 1); $measurement_95th = (round($measurements / 100 * 95) - 1);
$q_95_sql = 'SELECT (out_delta / period * 8) AS rate FROM bill_data WHERE bill_id = ?'; $q_95_sql = 'SELECT (out_delta / period * 8) AS rate FROM bill_data WHERE bill_id = ?';
$q_95_sql .= ' AND timestamp > ? AND timestamp <= ? ORDER BY rate ASC'; $q_95_sql .= ' AND timestamp > ? AND timestamp <= ? ORDER BY rate ASC';
@ -293,8 +293,8 @@ function getBillingBitsGraphData($bill_id, $from, $to, $reducefactor)
$tot_period += $period; $tot_period += $period;
if (++$iter >= $reducefactor) { if (++$iter >= $reducefactor) {
$out_data[$i] = round(($iter_out / $iter_period), 2); $out_data[$i] = round($iter_out / $iter_period, 2);
$in_data[$i] = round(($iter_in / $iter_period), 2); $in_data[$i] = round($iter_in / $iter_period, 2);
$tot_data[$i] = ($out_data[$i] + $in_data[$i]); $tot_data[$i] = ($out_data[$i] + $in_data[$i]);
$ticks[$i] = $timestamp; $ticks[$i] = $timestamp;
$i++; $i++;
@ -305,8 +305,8 @@ function getBillingBitsGraphData($bill_id, $from, $to, $reducefactor)
}//end foreach }//end foreach
if (! empty($iter_in)) { // Write last element if (! empty($iter_in)) { // Write last element
$out_data[$i] = round(($iter_out / $iter_period), 2); $out_data[$i] = round($iter_out / $iter_period, 2);
$in_data[$i] = round(($iter_in / $iter_period), 2); $in_data[$i] = round($iter_in / $iter_period, 2);
$tot_data[$i] = ($out_data[$i] + $in_data[$i]); $tot_data[$i] = ($out_data[$i] + $in_data[$i]);
$ticks[$i] = $timestamp; $ticks[$i] = $timestamp;
$i++; $i++;

View File

@ -122,7 +122,7 @@ if (Config::get('enable_bgp')) {
'bgpPeerDescr' => $value['bgpPeerDescr'] ?? '', 'bgpPeerDescr' => $value['bgpPeerDescr'] ?? '',
]; ];
$affected = DeviceCache::getPrimary()->bgppeers()->where('bgpPeerIdentifier', $address)->where('vrf_id', $vrfId)->update($peers); $affected = DeviceCache::getPrimary()->bgppeers()->where('bgpPeerIdentifier', $address)->where('vrf_id', $vrfId)->update($peers);
$seenPeerID[] = (DeviceCache::getPrimary()->bgppeers()->where('bgpPeerIdentifier', $address)->where('vrf_id', $vrfId)->select('bgpPeer_id')->orderBy('bgpPeer_id', 'ASC')->first()->bgpPeer_id); $seenPeerID[] = DeviceCache::getPrimary()->bgppeers()->where('bgpPeerIdentifier', $address)->where('vrf_id', $vrfId)->select('bgpPeer_id')->orderBy('bgpPeer_id', 'ASC')->first()->bgpPeer_id;
echo str_repeat('.', $affected); echo str_repeat('.', $affected);
$vrp_bgp_peer_count += $affected; $vrp_bgp_peer_count += $affected;

View File

@ -128,7 +128,7 @@ if (($device['os'] == 'routeros') && ($device['version'] <= '7.6')) {
}//end foreach }//end foreach
} }
echo PHP_EOL; echo PHP_EOL;
} elseif (($device['os'] == 'pbn' || $device['os'] == 'bdcom')) { } elseif ($device['os'] == 'pbn' || $device['os'] == 'bdcom') {
echo ' NMS-LLDP-MIB: '; echo ' NMS-LLDP-MIB: ';
$lldp_array = snmpwalk_group($device, 'lldpRemoteSystemsData', 'NMS-LLDP-MIB'); $lldp_array = snmpwalk_group($device, 'lldpRemoteSystemsData', 'NMS-LLDP-MIB');
@ -161,7 +161,7 @@ if (($device['os'] == 'routeros') && ($device['version'] <= '7.6')) {
} }
}//end foreach }//end foreach
echo PHP_EOL; echo PHP_EOL;
} elseif (($device['os'] == 'timos')) { } elseif ($device['os'] == 'timos') {
echo ' TIMETRA-LLDP-MIB: '; echo ' TIMETRA-LLDP-MIB: ';
$lldp_array = snmpwalk_group($device, 'tmnxLldpRemoteSystemsData', 'TIMETRA-LLDP-MIB'); $lldp_array = snmpwalk_group($device, 'tmnxLldpRemoteSystemsData', 'TIMETRA-LLDP-MIB');
foreach ($lldp_array as $key => $lldp) { foreach ($lldp_array as $key => $lldp) {
@ -195,7 +195,7 @@ if (($device['os'] == 'routeros') && ($device['version'] <= '7.6')) {
} }
}//end foreach }//end foreach
echo PHP_EOL; echo PHP_EOL;
} elseif (($device['os'] == 'jetstream')) { } elseif ($device['os'] == 'jetstream') {
echo ' JETSTREAM-LLDP MIB: '; echo ' JETSTREAM-LLDP MIB: ';
$lldp_array = snmpwalk_group($device, 'lldpNeighborInfoEntry', 'TPLINK-LLDPINFO-MIB'); $lldp_array = snmpwalk_group($device, 'lldpNeighborInfoEntry', 'TPLINK-LLDPINFO-MIB');
@ -259,7 +259,7 @@ if (($device['os'] == 'routeros') && ($device['version'] <= '7.6')) {
} }
} }
} }
if (($device['os'] == 'aos7')) { if ($device['os'] == 'aos7') {
$lldp_local = snmpwalk_cache_oid($device, 'lldpLocPortEntry', [], 'LLDP-MIB'); $lldp_local = snmpwalk_cache_oid($device, 'lldpLocPortEntry', [], 'LLDP-MIB');
$lldp_ports = snmpwalk_group($device, 'lldpLocPortId', 'LLDP-MIB'); $lldp_ports = snmpwalk_group($device, 'lldpLocPortId', 'LLDP-MIB');
} else { } else {
@ -270,14 +270,14 @@ if (($device['os'] == 'routeros') && ($device['version'] <= '7.6')) {
foreach ($lldp_array as $key => $lldp_if_array) { foreach ($lldp_array as $key => $lldp_if_array) {
foreach ($lldp_if_array as $entry_key => $lldp_instance) { foreach ($lldp_if_array as $entry_key => $lldp_instance) {
if (($device['os'] == 'aos7')) { if ($device['os'] == 'aos7') {
$ifName = $lldp_local[$entry_key]['lldpLocPortDesc']; $ifName = $lldp_local[$entry_key]['lldpLocPortDesc'];
} elseif (is_numeric($dot1d_array[$entry_key]['dot1dBasePortIfIndex'])) { } elseif (is_numeric($dot1d_array[$entry_key]['dot1dBasePortIfIndex'])) {
$ifIndex = $dot1d_array[$entry_key]['dot1dBasePortIfIndex']; $ifIndex = $dot1d_array[$entry_key]['dot1dBasePortIfIndex'];
} else { } else {
$ifIndex = $entry_key; $ifIndex = $entry_key;
} }
if (($device['os'] == 'aos7')) { if ($device['os'] == 'aos7') {
$local_port_id = find_port_id($ifName, null, $device['device_id']); $local_port_id = find_port_id($ifName, null, $device['device_id']);
} else { } else {
$local_port_id = find_port_id($lldp_ports[$entry_key]['lldpLocPortId'], $ifIndex, $device['device_id']); $local_port_id = find_port_id($lldp_ports[$entry_key]['lldpLocPortId'], $ifIndex, $device['device_id']);

View File

@ -51,11 +51,11 @@ foreach ($entity_array as $entPhysicalIndex => $entry) {
echo "\n"; echo "\n";
unset( unset(
$physical_name, $physical_name,
$serial_number, $serial_number,
$card_array, $card_array,
$card, $card,
$entry, $entry,
$entity_array, $entity_array,
$id $id
); );

View File

@ -125,7 +125,7 @@ if (is_null($tblUCSObjects)) {
} }
break; break;
// System Board - rack-unit-1/board // System Board - rack-unit-1/board
case '1.3.6.1.4.1.9.9.719.1.9.6.1': case '1.3.6.1.4.1.9.9.719.1.9.6.1':
foreach ($array[3] as $key => $item) { foreach ($array[3] as $key => $item) {
$result = []; $result = [];
@ -161,7 +161,7 @@ if (is_null($tblUCSObjects)) {
} }
break; break;
// Memory Modules - rack-unit-1/board/memarray-1/mem-0 // Memory Modules - rack-unit-1/board/memarray-1/mem-0
case '1.3.6.1.4.1.9.9.719.1.30.11.1': case '1.3.6.1.4.1.9.9.719.1.30.11.1':
foreach ($array[3] as $key => $item) { foreach ($array[3] as $key => $item) {
$result = []; $result = [];
@ -203,7 +203,7 @@ if (is_null($tblUCSObjects)) {
} }
break; break;
// CPU's - rack-unit-1/board/cpu-1 // CPU's - rack-unit-1/board/cpu-1
case '1.3.6.1.4.1.9.9.719.1.41.9.1': case '1.3.6.1.4.1.9.9.719.1.41.9.1':
foreach ($array[3] as $key => $item) { foreach ($array[3] as $key => $item) {
$result = []; $result = [];
@ -245,7 +245,7 @@ if (is_null($tblUCSObjects)) {
} }
break; break;
// SAS Storage Module - rack-unit-1/board/storage-SAS-2 // SAS Storage Module - rack-unit-1/board/storage-SAS-2
case '1.3.6.1.4.1.9.9.719.1.45.1.1': case '1.3.6.1.4.1.9.9.719.1.45.1.1':
foreach ($array[3] as $key => $item) { foreach ($array[3] as $key => $item) {
$result = []; $result = [];
@ -282,7 +282,7 @@ if (is_null($tblUCSObjects)) {
} }
break; break;
// SAS Disks - rack-unit-1/board/storage-SAS-2/disk-1 // SAS Disks - rack-unit-1/board/storage-SAS-2/disk-1
case '1.3.6.1.4.1.9.9.719.1.45.4.1': case '1.3.6.1.4.1.9.9.719.1.45.4.1':
foreach ($array[3] as $key => $item) { foreach ($array[3] as $key => $item) {
$result = []; $result = [];
@ -294,7 +294,7 @@ if (is_null($tblUCSObjects)) {
// Old Firmware returns 4294967296 as 1 MB. // Old Firmware returns 4294967296 as 1 MB.
// The if below assumes we will never have < 1 Gb on old firmware or > 4 Pb on new firmware // The if below assumes we will never have < 1 Gb on old firmware or > 4 Pb on new firmware
if (($array[13][$key]) > 4294967296000) { if ($array[13][$key] > 4294967296000) {
// Old Firmware // Old Firmware
$result['string'] = $array[14][$key] . ' ' . $array[7][$key] . ', Rev: ' . $array[11][$key] . ', Size: ' . round($array[13][$key] / 4294967296000, 2) . ' GB'; $result['string'] = $array[14][$key] . ' ' . $array[7][$key] . ', Rev: ' . $array[11][$key] . ', Size: ' . round($array[13][$key] / 4294967296000, 2) . ' GB';
d_echo('Disk: ' . $array[2][$key] . ', Raw Size: ' . $array[13][$key] . ', converted (old FW): ' . round($array[13][$key] / 4294967296000, 2) . "GB\n"); d_echo('Disk: ' . $array[2][$key] . ', Raw Size: ' . $array[13][$key] . ', converted (old FW): ' . round($array[13][$key] / 4294967296000, 2) . "GB\n");
@ -330,7 +330,7 @@ if (is_null($tblUCSObjects)) {
} }
break; break;
// LUN's - rack-unit-1/board/storage-SAS-2/lun-0 // LUN's - rack-unit-1/board/storage-SAS-2/lun-0
case '1.3.6.1.4.1.9.9.719.1.45.8.1': case '1.3.6.1.4.1.9.9.719.1.45.8.1':
foreach ($array[3] as $key => $item) { foreach ($array[3] as $key => $item) {
$result = []; $result = [];
@ -342,7 +342,7 @@ if (is_null($tblUCSObjects)) {
// Old Firmware returns 4294967296 as 1 MB. // Old Firmware returns 4294967296 as 1 MB.
// The if below assumes we will never have < 1 Gb on old firmware or > 4 Pb on new firmware // The if below assumes we will never have < 1 Gb on old firmware or > 4 Pb on new firmware
if (($array[13][$key]) > 4294967296000) { if ($array[13][$key] > 4294967296000) {
// Old Firmware // Old Firmware
$result['string'] = $array[3][$key] . ', Size: ' . round($array[13][$key] / 4294967296000, 2) . ' GB'; $result['string'] = $array[3][$key] . ', Size: ' . round($array[13][$key] / 4294967296000, 2) . ' GB';
d_echo('LUN: ' . $array[2][$key] . ', Raw Size: ' . $array[13][$key] . ', converted (Old FW): ' . round($array[13][$key] / 4294967296000, 2) . "GB\n"); d_echo('LUN: ' . $array[2][$key] . ', Raw Size: ' . $array[13][$key] . ', converted (Old FW): ' . round($array[13][$key] / 4294967296000, 2) . "GB\n");
@ -378,7 +378,7 @@ if (is_null($tblUCSObjects)) {
} }
break; break;
// RAID Battery - rack-unit-1/board/storage-SAS-2/raid-battery // RAID Battery - rack-unit-1/board/storage-SAS-2/raid-battery
case '1.3.6.1.4.1.9.9.719.1.45.11.1': case '1.3.6.1.4.1.9.9.719.1.45.11.1':
foreach ($array[3] as $key => $item) { foreach ($array[3] as $key => $item) {
$result = []; $result = [];
@ -415,7 +415,7 @@ if (is_null($tblUCSObjects)) {
} }
break; break;
// Fan's - rack-unit-1/fan-module-1-1/fan-1 // Fan's - rack-unit-1/fan-module-1-1/fan-1
case '1.3.6.1.4.1.9.9.719.1.15.12.1': case '1.3.6.1.4.1.9.9.719.1.15.12.1':
foreach ($array[3] as $key => $item) { foreach ($array[3] as $key => $item) {
$result = []; $result = [];
@ -452,7 +452,7 @@ if (is_null($tblUCSObjects)) {
} }
break; break;
// PSU's - rack-unit-1/psu-1 // PSU's - rack-unit-1/psu-1
case '1.3.6.1.4.1.9.9.719.1.15.56.1': case '1.3.6.1.4.1.9.9.719.1.15.56.1':
foreach ($array[3] as $key => $item) { foreach ($array[3] as $key => $item) {
$result = []; $result = [];
@ -489,7 +489,7 @@ if (is_null($tblUCSObjects)) {
} }
break; break;
// Adaptors - rack-unit-1/adaptor-1 // Adaptors - rack-unit-1/adaptor-1
case '1.3.6.1.4.1.9.9.719.1.3.85.1': case '1.3.6.1.4.1.9.9.719.1.3.85.1':
foreach ($array[3] as $key => $item) { foreach ($array[3] as $key => $item) {
$result = []; $result = [];
@ -526,7 +526,7 @@ if (is_null($tblUCSObjects)) {
} }
break; break;
// Unknown Table, ask the user to log an issue so this can be identified. // Unknown Table, ask the user to log an issue so this can be identified.
default: default:
d_echo("Cisco-CIMC Error...\n"); d_echo("Cisco-CIMC Error...\n");
d_echo("Please log an issue on github with the following information:\n"); d_echo("Please log an issue on github with the following information:\n");

View File

@ -15,26 +15,26 @@ if ($device['os'] == 'junos') {
$ai_mib = 'AI-AP-MIB'; $ai_mib = 'AI-AP-MIB';
$ai_ig_data = snmpwalk_group($device, 'aiInfoGroup', $ai_mib); $ai_ig_data = snmpwalk_group($device, 'aiInfoGroup', $ai_mib);
discover_entity_physical( discover_entity_physical(
$valid, $valid,
$device, $device,
1, // entPhysicalIndex 1, // entPhysicalIndex
$ai_ig_data['aiVirtualControllerIPAddress.0'], // entPhysicalDescr $ai_ig_data['aiVirtualControllerIPAddress.0'], // entPhysicalDescr
'chassis', // entPhysicalClass 'chassis', // entPhysicalClass
$ai_ig_data['aiVirtualControllerName.0'], // entPhysicalName $ai_ig_data['aiVirtualControllerName.0'], // entPhysicalName
'Instant Virtual Controller Cluster', // entPhysicalModelName 'Instant Virtual Controller Cluster', // entPhysicalModelName
$ai_ig_data['aiVirtualControllerKey.0'], // entPhysicalSerialNum $ai_ig_data['aiVirtualControllerKey.0'], // entPhysicalSerialNum
'0', // entPhysicalContainedIn '0', // entPhysicalContainedIn
'Aruba', // entPhysicalMfgName 'Aruba', // entPhysicalMfgName
'-1', // entPhysicalParentRelPos '-1', // entPhysicalParentRelPos
'Aruba', // entPhysicalVendorType 'Aruba', // entPhysicalVendorType
null, // entPhysicalHardwareRev null, // entPhysicalHardwareRev
null, // entPhysicalFirmwareRev null, // entPhysicalFirmwareRev
null, // entPhysicalSoftwareRev null, // entPhysicalSoftwareRev
null, // entPhysicalIsFRU null, // entPhysicalIsFRU
null, // entPhysicalAlias null, // entPhysicalAlias
null, // entPhysicalAssetID null, // entPhysicalAssetID
null // ifIndex null // ifIndex
); );
$entity_array = snmpwalk_group($device, 'aiAccessPointEntry', $ai_mib); $entity_array = snmpwalk_group($device, 'aiAccessPointEntry', $ai_mib);
$instant_index = 2; $instant_index = 2;

View File

@ -78,8 +78,8 @@ foreach ($entity_array as $entPhysicalIndex => $entry) {
echo "\n"; echo "\n";
unset( unset(
$update_data, $update_data,
$insert_data, $insert_data,
$entry, $entry,
$entity_array $entity_array
); );

View File

@ -85,24 +85,24 @@ foreach ($entity_array as $entPhysicalIndex => $entry) {
$ifIndex = array_key_exists('ifIndex', $entry) ? $entry['ifIndex'] : ''; $ifIndex = array_key_exists('ifIndex', $entry) ? $entry['ifIndex'] : '';
discover_entity_physical($valid, discover_entity_physical($valid,
$device, $device,
$entPhysicalIndex, $entPhysicalIndex,
$entPhysicalDescr, $entPhysicalDescr,
$entPhysicalClass, $entPhysicalClass,
$entPhysicalName, $entPhysicalName,
$entPhysicalModelName, $entPhysicalModelName,
$entPhysicalSerialNum, $entPhysicalSerialNum,
$entPhysicalContainedIn, $entPhysicalContainedIn,
$entPhysicalMfgName, $entPhysicalMfgName,
$entPhysicalParentRelPos, $entPhysicalParentRelPos,
$entPhysicalVendorType, $entPhysicalVendorType,
$entPhysicalHardwareRev, $entPhysicalHardwareRev,
$entPhysicalFirmwareRev, $entPhysicalFirmwareRev,
$entPhysicalSoftwareRev, $entPhysicalSoftwareRev,
$entPhysicalIsFRU, $entPhysicalIsFRU,
$entPhysicalAlias, $entPhysicalAlias,
$entPhysicalAssetID, $entPhysicalAssetID,
$ifIndex); $ifIndex);
}//end foreach }//end foreach
echo "\n"; echo "\n";

View File

@ -38,7 +38,7 @@ if (Config::get('enable_libvirt') && $device['os'] == 'linux') {
exec(Config::get('virsh') . ' -rc ' . $uri . ' list', $domlist); exec(Config::get('virsh') . ' -rc ' . $uri . ' list', $domlist);
foreach ($domlist as $dom) { foreach ($domlist as $dom) {
[$dom_id,] = explode(' ', trim($dom), 2); [$dom_id] = explode(' ', trim($dom), 2);
if (is_numeric($dom_id)) { if (is_numeric($dom_id)) {
// Fetch the Virtual Machine information. // Fetch the Virtual Machine information.

View File

@ -45,7 +45,7 @@ $components = $keep;
// Begin our master array, all other values will be processed into this array. // Begin our master array, all other values will be processed into this array.
$tblBigIP = []; $tblBigIP = [];
if ((snmp_get($device, 'sysModuleAllocationProvisionLevel.3.103.116.109', '-Ovqs', 'F5-BIGIP-SYSTEM-MIB')) != false) { if (snmp_get($device, 'sysModuleAllocationProvisionLevel.3.103.116.109', '-Ovqs', 'F5-BIGIP-SYSTEM-MIB') != false) {
$gtmWideIPEntry = snmpwalk_array_num($device, '1.3.6.1.4.1.3375.2.3.12.1.2.1', 0); $gtmWideIPEntry = snmpwalk_array_num($device, '1.3.6.1.4.1.3375.2.3.12.1.2.1', 0);
if (! is_null($gtmWideIPEntry)) { if (! is_null($gtmWideIPEntry)) {
$gtmWideStatusEntry = snmpwalk_array_num($device, '1.3.6.1.4.1.3375.2.3.12.3.2.1', 0); $gtmWideStatusEntry = snmpwalk_array_num($device, '1.3.6.1.4.1.3375.2.3.12.3.2.1', 0);

View File

@ -30,7 +30,7 @@ $ipForwardNb = snmp_get_multi($device, ['inetCidrRouteNumber.0', 'ipCidrRouteNum
//Get the configured max routes number //Get the configured max routes number
$max_routes = 1000; $max_routes = 1000;
if (null != (Config::get('routes_max_number'))) { if (null != Config::get('routes_max_number')) {
$max_routes = Config::get('routes_max_number'); $max_routes = Config::get('routes_max_number');
} }

View File

@ -27,7 +27,7 @@ foreach ($pre_cache['junos_ifotn_oids'] as $index => $entry) {
$limit = null; $limit = null;
$warn_limit = null; $warn_limit = null;
$tmp_exp = $pre_cache['junos_ifotn_oids'][$index . '.1']['jnxoptIfOTNPMCurrentFECBERExponent']; $tmp_exp = $pre_cache['junos_ifotn_oids'][$index . '.1']['jnxoptIfOTNPMCurrentFECBERExponent'];
$current = ($entry['jnxoptIfOTNPMCurrentFECBERMantissa']) * pow(10, (-$tmp_exp)); $current = $entry['jnxoptIfOTNPMCurrentFECBERMantissa'] * pow(10, -$tmp_exp);
$entPhysicalIndex = $index; $entPhysicalIndex = $index;
$entPhysicalIndex_measured = 'ports'; $entPhysicalIndex_measured = 'ports';
discover_sensor($valid['sensor'], 'ber', $device, $oid, $index, 'junos', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured); discover_sensor($valid['sensor'], 'ber', $device, $oid, $index, 'junos', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);

View File

@ -7,19 +7,19 @@ $value = snmp_get($device, 'upsEstimatedChargeRemaining.0', '-OvqU', 'UPS-MIB');
if (is_numeric($value)) { if (is_numeric($value)) {
discover_sensor( discover_sensor(
$valid['sensor'], $valid['sensor'],
'charge', 'charge',
$device, $device,
'.1.3.6.1.2.1.33.1.2.4.0', '.1.3.6.1.2.1.33.1.2.4.0',
500, 500,
'rfc1628', 'rfc1628',
'Battery charge remaining', 'Battery charge remaining',
1, 1,
1, 1,
15, 15,
50, 50,
null, null,
101, 101,
$value $value
); );
} }

View File

@ -20,8 +20,8 @@
// ***** Sensors for ADVA FSP3000 R7 // ***** Sensors for ADVA FSP3000 R7
// ************************************************************* // *************************************************************
$multiplier = 1; $multiplier = 1;
$divisor = 1000; $divisor = 1000;
if (is_array($pre_cache['adva_fsp3kr7_Card'])) { if (is_array($pre_cache['adva_fsp3kr7_Card'])) {
foreach (array_keys($pre_cache['adva_fsp3kr7_Card']) as $index) { foreach (array_keys($pre_cache['adva_fsp3kr7_Card']) as $index) {

View File

@ -15,7 +15,7 @@ if (isset($oids) && $oids) {
if ($data) { if ($data) {
[$oid,$kind] = explode(' ', $data); [$oid,$kind] = explode(' ', $data);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 1)]; $index = $split_oid[count($split_oid) - 1];
$current_oid = '.1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.' . $index; $current_oid = '.1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.' . $index;
// rPDULoadStatusLoad // rPDULoadStatusLoad
$phase_oid = '.1.3.6.1.4.1.318.1.1.12.2.3.1.1.4.' . $index; $phase_oid = '.1.3.6.1.4.1.318.1.1.12.2.3.1.1.4.' . $index;
@ -62,7 +62,7 @@ if (isset($oids) && $oids) {
continue; continue;
} }
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 1)]; $index = $split_oid[count($split_oid) - 1];
$current_oid = '.1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.' . $index; $current_oid = '.1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.' . $index;
// rPDULoadStatusLoad // rPDULoadStatusLoad
$phase_oid = '.1.3.6.1.4.1.318.1.1.12.2.3.1.1.4.' . $index; $phase_oid = '.1.3.6.1.4.1.318.1.1.12.2.3.1.1.4.' . $index;
@ -112,7 +112,7 @@ if (isset($oids) && $oids) {
continue; continue;
} }
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 1)]; $index = $split_oid[count($split_oid) - 1];
$descr = 'Bank ' . $banknum; $descr = 'Bank ' . $banknum;
$current_oid = '.1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.' . $index; $current_oid = '.1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.' . $index;
// rPDULoadStatusLoad // rPDULoadStatusLoad
@ -150,7 +150,7 @@ if (isset($oids) && $oids) {
if ($data) { if ($data) {
[$oid,$kind] = explode(' ', $data); [$oid,$kind] = explode(' ', $data);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 1)]; $index = $split_oid[count($split_oid) - 1];
$voltage_oid = '.1.3.6.1.4.1.318.1.1.26.6.3.1.6'; $voltage_oid = '.1.3.6.1.4.1.318.1.1.26.6.3.1.6';
// rPDU2PhaseStatusVoltage // rPDU2PhaseStatusVoltage
$current_oid = '.1.3.6.1.4.1.318.1.1.26.9.4.3.1.6.' . $index; $current_oid = '.1.3.6.1.4.1.318.1.1.26.9.4.3.1.6.' . $index;
@ -238,8 +238,8 @@ if (isset($in_oids)) {
} }
} }
} }
unset($index); unset($index);
unset($data); unset($data);
foreach ($oids as $index => $data) { foreach ($oids as $index => $data) {
$type = 'apcUPS'; $type = 'apcUPS';
$descr = 'Phase ' . substr($index, -1) . ' Output'; $descr = 'Phase ' . substr($index, -1) . ' Output';
@ -256,5 +256,5 @@ foreach ($oids as $index => $data) {
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, 1, null, null, null, null, $current); discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, 1, null, null, null, null, $current);
} }
} }
unset($index); unset($index);
unset($data); unset($data);

View File

@ -13,7 +13,7 @@ if ($inlet_oids) {
if ($inlet_data) { if ($inlet_data) {
[$inlet_oid,$inlet_descr] = explode(' ', $inlet_data, 2); [$inlet_oid,$inlet_descr] = explode(' ', $inlet_data, 2);
$inlet_split_oid = explode('.', $inlet_oid); $inlet_split_oid = explode('.', $inlet_oid);
$inlet_index = $inlet_split_oid[(count($inlet_split_oid) - 2)] . '.' . $inlet_split_oid[(count($inlet_split_oid) - 1)]; $inlet_index = $inlet_split_oid[count($inlet_split_oid) - 2] . '.' . $inlet_split_oid[count($inlet_split_oid) - 1];
$inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.$inlet_index.1"; $inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.$inlet_index.1";
$inlet_divisor = pow(10, snmp_get($device, "inletSensorDecimalDigits.$inlet_index.rmsCurrent", '-Ovq', 'PDU2-MIB')); $inlet_divisor = pow(10, snmp_get($device, "inletSensorDecimalDigits.$inlet_index.rmsCurrent", '-Ovq', 'PDU2-MIB'));
$inlet_current = (snmp_get($device, "measurementsInletSensorValue.$inlet_index.1", '-Ovq', 'PDU2-MIB') / $inlet_divisor); $inlet_current = (snmp_get($device, "measurementsInletSensorValue.$inlet_index.1", '-Ovq', 'PDU2-MIB') / $inlet_divisor);
@ -34,7 +34,7 @@ if ($outlet_oids) {
if ($outlet_data) { if ($outlet_data) {
[$outlet_oid,$outlet_descr] = explode(' ', $outlet_data, 2); [$outlet_oid,$outlet_descr] = explode(' ', $outlet_data, 2);
$outlet_split_oid = explode('.', $outlet_oid); $outlet_split_oid = explode('.', $outlet_oid);
$outlet_index = $outlet_split_oid[(count($outlet_split_oid) - 1)]; $outlet_index = $outlet_split_oid[count($outlet_split_oid) - 1];
$outletsuffix = "$outlet_index"; $outletsuffix = "$outlet_index";
$outlet_insert_index = $outlet_index; $outlet_insert_index = $outlet_index;
// outletLoadValue: "A non-negative value indicates the measured load in milli Amps" // outletLoadValue: "A non-negative value indicates the measured load in milli Amps"
@ -62,7 +62,7 @@ if ($outlet_oids) {
if ($outlet_data) { if ($outlet_data) {
[$outlet_oid,$outlet_descr] = explode(' ', $outlet_data, 2); [$outlet_oid,$outlet_descr] = explode(' ', $outlet_data, 2);
$outlet_split_oid = explode('.', $outlet_oid); $outlet_split_oid = explode('.', $outlet_oid);
$outlet_index = $outlet_split_oid[(count($outlet_split_oid) - 1)]; $outlet_index = $outlet_split_oid[count($outlet_split_oid) - 1];
$outletsuffix = "$outlet_index"; $outletsuffix = "$outlet_index";
$outlet_insert_index = $outlet_index; $outlet_insert_index = $outlet_index;
$outlet_oid = ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.$outletsuffix.1"; $outlet_oid = ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.$outletsuffix.1";

View File

@ -23,7 +23,7 @@ while ($towers <= $tower_count) {
if ($infeed_data) { if ($infeed_data) {
[$infeed_oid,$descr] = explode(' ', $infeed_data, 2); [$infeed_oid,$descr] = explode(' ', $infeed_data, 2);
$split_oid = explode('.', $infeed_oid); $split_oid = explode('.', $infeed_oid);
$infeed_index = $split_oid[(count($split_oid) - 1)]; $infeed_index = $split_oid[count($split_oid) - 1];
// infeedLoadValue // infeedLoadValue
$infeed_oid = '.1.3.6.1.4.1.1718.3.2.2.1.7.' . $towers . '.' . $infeed_index; $infeed_oid = '.1.3.6.1.4.1.1718.3.2.2.1.7.' . $towers . '.' . $infeed_index;
@ -55,7 +55,7 @@ while ($towers <= $tower_count) {
if ($outlet_data) { if ($outlet_data) {
[$outlet_oid,$outlet_descr] = explode(' ', $outlet_data, 2); [$outlet_oid,$outlet_descr] = explode(' ', $outlet_data, 2);
$outlet_split_oid = explode('.', $outlet_oid); $outlet_split_oid = explode('.', $outlet_oid);
$outlet_index = $outlet_split_oid[(count($outlet_split_oid) - 1)]; $outlet_index = $outlet_split_oid[count($outlet_split_oid) - 1];
$outletsuffix = "$towers.$infeed_index.$outlet_index"; $outletsuffix = "$towers.$infeed_index.$outlet_index";

View File

@ -18,8 +18,8 @@
//********* ADVA FSP3000 R7 Series //********* ADVA FSP3000 R7 Series
$multiplier = 1; $multiplier = 1;
$divisor = 10; $divisor = 10;
foreach ($pre_cache['adva_fsp3kr7'] as $index => $entry) { foreach ($pre_cache['adva_fsp3kr7'] as $index => $entry) {
if ($entry['entityFacilityAidString'] and $entry['pmSnapshotCurrentInputPower']) { if ($entry['entityFacilityAidString'] and $entry['pmSnapshotCurrentInputPower']) {

View File

@ -83,13 +83,13 @@ if (! empty($entity_oids)) {
if ($device['os'] === 'arista_eos') { if ($device['os'] === 'arista_eos') {
$descr = $entity_array[$index]['entPhysicalDescr']; $descr = $entity_array[$index]['entPhysicalDescr'];
if (preg_match('/(Input|Output) (voltage|current) sensor/i', $descr) || Str::startsWith($descr, 'Power supply') || preg_match('/^(Power Supply|Hotspot|Inlet|Board)/i', $descr)) { if (preg_match('/(Input|Output) (voltage|current) sensor/i', $descr) || Str::startsWith($descr, 'Power supply') || preg_match('/^(Power Supply|Hotspot|Inlet|Board)/i', $descr)) {
$descr = (ucwords($entity_array[substr_replace($index, '000', -3)]['entPhysicalDescr'] ?? '')) $descr = ucwords($entity_array[substr_replace($index, '000', -3)]['entPhysicalDescr'] ?? '')
. ' ' . ' '
. preg_replace( . preg_replace(
'/(Voltage|Current|Power Supply) Sensor$/i', '/(Voltage|Current|Power Supply) Sensor$/i',
'', '',
ucwords($entity_array[$index]['entPhysicalDescr']) ucwords($entity_array[$index]['entPhysicalDescr'])
); );
} }
if (preg_match('/(temp|temperature) sensor$/i', $descr)) { if (preg_match('/(temp|temperature) sensor$/i', $descr)) {
$descr = preg_replace('/(temp|temperature) sensor$/i', '', $descr); $descr = preg_replace('/(temp|temperature) sensor$/i', '', $descr);

View File

@ -12,7 +12,7 @@ foreach (explode("\n", $oids) as $data) {
if ($data) { if ($data) {
[$oid,$descr] = explode(' ', $data, 2); [$oid,$descr] = explode(' ', $data, 2);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 1)]; $index = $split_oid[count($split_oid) - 1];
$oid = '.1.3.6.1.4.1.18928.1.2.2.1.9.1.3.' . $index; $oid = '.1.3.6.1.4.1.18928.1.2.2.1.9.1.3.' . $index;
$current = snmp_get($device, $oid, '-Oqv', ''); $current = snmp_get($device, $oid, '-Oqv', '');

View File

@ -13,7 +13,7 @@ foreach (explode("\n", $oids) as $data) {
if ($data) { if ($data) {
[$oid,$kind] = explode(' ', $data); [$oid,$kind] = explode(' ', $data);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 1)]; $index = $split_oid[count($split_oid) - 1];
$fan_oid = ".1.3.6.1.4.1.674.10892.5.4.700.12.1.6.1.$index"; $fan_oid = ".1.3.6.1.4.1.674.10892.5.4.700.12.1.6.1.$index";
$descr_oid = "coolingDeviceLocationName.1.$index"; $descr_oid = "coolingDeviceLocationName.1.$index";
$limit_oid = "coolingDeviceLowerCriticalThreshold.1.$index"; $limit_oid = "coolingDeviceLowerCriticalThreshold.1.$index";

View File

@ -17,9 +17,9 @@ if (! empty($oids)) {
if (! empty($data)) { if (! empty($data)) {
[$oid,$descr] = explode(' = ', $data, 2); [$oid,$descr] = explode(' = ', $data, 2);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$num_index = $split_oid[(count($split_oid) - 1)]; $num_index = $split_oid[count($split_oid) - 1];
$index = $num_index; $index = $num_index;
$part_oid = $split_oid[(count($split_oid) - 2)]; $part_oid = $split_oid[count($split_oid) - 2];
$num_index = $part_oid . '.' . $num_index; $num_index = $part_oid . '.' . $num_index;
$base_oid = '.1.3.6.1.4.1.12740.2.1.7.1.3.1.'; $base_oid = '.1.3.6.1.4.1.12740.2.1.7.1.3.1.';
$oid = $base_oid . $num_index; $oid = $base_oid . $num_index;

View File

@ -13,7 +13,7 @@ foreach (explode("\n", $oids) as $data) {
if ($data) { if ($data) {
[$oid,$kind] = explode(' ', $data); [$oid,$kind] = explode(' ', $data);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 1)]; $index = $split_oid[count($split_oid) - 1];
if ($kind == 0) { if ($kind == 0) {
$fan_oid = ".1.3.6.1.4.1.10876.2.1.1.1.1.4.$index"; $fan_oid = ".1.3.6.1.4.1.10876.2.1.1.1.1.4.$index";
$descr_oid = ".1.3.6.1.4.1.10876.2.1.1.1.1.2.$index"; $descr_oid = ".1.3.6.1.4.1.10876.2.1.1.1.1.2.$index";

View File

@ -13,7 +13,7 @@ foreach (explode("\n", $oids) as $data) {
if ($data) { if ($data) {
[$oid,$descr] = explode(' ', $data, 2); [$oid,$descr] = explode(' ', $data, 2);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 1)]; $index = $split_oid[count($split_oid) - 1];
$oid = '.1.3.6.1.4.1.2021.13.16.3.1.3.' . $index; $oid = '.1.3.6.1.4.1.2021.13.16.3.1.3.' . $index;
$current = snmp_get($device, $oid, '-Oqv', 'LM-SENSORS-MIB'); $current = snmp_get($device, $oid, '-Oqv', 'LM-SENSORS-MIB');
$descr = trim(str_ireplace('fan-', '', $descr)); $descr = trim(str_ireplace('fan-', '', $descr));

View File

@ -16,10 +16,10 @@ foreach ($oids as $index => $entry) {
$value = snmp_get($device, $oid, '-Oqv', 'EXTREME-SYSTEM-MIB'); $value = snmp_get($device, $oid, '-Oqv', 'EXTREME-SYSTEM-MIB');
$descr = "Fan Speed $modindex"; $descr = "Fan Speed $modindex";
// round function used to round limit values to hundreds to avoid h/w/l limits being changed on every discovery as a change of 1rpm for fan speed would cause the limit values to change since they're dynamically calculated // round function used to round limit values to hundreds to avoid h/w/l limits being changed on every discovery as a change of 1rpm for fan speed would cause the limit values to change since they're dynamically calculated
$high_limit = round_Nth(($value * 1.5), 100); $high_limit = round_Nth($value * 1.5, 100);
$high_warn_limit = round_Nth(($value * 1.25), 100); $high_warn_limit = round_Nth($value * 1.25, 100);
$low_warn_limit = round_Nth(($value * 0.75), 100); $low_warn_limit = round_Nth($value * 0.75, 100);
$low_limit = round_Nth(($value * 0.5), 100); $low_limit = round_Nth($value * 0.5, 100);
if (is_numeric($value)) { if (is_numeric($value)) {
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'extreme-fanspeed', $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $value); discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'extreme-fanspeed', $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $value);
} }

View File

@ -14,7 +14,7 @@ foreach (explode("\n", $oids) as $data) {
if ($data) { if ($data) {
[$oid,$current] = explode(' ', $data, 2); [$oid,$current] = explode(' ', $data, 2);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 1)]; $index = $split_oid[count($split_oid) - 1];
$oid = '.1.3.6.1.4.1.318.1.1.8.5.3.2.1.4.' . $index; $oid = '.1.3.6.1.4.1.318.1.1.8.5.3.2.1.4.' . $index;
$descr = 'Input Feed ' . chr(64 + $index); $descr = 'Input Feed ' . chr(64 + $index);
discover_sensor($valid['sensor'], 'frequency', $device, $oid, "3.2.1.4.$index", $type, $descr, $divisor, '1', null, null, null, null, $current); discover_sensor($valid['sensor'], 'frequency', $device, $oid, "3.2.1.4.$index", $type, $descr, $divisor, '1', null, null, null, null, $current);
@ -35,7 +35,7 @@ foreach (explode("\n", $oids) as $data) {
if ($data) { if ($data) {
[$oid,$current] = explode(' ', $data, 2); [$oid,$current] = explode(' ', $data, 2);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 3)]; $index = $split_oid[count($split_oid) - 3];
$oid = '.1.3.6.1.4.1.318.1.1.8.5.4.2.1.4.' . $index; $oid = '.1.3.6.1.4.1.318.1.1.8.5.4.2.1.4.' . $index;
$descr = 'Output Feed'; $descr = 'Output Feed';
if (count(explode("\n", $oids)) > 1) { if (count(explode("\n", $oids)) > 1) {

View File

@ -29,9 +29,9 @@
*/ */
// Detect type of UPS (Signle-Phase/3 Phase) // Detect type of UPS (Signle-Phase/3 Phase)
// Number of input lines // Number of input lines
$upsInputNumLines_oid = '.1.3.6.1.2.1.33.1.3.2.0'; $upsInputNumLines_oid = '.1.3.6.1.2.1.33.1.3.2.0';
$in_phaseNum = snmp_get($device, $upsInputNumLines_oid, '-Oqv'); $in_phaseNum = snmp_get($device, $upsInputNumLines_oid, '-Oqv');
// Single-phase system // Single-phase system
if ($in_phaseNum == '1') { if ($in_phaseNum == '1') {

View File

@ -12,7 +12,7 @@ foreach (explode("\n", $inlet_oids) as $inlet_data) {
if ($inlet_data) { if ($inlet_data) {
[$inlet_oid,$inlet_descr] = explode(' ', $inlet_data, 2); [$inlet_oid,$inlet_descr] = explode(' ', $inlet_data, 2);
$inlet_split_oid = explode('.', $inlet_oid); $inlet_split_oid = explode('.', $inlet_oid);
$inlet_index = $inlet_split_oid[(count($inlet_split_oid) - 2)] . '.' . $inlet_split_oid[(count($inlet_split_oid) - 1)]; $inlet_index = $inlet_split_oid[count($inlet_split_oid) - 2] . '.' . $inlet_split_oid[count($inlet_split_oid) - 1];
$inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.$inlet_index.23"; $inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.$inlet_index.23";
$inlet_divisor = pow(10, snmp_get($device, "inletSensorDecimalDigits.$inlet_index.frequency", '-Ovq', 'PDU2-MIB')); $inlet_divisor = pow(10, snmp_get($device, "inletSensorDecimalDigits.$inlet_index.frequency", '-Ovq', 'PDU2-MIB'));

View File

@ -15,7 +15,7 @@ foreach (explode("\n", $oids) as $data) {
if ($status == 2) { if ($status == 2) {
// 2 = normal, 0 = not connected // 2 = normal, 0 = not connected
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 1)]; $index = $split_oid[count($split_oid) - 1];
$descr_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.1.$index"; $descr_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.1.$index";
$oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.3.$index"; $oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.3.$index";
$warnlimit_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.7.$index"; $warnlimit_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.7.$index";

View File

@ -44,7 +44,7 @@ if (! empty($dhcp_networks[$dhcp_networks_base_oid])) {
foreach ($dhcp_networks[$dhcp_networks_base_oid] as $dhcp_type_index => $ignore_this) { foreach ($dhcp_networks[$dhcp_networks_base_oid] as $dhcp_type_index => $ignore_this) {
if (! empty($dhcp_networks[$dhcp_networks_base_oid][$dhcp_type_index])) { if (! empty($dhcp_networks[$dhcp_networks_base_oid][$dhcp_type_index])) {
foreach ($dhcp_networks[$dhcp_networks_base_oid][$dhcp_type_index] as $index => $entry) { foreach ($dhcp_networks[$dhcp_networks_base_oid][$dhcp_type_index] as $index => $entry) {
$description = (explode('[', $entry)); $description = explode('[', $entry);
$data_array[$array_index]['index'] = $index; $data_array[$array_index]['index'] = $index;
if ($dhcp_type_index === intval($auth_dhcp_index)) { if ($dhcp_type_index === intval($auth_dhcp_index)) {
$data_array[$array_index]['type'] = 'dhcpatriotAuthDHCP'; $data_array[$array_index]['type'] = 'dhcpatriotAuthDHCP';

View File

@ -27,9 +27,9 @@
*/ */
// Detect type of UPS (Signle-Phase/3 Phase) // Detect type of UPS (Signle-Phase/3 Phase)
// Number of input lines // Number of input lines
$upsInputNumLines_oid = '.1.3.6.1.2.1.33.1.3.2.0'; $upsInputNumLines_oid = '.1.3.6.1.2.1.33.1.3.2.0';
$in_phaseNum = snmp_get($device, $upsInputNumLines_oid, '-Oqv'); $in_phaseNum = snmp_get($device, $upsInputNumLines_oid, '-Oqv');
// Single-phase system // Single-phase system
if ($in_phaseNum == '1') { if ($in_phaseNum == '1') {

View File

@ -13,7 +13,7 @@ foreach (explode("\n", $psus) as $psu) {
[$oid, $presence] = explode(' ', $psu, 2); [$oid, $presence] = explode(' ', $psu, 2);
if ($presence != 2) { if ($presence != 2) {
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$current_id = $split_oid[(count($split_oid) - 1)]; $current_id = $split_oid[count($split_oid) - 1];
$current_oid = $psu_usage_oid . $current_id; $current_oid = $psu_usage_oid . $current_id;
$psu_max_oid = $psu_max_usage_oid . $current_id; $psu_max_oid = $psu_max_usage_oid . $current_id;
$descr = 'PSU ' . $current_id . ' output'; $descr = 'PSU ' . $current_id . ' output';

View File

@ -13,7 +13,7 @@ if ($inlet_oids) {
if ($inlet_data) { if ($inlet_data) {
[$inlet_oid,$inlet_descr] = explode(' ', $inlet_data, 2); [$inlet_oid,$inlet_descr] = explode(' ', $inlet_data, 2);
$inlet_split_oid = explode('.', $inlet_oid); $inlet_split_oid = explode('.', $inlet_oid);
$inlet_index = $inlet_split_oid[(count($inlet_split_oid) - 2)] . '.' . $inlet_split_oid[(count($inlet_split_oid) - 1)]; $inlet_index = $inlet_split_oid[count($inlet_split_oid) - 2] . '.' . $inlet_split_oid[count($inlet_split_oid) - 1];
$inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.$inlet_index.5"; $inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.$inlet_index.5";
$inlet_divisor = pow(10, snmp_get($device, "inletSensorDecimalDigits.$inlet_index.activePower", '-Ovq', 'PDU2-MIB')); $inlet_divisor = pow(10, snmp_get($device, "inletSensorDecimalDigits.$inlet_index.activePower", '-Ovq', 'PDU2-MIB'));
$inlet_power = (snmp_get($device, "measurementsInletSensorValue.$inlet_index.activePower", '-Ovq', 'PDU2-MIB') / $inlet_divisor); $inlet_power = (snmp_get($device, "measurementsInletSensorValue.$inlet_index.activePower", '-Ovq', 'PDU2-MIB') / $inlet_divisor);
@ -34,12 +34,12 @@ if ($outlet_oids) {
if ($outlet_data) { if ($outlet_data) {
[$outlet_oid,$outlet_descr] = explode(' ', $outlet_data, 2); [$outlet_oid,$outlet_descr] = explode(' ', $outlet_data, 2);
$outlet_split_oid = explode('.', $outlet_oid); $outlet_split_oid = explode('.', $outlet_oid);
$outlet_index = $outlet_split_oid[(count($outlet_split_oid) - 1)]; $outlet_index = $outlet_split_oid[count($outlet_split_oid) - 1];
$outletsuffix = "$outlet_index"; $outletsuffix = "$outlet_index";
$outlet_insert_index = $outlet_index; $outlet_insert_index = $outlet_index;
$outlet_oid = ".1.3.6.1.4.1.13742.4.1.2.2.1.8.$outletsuffix"; $outlet_oid = ".1.3.6.1.4.1.13742.4.1.2.2.1.8.$outletsuffix";
$outlet_descr = snmp_get($device, "outletLabel.$outletsuffix", '-Ovq', 'PDU-MIB'); $outlet_descr = snmp_get($device, "outletLabel.$outletsuffix", '-Ovq', 'PDU-MIB');
$outlet_power = (snmp_get($device, "outletApparentPower.$outletsuffix", '-Ovq', 'PDU-MIB')); $outlet_power = snmp_get($device, "outletApparentPower.$outletsuffix", '-Ovq', 'PDU-MIB');
if ($outlet_power >= 0) { if ($outlet_power >= 0) {
discover_sensor($valid['sensor'], 'power', $device, $outlet_oid, $outlet_insert_index, 'raritan', $outlet_descr, $divisor, $multiplier, null, null, null, null, $outlet_power); discover_sensor($valid['sensor'], 'power', $device, $outlet_oid, $outlet_insert_index, 'raritan', $outlet_descr, $divisor, $multiplier, null, null, null, null, $outlet_power);
} }
@ -57,7 +57,7 @@ if ($outlet_oids) {
if ($outlet_data) { if ($outlet_data) {
[$outlet_oid,$outlet_descr] = explode(' ', $outlet_data, 2); [$outlet_oid,$outlet_descr] = explode(' ', $outlet_data, 2);
$outlet_split_oid = explode('.', $outlet_oid); $outlet_split_oid = explode('.', $outlet_oid);
$outlet_index = $outlet_split_oid[(count($outlet_split_oid) - 1)]; $outlet_index = $outlet_split_oid[count($outlet_split_oid) - 1];
$outletsuffix = "$outlet_index"; $outletsuffix = "$outlet_index";
$outlet_insert_index = $outlet_index; $outlet_insert_index = $outlet_index;
$outlet_oid = ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.$outletsuffix.5"; $outlet_oid = ".1.3.6.1.4.1.13742.6.5.4.3.1.4.1.$outletsuffix.5";

View File

@ -105,8 +105,8 @@ foreach ($cmc_iii_var_table as $index => $entry) {
} elseif ($unit == '%') { } elseif ($unit == '%') {
$type = 'percent'; $type = 'percent';
} }
$cmc_iii_sensors[$sensor_id]['type'] = $type; $cmc_iii_sensors[$sensor_id]['type'] = $type;
break; break;
} }
} }

View File

@ -23,7 +23,7 @@
* @author Ben Gibbons <axemann@gmail.com> * @author Ben Gibbons <axemann@gmail.com>
*/ */
// Input Contact discovery // Input Contact discovery
$contacts['emu2_contacts'] = snmpwalk_group($device, 'emsInputContactStatusEntry', 'PowerNet-MIB'); $contacts['emu2_contacts'] = snmpwalk_group($device, 'emsInputContactStatusEntry', 'PowerNet-MIB');

View File

@ -14,7 +14,7 @@ foreach ($aos6_fan_oids as $index => $data) {
$oid = '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.11.1.2.' . $index; $oid = '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.11.1.2.' . $index;
$state_name = 'alaChasEntPhysFanStatus'; $state_name = 'alaChasEntPhysFanStatus';
$current = $data['alaChasEntPhysFanStatus']; $current = $data['alaChasEntPhysFanStatus'];
[$revindex, $revchass, $revdata,] = explode('.', strrev($oid), 4); [$revindex, $revchass, $revdata] = explode('.', strrev($oid), 4);
$chassis = strrev($revchass); $chassis = strrev($revchass);
$indexName = strrev($revindex); $indexName = strrev($revindex);
$descr = 'Chassis-' . ($chassis - 568) . " Fan $indexName"; $descr = 'Chassis-' . ($chassis - 568) . " Fan $indexName";

View File

@ -53,7 +53,7 @@ if (! empty($oids)) {
if (! empty($data)) { if (! empty($data)) {
[$oid,$current] = explode(' = ', $data, 2); [$oid,$current] = explode(' = ', $data, 2);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$num_index = $split_oid[(count($split_oid) - 1)]; $num_index = $split_oid[count($split_oid) - 1];
$index = (int) cast_number($num_index); $index = (int) cast_number($num_index);
$low_limit = 0.5; $low_limit = 0.5;
$high_limit = 2.5; $high_limit = 2.5;
@ -97,9 +97,9 @@ if (! empty($oids1)) {
if (! empty($data)) { if (! empty($data)) {
[$oid,$descr] = explode(' = ', $data, 2); [$oid,$descr] = explode(' = ', $data, 2);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$num_index = $split_oid[(count($split_oid) - 1)]; $num_index = $split_oid[count($split_oid) - 1];
$index = (int) cast_number($num_index); $index = (int) cast_number($num_index);
$member_id = $split_oid[(count($split_oid) - 2)]; $member_id = $split_oid[count($split_oid) - 2];
$num_index = $member_id . '.' . $num_index; $num_index = $member_id . '.' . $num_index;
$oid = $base_oid . $num_index; $oid = $base_oid . $num_index;
$extra = snmp_get_multi($device, $oid, '-OQne', 'EQLMEMBER-MIB', 'equallogic'); $extra = snmp_get_multi($device, $oid, '-OQne', 'EQLMEMBER-MIB', 'equallogic');
@ -142,8 +142,8 @@ if (! empty($oids_disks)) {
if (! empty($data)) { if (! empty($data)) {
[$oid,$descr] = explode(' = ', $data, 2); [$oid,$descr] = explode(' = ', $data, 2);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$disk_index = $split_oid[(count($split_oid) - 1)]; $disk_index = $split_oid[count($split_oid) - 1];
$member_id = $split_oid[(count($split_oid) - 2)]; $member_id = $split_oid[count($split_oid) - 2];
$num_index = $member_id . '.' . $disk_index; $num_index = $member_id . '.' . $disk_index;
$oid = $disks_base_oid . $num_index; $oid = $disks_base_oid . $num_index;
$extra = snmp_get($device, $oid, '-OQne', 'EQLDISK-MIB', 'equallogic'); $extra = snmp_get($device, $oid, '-OQne', 'EQLDISK-MIB', 'equallogic');

View File

@ -20,7 +20,7 @@ if ($device['os'] == 'hirschmann') {
foreach ($oid as $index => $entry) { foreach ($oid as $index => $entry) {
//Discover Sensors //Discover Sensors
discover_sensor($valid['sensor'], 'state', $device, $cur_oid . $index, 'hmPowerSupplyStatus' . $index, $state_name, 'Power Supply ' . $oid[$index]['hmPSID'], 1, 1, null, null, null, null, ($oid[$index]['hmPowerSupplyStatus'] ?? null), 'snmp', 'hmPowerSupplyStatus' . $index); discover_sensor($valid['sensor'], 'state', $device, $cur_oid . $index, 'hmPowerSupplyStatus' . $index, $state_name, 'Power Supply ' . $oid[$index]['hmPSID'], 1, 1, null, null, null, null, $oid[$index]['hmPowerSupplyStatus'] ?? null, 'snmp', 'hmPowerSupplyStatus' . $index);
//Create Sensor To State Index //Create Sensor To State Index
create_sensor_to_state_index($device, $state_name, 'hmPowerSupplyStatus' . $index); create_sensor_to_state_index($device, $state_name, 'hmPowerSupplyStatus' . $index);

View File

@ -13,7 +13,7 @@ foreach (explode("\n", $fans) as $fan) {
[$oid, $presence] = explode(' ', $fan, 2); [$oid, $presence] = explode(' ', $fan, 2);
if ($presence != 2) { if ($presence != 2) {
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$current_id = $split_oid[(count($split_oid) - 1)]; $current_id = $split_oid[count($split_oid) - 1];
$current_oid = $fan_state_oid . $current_id; $current_oid = $fan_state_oid . $current_id;
$descr = $fan_state_descr . $current_id; $descr = $fan_state_descr . $current_id;
$state = snmp_get($device, $current_oid, '-Oqv'); $state = snmp_get($device, $current_oid, '-Oqv');
@ -45,7 +45,7 @@ foreach (explode("\n", $psus) as $psu) {
[$oid, $presence] = explode(' ', $psu, 2); [$oid, $presence] = explode(' ', $psu, 2);
if ($presence != 2) { if ($presence != 2) {
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$current_id = $split_oid[(count($split_oid) - 1)]; $current_id = $split_oid[count($split_oid) - 1];
$current_oid = $psu_state_oid . $current_id; $current_oid = $psu_state_oid . $current_id;
$descr = $psu_state_descr . $current_id; $descr = $psu_state_descr . $current_id;
$state = snmp_get($device, $current_oid, '-Oqv'); $state = snmp_get($device, $current_oid, '-Oqv');

View File

@ -24,7 +24,7 @@ if (is_array($fan_trays)) {
foreach ($fan_trays as $oid => $array) { foreach ($fan_trays as $oid => $array) {
$state = current($array); $state = current($array);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 1)]; $index = $split_oid[count($split_oid) - 1];
$current_oid = "$fan_tray_oid.$index"; $current_oid = "$fan_tray_oid.$index";
$entity_oid = '.1.3.6.1.2.1.47.1.1.1.1.7'; $entity_oid = '.1.3.6.1.2.1.47.1.1.1.1.7';

View File

@ -34,7 +34,7 @@ $serverscheck_oids = [
]; ];
foreach ($pre_cache['serverscheck_control'] as $oid_name => $oid_value) { foreach ($pre_cache['serverscheck_control'] as $oid_name => $oid_value) {
if ((Str::contains($oid_name, 'name')) && (Str::contains($oid_value, ['Flooding', 'Leckage']))) { if (Str::contains($oid_name, 'name') && Str::contains($oid_value, ['Flooding', 'Leckage'])) {
preg_match("/(\d+)/", $oid_name, $temp_x); preg_match("/(\d+)/", $oid_name, $temp_x);
$tmp_oid = 'sensor' . $temp_x[0] . 'Value.0'; $tmp_oid = 'sensor' . $temp_x[0] . 'Value.0';
$current = $pre_cache['serverscheck_control'][$tmp_oid]; $current = $pre_cache['serverscheck_control'][$tmp_oid];

View File

@ -26,8 +26,8 @@ if (is_array($voss_fan)) {
foreach ($voss_fan as $oid => $array) { foreach ($voss_fan as $oid => $array) {
$state = current($array); $state = current($array);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$tray_num = $split_oid[(count($split_oid) - 2)]; $tray_num = $split_oid[count($split_oid) - 2];
$fan_num = $split_oid[(count($split_oid) - 1)]; $fan_num = $split_oid[count($split_oid) - 1];
$current_oid = ".1.3.6.1.4.1.2272.1.101.1.1.4.1.4.$tray_num.$fan_num"; $current_oid = ".1.3.6.1.4.1.2272.1.101.1.1.4.1.4.$tray_num.$fan_num";
$descr = "VOSS Tray $tray_num Fan $fan_num"; $descr = "VOSS Tray $tray_num Fan $fan_num";
@ -47,7 +47,7 @@ if (is_array($voss_fan)) {
foreach ($fan as $oid => $array) { foreach ($fan as $oid => $array) {
$state = current($array); $state = current($array);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 1)]; $index = $split_oid[count($split_oid) - 1];
$current_oid = ".1.3.6.1.4.1.2272.1.4.7.1.1.2.$index"; $current_oid = ".1.3.6.1.4.1.2272.1.4.7.1.1.2.$index";
$descr = "VOSS Fan $index"; $descr = "VOSS Fan $index";
@ -78,7 +78,7 @@ if (is_array($power_supply)) {
foreach ($power_supply as $oid => $array) { foreach ($power_supply as $oid => $array) {
$state = current($array); $state = current($array);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 1)]; $index = $split_oid[count($split_oid) - 1];
$current_oid = ".1.3.6.1.4.1.2272.1.4.8.1.1.2.$index"; $current_oid = ".1.3.6.1.4.1.2272.1.4.8.1.1.2.$index";
$descr = "VOSS Power Supply $index"; $descr = "VOSS Power Supply $index";

View File

@ -20,8 +20,8 @@
// ***** Temperature Sensors for ADVA FSP3000 R7 // ***** Temperature Sensors for ADVA FSP3000 R7
// ************************************************************* // *************************************************************
$multiplier = 1; $multiplier = 1;
$divisor = 10; $divisor = 10;
if (is_array($pre_cache['adva_fsp3kr7_Card'])) { if (is_array($pre_cache['adva_fsp3kr7_Card'])) {
foreach (array_keys($pre_cache['adva_fsp3kr7_Card']) as $index) { foreach (array_keys($pre_cache['adva_fsp3kr7_Card']) as $index) {

View File

@ -13,7 +13,7 @@ foreach (explode("\n", $oids) as $data) {
if ($data) { if ($data) {
[$oid,$descr] = explode(' ', $data, 2); [$oid,$descr] = explode(' ', $data, 2);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$temperature_id = $split_oid[(count($split_oid) - 1)]; $temperature_id = $split_oid[count($split_oid) - 1];
$temperature_oid = ".1.3.6.1.4.1.18928.1.1.2.14.1.2.$temperature_id"; $temperature_oid = ".1.3.6.1.4.1.18928.1.1.2.14.1.2.$temperature_id";
$temperature = snmp_get($device, $temperature_oid, '-Oqv', ''); $temperature = snmp_get($device, $temperature_oid, '-Oqv', '');
$descr = "Hard disk $temperature_id"; $descr = "Hard disk $temperature_id";
@ -37,7 +37,7 @@ foreach (explode("\n", $oids) as $data) {
if ($data) { if ($data) {
[$oid,$descr] = explode(' ', $data, 2); [$oid,$descr] = explode(' ', $data, 2);
$split_oid = explode('.', $oid); $split_oid = explode('.', $oid);
$index = $split_oid[(count($split_oid) - 1)]; $index = $split_oid[count($split_oid) - 1];
$oid = '.1.3.6.1.4.1.18928.1.2.2.1.10.1.3.' . $index; $oid = '.1.3.6.1.4.1.18928.1.2.2.1.10.1.3.' . $index;
$current = snmp_get($device, $oid, '-Oqv', ''); $current = snmp_get($device, $oid, '-Oqv', '');

Some files were not shown because too many files have changed in this diff Show More