diff --git a/LibreNMS/Exceptions/FilePermissionsException.php b/LibreNMS/Exceptions/FilePermissionsException.php index b777caeaaf..a45d363172 100644 --- a/LibreNMS/Exceptions/FilePermissionsException.php +++ b/LibreNMS/Exceptions/FilePermissionsException.php @@ -46,14 +46,14 @@ class FilePermissionsException extends \Exception implements UpgradeableExceptio return new static(); } - // cannot write to bootstrap directory + // cannot write to bootstrap directory if ($exception instanceof \Exception && $exception->getMessage() == 'The bootstrap/cache directory must be present and writable.') { - return new static (); + return new static(); } - // monolog cannot init log file + // monolog cannot init log file if ($exception instanceof \UnexpectedValueException && str_contains($exception->getFile(), 'Monolog/Handler/StreamHandler.php')) { - return new static(); + return new static(); } return null; diff --git a/LibreNMS/OS/Timos.php b/LibreNMS/OS/Timos.php index 6b6c792081..953070c069 100644 --- a/LibreNMS/OS/Timos.php +++ b/LibreNMS/OS/Timos.php @@ -51,7 +51,7 @@ class Timos extends OS implements MplsDiscovery, MplsPolling { // implement other encapsulation values $map = sprintf("%032b", $tmnxEncapVal); - + if (substr($map, -32, 20) == '00000000000000000000') { // 12-bit IEEE 802.1Q VLAN ID if ($tmnxEncapVal == 4095) { return '*'; @@ -66,13 +66,13 @@ class Timos extends OS implements MplsDiscovery, MplsPolling * @param scheme * @return converted ifName * see TIMETRA-TC-MIB::TmnxPortID - */ + */ private function nokiaIfName($tmnxPortId, $scheme) { // Fixme implement other schemes and channels if ($scheme == 'schemeA') { $map = sprintf("%032b", $tmnxPortId); - + if (substr($map, -32, 4) == '0101') { // LAG Port if (substr($map, -28, 4) == '1011') { // Pseudowire Port return "pw-" . bindec(substr($map, -10, 10)); @@ -237,7 +237,7 @@ class Timos extends OS implements MplsDiscovery, MplsPolling } return $svcs; } - + /** * @return Collection MplsSap objects */ @@ -245,7 +245,7 @@ class Timos extends OS implements MplsDiscovery, MplsPolling { $mplsSapCache = snmpwalk_cache_multi_oid($this->getDevice(), 'sapBaseInfoTable', [], 'TIMETRA-SAP-MIB', 'nokia', '-OQUst'); $portScheme = snmp_get($this->getDevice(), 'tmnxChassisPortIdScheme.1', '-Oqv', 'TIMETRA-CHASSIS-MIB', 'nokia'); - + $saps = collect(); // Workaround, there are some oids not covered by actual MIB, try to filter them @@ -274,7 +274,7 @@ class Timos extends OS implements MplsDiscovery, MplsPolling 'sapAdminStatus' => $value['sapAdminStatus'], 'sapOperStatus' => $value['sapOperStatus'], 'sapLastMgmtChange' => round($value['sapLastMgmtChange'] / 100), - 'sapLastStatusChange' => round($value['sapLastStatusChange'] /100), + 'sapLastStatusChange' => round($value['sapLastStatusChange'] / 100), ])); } return $saps; @@ -330,12 +330,12 @@ class Timos extends OS implements MplsDiscovery, MplsPolling $mplsTunnelArHopCache = snmpwalk_cache_multi_oid($this->getDevice(), 'vRtrMplsTunnelARHopTable', $mplsTunnelArHopCache, 'TIMETRA-MPLS-MIB', 'nokia', '-OQUsb'); // vRtrMplsTunnelARHopProtection Bits - $localAvailable = 0b10000000; - $localInUse = 0b01000000; + $localAvailable = 0b10000000; + $localInUse = 0b01000000; $bandwidthProtected = 0b00100000; - $nodeProtected = 0b00010000; - $preemptionPending = 0b00001000; - $nodeId = 0b00000100; + $nodeProtected = 0b00010000; + $preemptionPending = 0b00001000; + $nodeId = 0b00000100; $arhops = collect(); @@ -347,7 +347,7 @@ class Timos extends OS implements MplsDiscovery, MplsPolling $localLinkProtection = ($protection & $localAvailable) ? "true" : "false"; $linkProtectionInUse = ($protection & $localInUse) ? "true" : "false"; $bandwidthProtection = ($protection & $bandwidthProtected) ? "true" : "false"; - $nextNodeProtection = ($protection & $nodeProtected) ? "true" : "false"; + $nextNodeProtection = ($protection & $nodeProtected) ? "true" : "false"; if (isset($mplsTunnelARHopListIndex, $mplsTunnelARHopIndex, $lsp_path_id)) { $arhops->push(new MplsTunnelArHop([ @@ -385,19 +385,19 @@ class Timos extends OS implements MplsDiscovery, MplsPolling $lsp_path_id = $paths->firstWhere('mplsLspPathTunnelCHopListIndex', $mplsTunnelCHopListIndex)->lsp_path_id; d_echo('mplsTunnelCHopListIndex: ' . $mplsTunnelCHopListIndex . ' mplsTunnelCHopIndex: ' . $mplsTunnelCHopIndex . ' path: ' . $paths->firstWhere('mplsLspPathTunnelCHopListIndex', $mplsTunnelCHopListIndex)); -# if (isset($mplsTunnelCHopListIndex, $mplsTunnelCHopIndex, $lsp_path_id)) { - $chops->push(new MplsTunnelCHop([ - 'mplsTunnelCHopListIndex' => $mplsTunnelCHopListIndex, - 'mplsTunnelCHopIndex' => $mplsTunnelCHopIndex, - 'lsp_path_id' => $lsp_path_id, - 'device_id' => $this->getDeviceId(), - 'mplsTunnelCHopAddrType' => $value['vRtrMplsTunnelCHopAddrType'], - 'mplsTunnelCHopIpv4Addr' => $value['vRtrMplsTunnelCHopIpv4Addr'], - 'mplsTunnelCHopIpv6Addr' => $value['vRtrMplsTunnelCHopIpv6Addr'], - 'mplsTunnelCHopAsNumber' => $value['vRtrMplsTunnelCHopAsNumber'], - 'mplsTunnelCHopStrictOrLoose' => $value['vRtrMplsTunnelCHopStrictOrLoose'], - 'mplsTunnelCHopRouterId' => $value['vRtrMplsTunnelCHopRtrID'], - ])); +# if (isset($mplsTunnelCHopListIndex, $mplsTunnelCHopIndex, $lsp_path_id)) { + $chops->push(new MplsTunnelCHop([ + 'mplsTunnelCHopListIndex' => $mplsTunnelCHopListIndex, + 'mplsTunnelCHopIndex' => $mplsTunnelCHopIndex, + 'lsp_path_id' => $lsp_path_id, + 'device_id' => $this->getDeviceId(), + 'mplsTunnelCHopAddrType' => $value['vRtrMplsTunnelCHopAddrType'], + 'mplsTunnelCHopIpv4Addr' => $value['vRtrMplsTunnelCHopIpv4Addr'], + 'mplsTunnelCHopIpv6Addr' => $value['vRtrMplsTunnelCHopIpv6Addr'], + 'mplsTunnelCHopAsNumber' => $value['vRtrMplsTunnelCHopAsNumber'], + 'mplsTunnelCHopStrictOrLoose' => $value['vRtrMplsTunnelCHopStrictOrLoose'], + 'mplsTunnelCHopRouterId' => $value['vRtrMplsTunnelCHopRtrID'], + ])); # } } return $chops; @@ -605,7 +605,7 @@ class Timos extends OS implements MplsDiscovery, MplsPolling 'sapAdminStatus' => $value['sapAdminStatus'], 'sapOperStatus' => $value['sapOperStatus'], 'sapLastMgmtChange' => round($value['sapLastMgmtChange'] / 100), - 'sapLastStatusChange' => round($value['sapLastStatusChange'] /100), + 'sapLastStatusChange' => round($value['sapLastStatusChange'] / 100), ])); } return $saps; @@ -660,12 +660,12 @@ class Timos extends OS implements MplsDiscovery, MplsPolling $mplsTunnelArHopCache = snmpwalk_cache_multi_oid($this->getDevice(), 'vRtrMplsTunnelARHopTable', $mplsTunnelArHopCache, 'TIMETRA-MPLS-MIB', 'nokia', '-OQUsb'); // vRtrMplsTunnelARHopProtection Bits - $localAvailable = 0b10000000; - $localInUse = 0b01000000; + $localAvailable = 0b10000000; + $localInUse = 0b01000000; $bandwidthProtected = 0b00100000; - $nodeProtected = 0b00010000; - $preemptionPending = 0b00001000; - $nodeId = 0b00000100; + $nodeProtected = 0b00010000; + $preemptionPending = 0b00001000; + $nodeId = 0b00000100; $arhops = collect(); @@ -677,7 +677,7 @@ class Timos extends OS implements MplsDiscovery, MplsPolling $localLinkProtection = ($protection & $localAvailable) ? "true" : "false"; $linkProtectionInUse = ($protection & $localInUse) ? "true" : "false"; $bandwidthProtection = ($protection & $bandwidthProtected) ? "true" : "false"; - $nextNodeProtection = ($protection & $nodeProtected) ? "true" : "false"; + $nextNodeProtection = ($protection & $nodeProtected) ? "true" : "false"; if (isset($mplsTunnelARHopListIndex, $mplsTunnelARHopIndex, $lsp_path_id)) { $arhops->push(new MplsTunnelArHop([ @@ -713,19 +713,19 @@ class Timos extends OS implements MplsDiscovery, MplsPolling list($mplsTunnelCHopListIndex, $mplsTunnelCHopIndex) = explode('.', $key); $lsp_path_id = $paths->firstWhere('mplsLspPathTunnelCHopListIndex', $mplsTunnelCHopListIndex)->lsp_path_id; -# if (isset($mplsTunnelCHopListIndex, $mplsTunnelCHopIndex, $lsp_path_id)) { - $chops->push(new MplsTunnelCHop([ - 'mplsTunnelCHopListIndex' => $mplsTunnelCHopListIndex, - 'mplsTunnelCHopIndex' => $mplsTunnelCHopIndex, - 'lsp_path_id' => $lsp_path_id, - 'device_id' => $this->getDeviceId(), - 'mplsTunnelCHopAddrType' => $value['vRtrMplsTunnelCHopAddrType'], - 'mplsTunnelCHopIpv4Addr' => $value['vRtrMplsTunnelCHopIpv4Addr'], - 'mplsTunnelCHopIpv6Addr' => $value['vRtrMplsTunnelCHopIpv6Addr'], - 'mplsTunnelCHopAsNumber' => $value['vRtrMplsTunnelCHopAsNumber'], - 'mplsTunnelCHopStrictOrLoose' => $value['vRtrMplsTunnelCHopStrictOrLoose'], - 'mplsTunnelCHopRouterId' => $value['vRtrMplsTunnelCHopRtrID'], - ])); +# if (isset($mplsTunnelCHopListIndex, $mplsTunnelCHopIndex, $lsp_path_id)) { + $chops->push(new MplsTunnelCHop([ + 'mplsTunnelCHopListIndex' => $mplsTunnelCHopListIndex, + 'mplsTunnelCHopIndex' => $mplsTunnelCHopIndex, + 'lsp_path_id' => $lsp_path_id, + 'device_id' => $this->getDeviceId(), + 'mplsTunnelCHopAddrType' => $value['vRtrMplsTunnelCHopAddrType'], + 'mplsTunnelCHopIpv4Addr' => $value['vRtrMplsTunnelCHopIpv4Addr'], + 'mplsTunnelCHopIpv6Addr' => $value['vRtrMplsTunnelCHopIpv6Addr'], + 'mplsTunnelCHopAsNumber' => $value['vRtrMplsTunnelCHopAsNumber'], + 'mplsTunnelCHopStrictOrLoose' => $value['vRtrMplsTunnelCHopStrictOrLoose'], + 'mplsTunnelCHopRouterId' => $value['vRtrMplsTunnelCHopRtrID'], + ])); # } } return $chops; diff --git a/composer.json b/composer.json index aa6b578fab..d9a6be2c30 100644 --- a/composer.json +++ b/composer.json @@ -66,7 +66,7 @@ "mockery/mockery": "^1.0", "nunomaduro/collision": "^3.0", "phpunit/phpunit": "^7.5", - "squizlabs/php_codesniffer": "^2.9.1", + "squizlabs/php_codesniffer": "^3.5", "staudenmeir/dusk-updater": "^1.1" }, "suggest": { diff --git a/composer.lock b/composer.lock index b9778dde06..c247cc422c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2338365a2a722060b58077360cfe46d9", + "content-hash": "54eb2cbe2d2a9aa1d48b61b2a0045c49", "packages": [ { "name": "amenadiel/jpgraph", @@ -7260,64 +7260,37 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.9.2", + "version": "3.5.4", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "2acf168de78487db620ab4bc524135a13cfe6745" + "reference": "dceec07328401de6211037abbb18bda423677e26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/2acf168de78487db620ab4bc524135a13cfe6745", - "reference": "2acf168de78487db620ab4bc524135a13cfe6745", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dceec07328401de6211037abbb18bda423677e26", + "reference": "dceec07328401de6211037abbb18bda423677e26", "shasum": "" }, "require": { "ext-simplexml": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", - "php": ">=5.1.2" + "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "bin": [ - "scripts/phpcs", - "scripts/phpcbf" + "bin/phpcs", + "bin/phpcbf" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "3.x-dev" } }, - "autoload": { - "classmap": [ - "CodeSniffer.php", - "CodeSniffer/CLI.php", - "CodeSniffer/Exception.php", - "CodeSniffer/File.php", - "CodeSniffer/Fixer.php", - "CodeSniffer/Report.php", - "CodeSniffer/Reporting.php", - "CodeSniffer/Sniff.php", - "CodeSniffer/Tokens.php", - "CodeSniffer/Reports/", - "CodeSniffer/Tokenizers/", - "CodeSniffer/DocGenerators/", - "CodeSniffer/Standards/AbstractPatternSniff.php", - "CodeSniffer/Standards/AbstractScopeSniff.php", - "CodeSniffer/Standards/AbstractVariableSniff.php", - "CodeSniffer/Standards/IncorrectPatternException.php", - "CodeSniffer/Standards/Generic/Sniffs/", - "CodeSniffer/Standards/MySource/Sniffs/", - "CodeSniffer/Standards/PEAR/Sniffs/", - "CodeSniffer/Standards/PSR1/Sniffs/", - "CodeSniffer/Standards/PSR2/Sniffs/", - "CodeSniffer/Standards/Squiz/Sniffs/", - "CodeSniffer/Standards/Zend/Sniffs/" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" @@ -7329,12 +7302,12 @@ } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", "standards" ], - "time": "2018-11-07T22:31:41+00:00" + "time": "2020-01-30T22:20:29+00:00" }, { "name": "staudenmeir/dusk-updater", diff --git a/html/install.php b/html/install.php index a7bba747c4..9b1d5fb76b 100644 --- a/html/install.php +++ b/html/install.php @@ -132,14 +132,14 @@ $complete = 1; + ?>
- @@ -157,7 +157,7 @@ if (!empty($msg)) { + ?>
@@ -172,68 +172,68 @@ if ($stage == 0) { Status Comments -PHP module $extension$status"; + } + + if (is_writable(session_save_path() === '' ? '/tmp' : session_save_path())) { + $status = 'yes'; $row_class = 'success'; } else { - $status = 'missing'; + $status = 'no'; $row_class = 'danger'; $complete = false; } - echo "PHP module $extension$status"; -} - -if (is_writable(session_save_path() === '' ? '/tmp' : session_save_path())) { - $status = 'yes'; - $row_class = 'success'; -} else { - $status = 'no'; - $row_class = 'danger'; - $complete = false; -} - -echo "Session directory writable$status"; -if ($status == 'no') { - echo session_save_path() . " is not writable"; - if (function_exists('posix_getgrgid')) { - $group_info = posix_getgrgid(filegroup(session_save_path())); - if ($group_info['gid'] !== 0) { // don't suggest adding users to the root group - $group = $group_info['name']; - $user = get_current_user(); - echo ", suggested fix usermod -a -G $group $user"; + echo "Session directory writable$status"; + if ($status == 'no') { + echo session_save_path() . " is not writable"; + if (function_exists('posix_getgrgid')) { + $group_info = posix_getgrgid(filegroup(session_save_path())); + if ($group_info['gid'] !== 0) { // don't suggest adding users to the root group + $group = $group_info['name']; + $user = get_current_user(); + echo ", suggested fix usermod -a -G $group $user"; + } } } -} -echo ""; + echo ""; -if (is_writable(Config::get('temp_dir'))) { - $status = 'yes'; - $row_class = 'success'; -} else { - $status = 'no'; - $row_class = 'danger'; - $complete = false; -} + if (is_writable(Config::get('temp_dir'))) { + $status = 'yes'; + $row_class = 'success'; + } else { + $status = 'no'; + $row_class = 'danger'; + $complete = false; + } -echo "Temporary directory writable$status"; -if ($status == 'no') { - echo Config::get('temp_dir') . ' is not writable'; - if (function_exists('posix_getgrgid')) { - $group_info = posix_getgrgid(filegroup(session_save_path())); - if ($group_info['gid'] !== 0) { // don't suggest adding users to the root group - $group = $group_info['name']; - $user = get_current_user(); - echo ", suggested fix chown $user:$group $php_temp_dir"; + echo "Temporary directory writable$status"; + if ($status == 'no') { + echo Config::get('temp_dir') . ' is not writable'; + if (function_exists('posix_getgrgid')) { + $group_info = posix_getgrgid(filegroup(session_save_path())); + if ($group_info['gid'] !== 0) { // don't suggest adding users to the root group + $group = $group_info['name']; + $user = get_current_user(); + echo ", suggested fix chown $user:$group $php_temp_dir"; + } } } -} -echo ""; -?> + echo ""; + ?>
@@ -252,9 +252,9 @@ echo ""; - + ?>
@@ -306,9 +306,9 @@ echo "";
- + ?>
@@ -368,17 +368,17 @@ echo ""; xhr.send(); $('#install-progress').addClass('active') - + ?>
-We couldn't create the config.php file, please create this manually before continuing by copying the below into a config.php in the root directory of your install (typically /opt/librenms/)
"); + echo("
<?php\n".stripslashes($config_file)."
"); + } else { + $config_file = stripslashes($config_file); + fwrite($conf, $config_file); + echo("
The config file has been created
"); + } + } else { echo("
We couldn't create the config.php file, please create this manually before continuing by copying the below into a config.php in the root directory of your install (typically /opt/librenms/)
"); echo("
<?php\n".stripslashes($config_file)."
"); - } else { - $config_file = stripslashes($config_file); - fwrite($conf, $config_file); - echo("
The config file has been created
"); } - } else { - echo("
We couldn't create the config.php file, please create this manually before continuing by copying the below into a config.php in the root directory of your install (typically /opt/librenms/)
"); - echo("
<?php\n".stripslashes($config_file)."
"); } -} -?> + ?>
@@ -448,16 +448,16 @@ if (!file_exists("{$librenms_dir}/config.php")) {
- + ?>
- + ?>
@@ -494,31 +494,31 @@ if (!file_exists("{$librenms_dir}/config.php")) {
- + ?>
-canManageUsers()) { - if (!LegacyAuth::get()->userExists($add_user)) { - if (LegacyAuth::get()->addUser($add_user, $add_pass, '10', $add_email)) { - echo("
User has been added successfully
"); - $proceed = 0; + canManageUsers()) { + if (!LegacyAuth::get()->userExists($add_user)) { + if (LegacyAuth::get()->addUser($add_user, $add_pass, '10', $add_email)) { + echo("
User has been added successfully
"); + $proceed = 0; + } else { + echo("
User hasn't been added, please try again
"); + } } else { - echo("
User hasn't been added, please try again
"); + echo("
User $add_user already exists!
"); } } else { - echo("
User $add_user already exists!
"); + echo("
Auth module isn't loaded
"); } -} else { - echo("
Auth module isn't loaded
"); -} -?> + ?>
@@ -538,9 +538,9 @@ if (LegacyAuth::get()->canManageUsers()) {
- + ?>
@@ -559,7 +559,7 @@ if (LegacyAuth::get()->canManageUsers()) {
- diff --git a/includes/discovery/bgp-peers.inc.php b/includes/discovery/bgp-peers.inc.php index e4530dfec5..1acbc1a8f9 100644 --- a/includes/discovery/bgp-peers.inc.php +++ b/includes/discovery/bgp-peers.inc.php @@ -115,7 +115,7 @@ if (Config::get('enable_bgp')) { if (!exist($bgpPeersCache[$vrfName]) || !exist($bgpPeersCache[$vrfName][$entry['bgpPeerIdentifier']]) || $bgpPeersCache[$vrfName][$entry['bgpPeerIdentifier']][$entry['afi']] != $afi || - $bgpPeersCache[$vrfName][$entry['bgpPeerIdentifier']][$entry['safi']] != $safi ) { + $bgpPeersCache[$vrfName][$entry['bgpPeerIdentifier']][$entry['safi']] != $safi) { dbDelete( 'bgpPeers_cbgp', '`device_id`=? AND `bgpPeerIdentifier`=? AND context_name=? AND afi=? AND safi=?', diff --git a/includes/discovery/mempools/alteonos.inc.php b/includes/discovery/mempools/alteonos.inc.php index e27d775114..93399cf35d 100644 --- a/includes/discovery/mempools/alteonos.inc.php +++ b/includes/discovery/mempools/alteonos.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2017 Simone Fini + * Copyright (c) 2017 Simone Fini * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/discovery/mempools/dnos-ftos.inc.php b/includes/discovery/mempools/dnos-ftos.inc.php index b9a72f537f..32e0fdb8f5 100644 --- a/includes/discovery/mempools/dnos-ftos.inc.php +++ b/includes/discovery/mempools/dnos-ftos.inc.php @@ -1,6 +1,6 @@ * This program is free software: you can redistribute it and/or modify it diff --git a/includes/discovery/mempools/ironware-dyn.inc.php b/includes/discovery/mempools/ironware-dyn.inc.php index 50cd5e21ed..121df4d953 100644 --- a/includes/discovery/mempools/ironware-dyn.inc.php +++ b/includes/discovery/mempools/ironware-dyn.inc.php @@ -9,8 +9,7 @@ if ($device['os'] == 'ironware' || $device['os_type'] == 'ironware') { if (is_numeric($percent)) { discover_mempool($valid_mempool, $device, 0, 'ironware-dyn', 'Dynamic Memory', '1', null, null); } //end_if - } //end_if - else { + } else { echo 'NetIron: '; d_echo('caching'); diff --git a/includes/discovery/mempools/junos.inc.php b/includes/discovery/mempools/junos.inc.php index 61d69166cb..f48caaeda8 100644 --- a/includes/discovery/mempools/junos.inc.php +++ b/includes/discovery/mempools/junos.inc.php @@ -26,8 +26,7 @@ if ($device['os'] == 'junos') { } } //end if } //end foreach - } //end if - else { + } else { $srx_mempools_array = snmpwalk_cache_multi_oid($device, 'jnxJsSPUMonitoringMemoryUsage', $srx_mempools_array, 'JUNIPER-SRX5000-SPU-MONITORING-MIB', 'junos'); if (is_array($srx_mempools_array)) { diff --git a/includes/discovery/route.inc.php b/includes/discovery/route.inc.php index b5409cdd24..12a2544081 100644 --- a/includes/discovery/route.inc.php +++ b/includes/discovery/route.inc.php @@ -41,7 +41,7 @@ $delete_row = []; //store timestamp so all update / creation will be synced on same timestamp $update_timestamp = dbFetchRows('select now() as now')[0]['now']; -//Load current DB entries: +//Load current DB entries: $dbRoute = dbFetchRows('select * from `route` where `device_id` = ?', array($device['device_id'])); foreach ($dbRoute as $dbRow) { $current = $mixed[$dbRow['context_name']][$dbRow['inetCidrRouteDestType']][$dbRow['inetCidrRouteDest']][$dbRow['inetCidrRoutePfxLen']][$dbRow['inetCidrRoutePolicy']][$dbRow['inetCidrRouteNextHopType']][$dbRow['inetCidrRouteNextHop']]; @@ -217,7 +217,7 @@ if (isset($ipForwardNb['0']['ipCidrRouteNumber']) && $ipForwardNb['0']['ipCidrRo } } -// We can now check if we have MPLS VPN routing table available : +// We can now check if we have MPLS VPN routing table available : // MPLS-L3VPN-STD-MIB::mplsL3VpnVrfRteTable // Route numbers : MPLS-L3VPN-STD-MIB::mplsL3VpnVrfPerfCurrNumRoutes diff --git a/includes/discovery/sensors/current/comware.inc.php b/includes/discovery/sensors/current/comware.inc.php index d71590bc67..389f17dca7 100644 --- a/includes/discovery/sensors/current/comware.inc.php +++ b/includes/discovery/sensors/current/comware.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your @@ -11,7 +11,7 @@ */ echo 'Comware '; - + $multiplier = 1; $divisor = 100000; $divisor_alarm = 1000000; diff --git a/includes/discovery/sensors/current/eatonpdu.inc.php b/includes/discovery/sensors/current/eatonpdu.inc.php index ff238f21cc..8ff749f8fc 100644 --- a/includes/discovery/sensors/current/eatonpdu.inc.php +++ b/includes/discovery/sensors/current/eatonpdu.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/discovery/sensors/fanspeed/dell.inc.php b/includes/discovery/sensors/fanspeed/dell.inc.php index e6fdd1b957..d649004487 100644 --- a/includes/discovery/sensors/fanspeed/dell.inc.php +++ b/includes/discovery/sensors/fanspeed/dell.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/discovery/sensors/power/dell-ups.inc.php b/includes/discovery/sensors/power/dell-ups.inc.php index 9de1b6e4f5..0a61e229b4 100644 --- a/includes/discovery/sensors/power/dell-ups.inc.php +++ b/includes/discovery/sensors/power/dell-ups.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2017 Søren Friis Rosiak + * Copyright (c) 2017 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/discovery/sensors/pre-cache/comware.inc.php b/includes/discovery/sensors/pre-cache/comware.inc.php index 3146e73f6a..46c0ed216d 100644 --- a/includes/discovery/sensors/pre-cache/comware.inc.php +++ b/includes/discovery/sensors/pre-cache/comware.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/discovery/sensors/runtime/dell-ups.inc.php b/includes/discovery/sensors/runtime/dell-ups.inc.php index 0deda1cbca..e82f76bc64 100644 --- a/includes/discovery/sensors/runtime/dell-ups.inc.php +++ b/includes/discovery/sensors/runtime/dell-ups.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2017 Søren Friis Rosiak + * Copyright (c) 2017 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/discovery/sensors/state/asa.inc.php b/includes/discovery/sensors/state/asa.inc.php index d24283dac1..a8774c5eaa 100644 --- a/includes/discovery/sensors/state/asa.inc.php +++ b/includes/discovery/sensors/state/asa.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/discovery/sensors/state/dell.inc.php b/includes/discovery/sensors/state/dell.inc.php index 339412d1d3..19cd859649 100644 --- a/includes/discovery/sensors/state/dell.inc.php +++ b/includes/discovery/sensors/state/dell.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/discovery/sensors/temperature/comware.inc.php b/includes/discovery/sensors/temperature/comware.inc.php index 9e044a3239..3a02560674 100644 --- a/includes/discovery/sensors/temperature/comware.inc.php +++ b/includes/discovery/sensors/temperature/comware.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/discovery/sensors/temperature/dell.inc.php b/includes/discovery/sensors/temperature/dell.inc.php index 1f418ac4f4..78cc6f0b40 100644 --- a/includes/discovery/sensors/temperature/dell.inc.php +++ b/includes/discovery/sensors/temperature/dell.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/discovery/sensors/voltage/comware.inc.php b/includes/discovery/sensors/voltage/comware.inc.php index 8f4c55cfc2..27891a94b4 100644 --- a/includes/discovery/sensors/voltage/comware.inc.php +++ b/includes/discovery/sensors/voltage/comware.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/html/collectd/definitions.local.php b/includes/html/collectd/definitions.local.php index 42301a0a57..62568cc810 100644 --- a/includes/html/collectd/definitions.local.php +++ b/includes/html/collectd/definitions.local.php @@ -49,18 +49,18 @@ function meta_graph_local($host, $plugin, $plugin_instance, $type, $type_instanc $opts['rrd_opts'] = array('-v', 'Events'); $files = array(); -/* $opts['colors'] = array( - 'ham' => '00e000', - 'spam' => '0000ff', - 'malware' => '990000', +/* $opts['colors'] = array( + 'ham' => '00e000', + 'spam' => '0000ff', + 'malware' => '990000', - 'sent' => '00e000', - 'deferred' => 'a0e000', - 'reject' => 'ff0000', - 'bounced' => 'a00050' - ); + 'sent' => '00e000', + 'deferred' => 'a0e000', + 'reject' => 'ff0000', + 'bounced' => 'a00050' + ); - $type_instances = array('ham', 'spam', 'malware', 'sent', 'deferred', 'reject', 'bounced'); */ + $type_instances = array('ham', 'spam', 'malware', 'sent', 'deferred', 'reject', 'bounced'); */ foreach ($type_instances as $inst) { $file = ''; foreach (\LibreNMS\Config::get('datadirs') as $datadir) { @@ -76,6 +76,6 @@ function meta_graph_local($host, $plugin, $plugin_instance, $type, $type_instanc $sources[] = array('name'=>$inst, 'file'=>$file); } -// return collectd_draw_meta_stack($opts, $sources); +// return collectd_draw_meta_stack($opts, $sources); return collectd_draw_meta_line($opts, $sources); } diff --git a/includes/html/collectd/definitions.php b/includes/html/collectd/definitions.php index 14d2c45a93..9822205c01 100644 --- a/includes/html/collectd/definitions.php +++ b/includes/html/collectd/definitions.php @@ -343,7 +343,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:rsp_avg:LAST:%5.1lf%s Last', 'GPRINT:rsp_avg_sum:LAST:(ca. %5.1lf%sB Total)\l', "LINE1:qry_avg#$FullBlue:Queries ", -// 'GPRINT:qry_min:MIN:%5.1lf %s ', +// 'GPRINT:qry_min:MIN:%5.1lf %s ', 'GPRINT:qry_avg:AVERAGE:%5.1lf%s ', 'GPRINT:qry_max:MAX:%5.1lf%s', 'GPRINT:qry_avg:LAST:%5.1lf%s Last', @@ -458,7 +458,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:ppm_avg:AVERAGE:%5.2lf', 'GPRINT:ppm_max:MAX:%5.2lf', 'GPRINT:ppm_avg:LAST:%5.2lf'); - $GraphDefs['frequency_offset'] = array( // NTPd + $GraphDefs['frequency_offset'] = array( // NTPd 'DEF:ppm_avg={file}:ppm:AVERAGE', 'DEF:ppm_min={file}:ppm:MIN', 'DEF:ppm_max={file}:ppm:MAX', @@ -470,7 +470,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:ppm_avg:AVERAGE:%5.2lf ', 'GPRINT:ppm_max:MAX:%5.2lf ', 'GPRINT:ppm_avg:LAST:%5.2lf'); - $GraphDefs['gauge'] = array( + $GraphDefs['gauge'] = array( #'-v', 'Exec value', 'DEF:temp_avg={file}:value:AVERAGE', 'DEF:temp_min={file}:value:MIN', @@ -482,7 +482,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:temp_avg:AVERAGE:%6.2lf', 'GPRINT:temp_max:MAX:%6.2lf', 'GPRINT:temp_avg:LAST:%6.2lf\l'); - $GraphDefs['hddtemp'] = array( + $GraphDefs['hddtemp'] = array( #'-v', '°C', 'DEF:temp_avg={file}:value:AVERAGE', 'DEF:temp_min={file}:value:MIN', @@ -494,7 +494,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:temp_avg:AVERAGE:%4.1lf', 'GPRINT:temp_max:MAX:%4.1lf', 'GPRINT:temp_avg:LAST:%4.1lf\l'); - $GraphDefs['humidity'] = array( + $GraphDefs['humidity'] = array( #'-v', 'Percent', 'DEF:temp_avg={file}:value:AVERAGE', 'DEF:temp_min={file}:value:MIN', @@ -506,7 +506,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:temp_avg:AVERAGE:%4.1lf%% ', 'GPRINT:temp_max:MAX:%4.1lf%%', 'GPRINT:temp_avg:LAST:%4.1lf%%\l'); - $GraphDefs['if_errors'] = array( + $GraphDefs['if_errors'] = array( #'-v', 'Errors/s', '--units=si', 'DEF:tx_min={file}:tx:MIN', @@ -532,12 +532,12 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:tx_avg:LAST:%5.1lf%s Last', 'GPRINT:tx_avg_sum:LAST:(ca. %4.0lf%s Total)\l', "LINE1:rx_avg#$FullBlue:RX", -// 'GPRINT:rx_min:MIN:%5.1lf %s ', +// 'GPRINT:rx_min:MIN:%5.1lf %s ', 'GPRINT:rx_avg:AVERAGE:%5.1lf%s ', 'GPRINT:rx_max:MAX:%5.1lf%s', 'GPRINT:rx_avg:LAST:%5.1lf%s Last', 'GPRINT:rx_avg_sum:LAST:(ca. %4.0lf%s Total)\l'); - $GraphDefs['if_collisions'] = array( + $GraphDefs['if_collisions'] = array( #'-v', 'Collisions/s', '--units=si', 'DEF:min_raw={file}:value:MIN', 'DEF:avg_raw={file}:value:AVERAGE', @@ -552,7 +552,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%5.1lf%s ', 'GPRINT:max:MAX:%5.1lf%s', 'GPRINT:avg:LAST:%5.1lf%s\l'); - $GraphDefs['if_dropped'] = array( + $GraphDefs['if_dropped'] = array( #'-v', 'Packets/s', '--units=si', 'DEF:tx_min={file}:tx:MIN', @@ -578,12 +578,12 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:tx_avg:LAST:%5.1lf%s Last', 'GPRINT:tx_avg_sum:LAST:(ca. %4.0lf%s Total)\l', "LINE1:rx_avg#$FullBlue:RX", -// 'GPRINT:rx_min:MIN:%5.1lf %s ', +// 'GPRINT:rx_min:MIN:%5.1lf %s ', 'GPRINT:rx_avg:AVERAGE:%5.1lf%s ', 'GPRINT:rx_max:MAX:%5.1lf%s', 'GPRINT:rx_avg:LAST:%5.1lf%s Last', 'GPRINT:rx_avg_sum:LAST:(ca. %4.0lf%s Total)\l'); - $GraphDefs['if_packets'] = array( + $GraphDefs['if_packets'] = array( #'-v', 'Packets/s', '--units=si', 'DEF:tx_min={file}:tx:MIN', @@ -609,12 +609,12 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:tx_avg:LAST:%5.1lf%s Last', 'GPRINT:tx_avg_sum:LAST:(ca. %4.0lf%s Total)\l', "LINE1:rx_avg#$FullBlue:RX", -// 'GPRINT:rx_min:MIN:%5.1lf %s ', +// 'GPRINT:rx_min:MIN:%5.1lf %s ', 'GPRINT:rx_avg:AVERAGE:%5.1lf%s ', 'GPRINT:rx_max:MAX:%5.1lf%s', 'GPRINT:rx_avg:LAST:%5.1lf%s Last', 'GPRINT:rx_avg_sum:LAST:(ca. %4.0lf%s Total)\l'); - $GraphDefs['if_rx_errors'] = array( + $GraphDefs['if_rx_errors'] = array( '-v', 'Errors/s', '--units=si', 'DEF:min={file}:value:MIN', 'DEF:avg={file}:value:AVERAGE', @@ -630,7 +630,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:max:MAX:%3.1lf%s', 'GPRINT:avg:LAST:%3.1lf%s Last', 'GPRINT:avg_sum:LAST:(ca. %2.0lf%s Total)\l'); - $GraphDefs['ipt_bytes'] = array( + $GraphDefs['ipt_bytes'] = array( #'-v', 'Bits/s', 'DEF:min_raw={file}:value:MIN', 'DEF:avg_raw={file}:value:AVERAGE', @@ -646,12 +646,12 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) "AREA:max#$HalfBlue", "AREA:min#$Canvas", "LINE1:avg#$FullBlue:Bits/s", -// 'GPRINT:min:MIN:%5.1lf %s ', +// 'GPRINT:min:MIN:%5.1lf %s ', 'GPRINT:avg:AVERAGE:%5.1lf%s ', 'GPRINT:max:MAX:%5.1lf%s', 'GPRINT:avg:LAST:%5.1lf%s Last', 'GPRINT:avg_sum:LAST:(ca. %5.1lf%sB Total)\l'); - $GraphDefs['ipt_packets'] = array( + $GraphDefs['ipt_packets'] = array( #'-v', 'Packets/s', 'DEF:min_raw={file}:value:MIN', 'DEF:avg_raw={file}:value:AVERAGE', @@ -666,7 +666,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%5.1lf%s ', 'GPRINT:max:MAX:%5.1lf%s', 'GPRINT:avg:LAST:%5.1lf%s\l'); - $GraphDefs['irq'] = array( + $GraphDefs['irq'] = array( #'-v', 'Issues/s', 'DEF:avg={file}:value:AVERAGE', 'DEF:min={file}:value:MIN', @@ -679,7 +679,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%6.2lf', 'GPRINT:max:MAX:%6.2lf', 'GPRINT:avg:LAST:%6.2lf\l'); - $GraphDefs['load'] = array( + $GraphDefs['load'] = array( #'-v', 'System load', 'DEF:s_avg={file}:shortterm:AVERAGE', 'DEF:s_min={file}:shortterm:MIN', @@ -707,7 +707,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:l_avg:AVERAGE:%5.2lf', 'GPRINT:l_max:MAX:%5.2lf', 'GPRINT:l_avg:LAST:%5.2lf\\j'); - $GraphDefs['load_percent'] = array( + $GraphDefs['load_percent'] = array( 'DEF:avg={file}:percent:AVERAGE', 'DEF:min={file}:percent:MIN', 'DEF:max={file}:percent:MAX', @@ -718,7 +718,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%5.1lf%s%% ', 'GPRINT:max:MAX:%5.1lf%s%%', 'GPRINT:avg:LAST:%5.1lf%s%%\l'); - $GraphDefs['mails'] = array( + $GraphDefs['mails'] = array( 'DEF:rawgood={file}:good:AVERAGE', 'DEF:rawspam={file}:spam:AVERAGE', 'CDEF:good=rawgood,UN,0,rawgood,IF', @@ -735,7 +735,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:spam:MAX:%4.1lf', 'GPRINT:spam:LAST:%4.1lf', 'HRULE:0#000000'); - $GraphDefs['memory'] = array( + $GraphDefs['memory'] = array( '-b', '1024', #'-v', 'Bytes', 'DEF:avg={file}:value:AVERAGE', @@ -748,7 +748,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%5.1lf%sbyte ', 'GPRINT:max:MAX:%5.1lf%sbyte', 'GPRINT:avg:LAST:%5.1lf%sbyte\l'); - $GraphDefs['old_memory'] = array( + $GraphDefs['old_memory'] = array( 'DEF:used_avg={file}:used:AVERAGE', 'DEF:free_avg={file}:free:AVERAGE', 'DEF:buffers_avg={file}:buffers:AVERAGE', @@ -790,7 +790,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:used_avg:AVERAGE:%5.1lf%s ', 'GPRINT:used_max:MAX:%5.1lf%s', 'GPRINT:used_avg:LAST:%5.1lf%s Last'); - $GraphDefs['mysql_commands'] = array( + $GraphDefs['mysql_commands'] = array( #'-v', 'Issues/s', "DEF:val_avg={file}:value:AVERAGE", "DEF:val_min={file}:value:MIN", @@ -802,7 +802,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:val_avg:AVERAGE:%5.2lf', 'GPRINT:val_max:MAX:%5.2lf', 'GPRINT:val_avg:LAST:%5.2lf'); - $GraphDefs['mysql_handler'] = array( + $GraphDefs['mysql_handler'] = array( #'-v', 'Issues/s', "DEF:val_avg={file}:value:AVERAGE", "DEF:val_min={file}:value:MIN", @@ -814,7 +814,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:val_avg:AVERAGE:%5.2lf', 'GPRINT:val_max:MAX:%5.2lf', 'GPRINT:val_avg:LAST:%5.2lf'); - $GraphDefs['mysql_octets'] = array( + $GraphDefs['mysql_octets'] = array( #'-v', 'Bits/s', 'DEF:dout_min={file}:tx:MIN', 'DEF:dout_avg={file}:tx:AVERAGE', @@ -854,7 +854,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:inc_bit_max:MAX:%5.1lf%s', 'GPRINT:inc_bit_min:MIN:%5.1lf%s\l', 'GPRINT:inc_avg_sum:LAST: (ca. %5.1lf%sB Total)\l'); - $GraphDefs['mysql_qcache'] = array( + $GraphDefs['mysql_qcache'] = array( #'-v', 'Queries/s', "DEF:hits_min={file}:hits:MIN", "DEF:hits_avg={file}:hits:AVERAGE", @@ -904,7 +904,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:queries_avg:AVERAGE:%4.0lf%s ', 'GPRINT:queries_max:MAX:%4.0lf%s ', 'GPRINT:queries_avg:LAST:%4.0lf%s\l'); - $GraphDefs['mysql_threads'] = array( + $GraphDefs['mysql_threads'] = array( #'-v', 'Threads', "DEF:running_min={file}:running:MIN", "DEF:running_avg={file}:running:AVERAGE", @@ -944,7 +944,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:created_avg:AVERAGE:%5.0lf', 'GPRINT:created_max:MAX:%5.0lf', 'GPRINT:created_avg:LAST:%5.0lf\l'); - $GraphDefs['nfs_procedure'] = array( + $GraphDefs['nfs_procedure'] = array( #'-v', 'Issues/s', 'DEF:avg={file}:value:AVERAGE', 'DEF:min={file}:value:MIN', @@ -956,7 +956,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%6.2lf', 'GPRINT:max:MAX:%6.2lf', 'GPRINT:avg:LAST:%6.2lf\l'); - $GraphDefs['nfs3_procedures'] = array( + $GraphDefs['nfs3_procedures'] = array( "DEF:null_avg={file}:null:AVERAGE", "DEF:getattr_avg={file}:getattr:AVERAGE", "DEF:setattr_avg={file}:setattr:AVERAGE", @@ -1051,7 +1051,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:read_max:MAX:%5.1lf', 'GPRINT:read_avg:AVERAGE:%5.1lf', 'GPRINT:read_avg:LAST:%5.1lf\l'); - $GraphDefs['opcode'] = array( + $GraphDefs['opcode'] = array( 'DEF:avg={file}:value:AVERAGE', 'DEF:min={file}:value:MIN', 'DEF:max={file}:value:MAX', @@ -1062,7 +1062,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%9.3lf Average,', 'GPRINT:max:MAX:%9.3lf', 'GPRINT:avg:LAST:%9.3lf\l'); - $GraphDefs['partition'] = array( + $GraphDefs['partition'] = array( "DEF:rbyte_avg={file}:rbytes:AVERAGE", "DEF:rbyte_min={file}:rbytes:MIN", "DEF:rbyte_max={file}:rbytes:MAX", @@ -1082,7 +1082,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:rbyte_avg:AVERAGE:%5.1lf%s ', 'GPRINT:rbyte_max:MAX:%5.1lf%s', 'GPRINT:rbyte_avg:LAST:%5.1lf%s\l'); - $GraphDefs['percent'] = array( + $GraphDefs['percent'] = array( #'-v', 'Percent', 'DEF:avg={file}:percent:AVERAGE', 'DEF:min={file}:percent:MIN', @@ -1094,7 +1094,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%5.1lf%% ', 'GPRINT:max:MAX:%5.1lf%%', 'GPRINT:avg:LAST:%5.1lf%%\l'); - $GraphDefs['ping'] = array( + $GraphDefs['ping'] = array( 'DEF:ping_avg={file}:ping:AVERAGE', 'DEF:ping_min={file}:ping:MIN', 'DEF:ping_max={file}:ping:MAX', @@ -1105,7 +1105,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:ping_avg:AVERAGE:%4.1lf ms ', 'GPRINT:ping_max:MAX:%4.1lf ms', 'GPRINT:ping_avg:LAST:%4.1lf ms Last'); - $GraphDefs['power'] = array( + $GraphDefs['power'] = array( #'-v', 'Watt', 'DEF:avg={file}:value:AVERAGE', 'DEF:min={file}:value:MIN', @@ -1117,7 +1117,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%5.1lf%sW ', 'GPRINT:max:MAX:%5.1lf%sW', 'GPRINT:avg:LAST:%5.1lf%sW\l'); - $GraphDefs['processes'] = array( + $GraphDefs['processes'] = array( "DEF:running_avg={file}:running:AVERAGE", "DEF:running_min={file}:running:MIN", "DEF:running_max={file}:running:MAX", @@ -1178,7 +1178,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:sleeping_avg:AVERAGE:%5.1lf Average,', 'GPRINT:sleeping_max:MAX:%5.1lf', 'GPRINT:sleeping_avg:LAST:%5.1lf\l'); - $GraphDefs['ps_count'] = array( + $GraphDefs['ps_count'] = array( #'-v', 'Processes', 'DEF:procs_avg={file}:processes:AVERAGE', 'DEF:procs_min={file}:processes:MIN', @@ -1198,7 +1198,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:procs_avg:AVERAGE:%5.1lf', 'GPRINT:procs_max:MAX:%5.1lf', 'GPRINT:procs_avg:LAST:%5.1lf\l'); - $GraphDefs['ps_cputime'] = array( + $GraphDefs['ps_cputime'] = array( #'-v', 'Jiffies', 'DEF:user_avg_raw={file}:user:AVERAGE', 'DEF:user_min_raw={file}:user:MIN', @@ -1225,7 +1225,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:syst_avg:AVERAGE:%5.1lf%s ', 'GPRINT:syst_max:MAX:%5.1lf%s', 'GPRINT:syst_avg:LAST:%5.1lf%s\l'); - $GraphDefs['ps_pagefaults'] = array( + $GraphDefs['ps_pagefaults'] = array( #'-v', 'Pagefaults/s', 'DEF:minor_avg={file}:minflt:AVERAGE', 'DEF:minor_min={file}:minflt:MIN', @@ -1246,7 +1246,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:major_avg:AVERAGE:%5.1lf%s ', 'GPRINT:major_max:MAX:%5.1lf%s', 'GPRINT:major_avg:LAST:%5.1lf%s\l'); - $GraphDefs['ps_rss'] = array( + $GraphDefs['ps_rss'] = array( #'-v', 'Bytes', 'DEF:avg={file}:value:AVERAGE', 'DEF:min={file}:value:MIN', @@ -1257,7 +1257,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%5.1lf%s ', 'GPRINT:max:MAX:%5.1lf%s', 'GPRINT:avg:LAST:%5.1lf%s\l'); - $GraphDefs['ps_state'] = array( + $GraphDefs['ps_state'] = array( #'-v', 'Processes', 'DEF:avg={file}:value:AVERAGE', 'DEF:min={file}:value:MIN', @@ -1269,7 +1269,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%6.2lf', 'GPRINT:max:MAX:%6.2lf', 'GPRINT:avg:LAST:%6.2lf\l'); - $GraphDefs['qtype'] = array( + $GraphDefs['qtype'] = array( 'DEF:avg={file}:value:AVERAGE', 'DEF:min={file}:value:MIN', 'DEF:max={file}:value:MAX', @@ -1280,7 +1280,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%9.3lf Average,', 'GPRINT:max:MAX:%9.3lf', 'GPRINT:avg:LAST:%9.3lf\l'); - $GraphDefs['rcode'] = array( + $GraphDefs['rcode'] = array( 'DEF:avg={file}:value:AVERAGE', 'DEF:min={file}:value:MIN', 'DEF:max={file}:value:MAX', @@ -1291,7 +1291,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%9.3lf Average,', 'GPRINT:max:MAX:%9.3lf', 'GPRINT:avg:LAST:%9.3lf\l'); - $GraphDefs['swap'] = array( + $GraphDefs['swap'] = array( #'-v', 'Bytes', '-b', '1024', 'DEF:avg={file}:value:AVERAGE', @@ -1305,7 +1305,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%6.2lf%sByte ', 'GPRINT:max:MAX:%6.2lf%sByte', 'GPRINT:avg:LAST:%6.2lf%sByte\l'); - $GraphDefs['old_swap'] = array( + $GraphDefs['old_swap'] = array( 'DEF:used_avg={file}:used:AVERAGE', 'DEF:used_min={file}:used:MIN', 'DEF:used_max={file}:used:MAX', @@ -1348,7 +1348,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:used_avg:AVERAGE:%5.1lf%s ', 'GPRINT:used_max:MAX:%5.1lf%s', 'GPRINT:used_avg:LAST:%5.1lf%s\l'); - $GraphDefs['tcp_connections'] = array( + $GraphDefs['tcp_connections'] = array( #'-v', 'Connections', 'DEF:avg={file}:value:AVERAGE', 'DEF:min={file}:value:MIN', @@ -1360,7 +1360,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%4.1lf', 'GPRINT:max:MAX:%4.1lf', 'GPRINT:avg:LAST:%4.1lf\l'); - $GraphDefs['temperature'] = array( + $GraphDefs['temperature'] = array( #'-v', 'Celsius', 'DEF:temp_avg={file}:value:AVERAGE', 'DEF:temp_min={file}:value:MIN', @@ -1373,7 +1373,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:temp_avg:AVERAGE:%4.1lf', 'GPRINT:temp_max:MAX:%4.1lf', 'GPRINT:temp_avg:LAST:%4.1lf\l'); - $GraphDefs['signal'] = array( + $GraphDefs['signal'] = array( 'DEF:signal_avg={file}:value:AVERAGE', 'DEF:signal_min={file}:value:MIN', 'DEF:signal_max={file}:value:MAX', @@ -1385,7 +1385,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:signal_avg:AVERAGE:%4.1lf', 'GPRINT:signal_max:MAX:%4.1lf', 'GPRINT:signal_avg:LAST:%4.1lf\l'); - $GraphDefs['timeleft'] = array( + $GraphDefs['timeleft'] = array( #'-v', 'Minutes', 'DEF:avg={file}:timeleft:AVERAGE', 'DEF:min={file}:timeleft:MIN', @@ -1397,7 +1397,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%5.1lf%s ', 'GPRINT:max:MAX:%5.1lf%s', 'GPRINT:avg:LAST:%5.1lf%s\l'); - $GraphDefs['time_offset'] = array( # NTPd + $GraphDefs['time_offset'] = array( # NTPd 'DEF:s_avg={file}:seconds:AVERAGE', 'DEF:s_min={file}:seconds:MIN', 'DEF:s_max={file}:seconds:MAX', @@ -1409,7 +1409,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:s_avg:AVERAGE:%5.2lf%s', 'GPRINT:s_max:MAX:%5.2lf%s', 'GPRINT:s_avg:LAST:%5.2lf%s'); - $GraphDefs['if_octets'] = array( + $GraphDefs['if_octets'] = array( #'-v', 'Bits/s', '--units=si', 'DEF:out_min_raw={file}:tx:MIN', @@ -1441,12 +1441,12 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:out_avg:LAST:%5.1lf%s Last', 'GPRINT:out_avg_sum:LAST:(ca. %5.1lf%sB Total)\l', "LINE1:inc_avg#$FullBlue:Incoming", -// 'GPRINT:inc_min:MIN:%5.1lf %s ', +// 'GPRINT:inc_min:MIN:%5.1lf %s ', 'GPRINT:inc_avg:AVERAGE:%5.1lf%s ', 'GPRINT:inc_max:MAX:%5.1lf%s', 'GPRINT:inc_avg:LAST:%5.1lf%s Last', 'GPRINT:inc_avg_sum:LAST:(ca. %5.1lf%sB Total)\l'); - $GraphDefs['cpufreq'] = array( + $GraphDefs['cpufreq'] = array( 'DEF:cpufreq_avg={file}:value:AVERAGE', 'DEF:cpufreq_min={file}:value:MIN', 'DEF:cpufreq_max={file}:value:MAX', @@ -1457,7 +1457,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:cpufreq_avg:AVERAGE:%5.1lf%s ', 'GPRINT:cpufreq_max:MAX:%5.1lf%s', 'GPRINT:cpufreq_avg:LAST:%5.1lf%s\l'); - $GraphDefs['multimeter'] = array( + $GraphDefs['multimeter'] = array( 'DEF:multimeter_avg={file}:value:AVERAGE', 'DEF:multimeter_min={file}:value:MIN', 'DEF:multimeter_max={file}:value:MAX', @@ -1468,7 +1468,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:multimeter_avg:AVERAGE:%4.1lf Average,', 'GPRINT:multimeter_max:MAX:%4.1lf', 'GPRINT:multimeter_avg:LAST:%4.1lf\l'); - $GraphDefs['users'] = array( + $GraphDefs['users'] = array( #'-v', 'Users', 'DEF:users_avg={file}:users:AVERAGE', 'DEF:users_min={file}:users:MIN', @@ -1481,7 +1481,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:users_avg:AVERAGE:%5.1lf', 'GPRINT:users_max:MAX:%5.1lf', 'GPRINT:users_avg:LAST:%5.1lf\l'); - $GraphDefs['voltage'] = array( + $GraphDefs['voltage'] = array( #'-v', 'Voltage', 'DEF:avg={file}:value:AVERAGE', 'DEF:min={file}:value:MIN', @@ -1493,7 +1493,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%5.1lf%sV ', 'GPRINT:max:MAX:%5.1lf%sV', 'GPRINT:avg:LAST:%5.1lf%sV\l'); - $GraphDefs['vmpage_action'] = array( + $GraphDefs['vmpage_action'] = array( #'-v', 'Actions', 'DEF:avg={file}:value:AVERAGE', 'DEF:min={file}:value:MIN', @@ -1505,8 +1505,8 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%5.1lf%sV ', 'GPRINT:max:MAX:%5.1lf%sV', 'GPRINT:avg:LAST:%5.1lf%sV\l'); - $GraphDefs['vmpage_faults'] = $GraphDefs['ps_pagefaults']; - $GraphDefs['vmpage_io'] = array( + $GraphDefs['vmpage_faults'] = $GraphDefs['ps_pagefaults']; + $GraphDefs['vmpage_io'] = array( #'-v', 'Bytes/s', 'DEF:out_min={file}:out:MIN', 'DEF:out_avg={file}:out:AVERAGE', @@ -1535,7 +1535,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:inc_max:MAX:%5.1lf%s', 'GPRINT:inc_avg:LAST:%5.1lf%s Last', 'GPRINT:inc_avg_sum:LAST:(ca. %5.1lf%sB Total)\l'); - $GraphDefs['vmpage_number'] = array( + $GraphDefs['vmpage_number'] = array( #'-v', 'Count', 'DEF:avg={file}:value:AVERAGE', 'DEF:min={file}:value:MIN', @@ -1546,7 +1546,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:avg:AVERAGE:%5.1lf%s ', 'GPRINT:max:MAX:%5.1lf%s', 'GPRINT:avg:LAST:%5.1lf%s\l'); - $GraphDefs['vs_threads'] = array( + $GraphDefs['vs_threads'] = array( "DEF:total_avg={file}:total:AVERAGE", "DEF:total_min={file}:total:MIN", "DEF:total_max={file}:total:MAX", @@ -1579,7 +1579,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:onhold_avg:AVERAGE:%5.1lf Avg.,', 'GPRINT:onhold_max:MAX:%5.1lf', 'GPRINT:onhold_avg:LAST:%5.1lf\l'); - $GraphDefs['vs_memory'] = array( + $GraphDefs['vs_memory'] = array( 'DEF:vm_avg={file}:vm:AVERAGE', 'DEF:vm_min={file}:vm:MIN', 'DEF:vm_max={file}:vm:MAX', @@ -1612,7 +1612,7 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:anon_avg:AVERAGE:%5.1lf%s Avg.,', 'GPRINT:anon_max:MAX:%5.1lf%s Avg.,', 'GPRINT:anon_avg:LAST:%5.1lf%s\l'); - $GraphDefs['vs_processes'] = array( + $GraphDefs['vs_processes'] = array( #'-v', 'Processes', 'DEF:proc_avg={file}:value:AVERAGE', 'DEF:proc_min={file}:value:MIN', @@ -1624,43 +1624,43 @@ function load_graph_definitions($logarithmic = false, $tinylegend = false) 'GPRINT:proc_avg:AVERAGE:%4.1lf Avg.,', 'GPRINT:proc_max:MAX:%4.1lf', 'GPRINT:proc_avg:LAST:%4.1lf\l'); - $GraphDefs['if_multicast'] = $GraphDefs['ipt_packets']; - $GraphDefs['if_tx_errors'] = $GraphDefs['if_rx_errors']; + $GraphDefs['if_multicast'] = $GraphDefs['ipt_packets']; + $GraphDefs['if_tx_errors'] = $GraphDefs['if_rx_errors']; - $MetaGraphDefs['files_count'] = 'meta_graph_files_count'; - $MetaGraphDefs['files_size'] = 'meta_graph_files_size'; - $MetaGraphDefs['cpu'] = 'meta_graph_cpu'; - $MetaGraphDefs['if_rx_errors'] = 'meta_graph_if_rx_errors'; - $MetaGraphDefs['if_tx_errors'] = 'meta_graph_if_rx_errors'; - $MetaGraphDefs['memory'] = 'meta_graph_memory'; - $MetaGraphDefs['vs_memory'] = 'meta_graph_vs_memory'; - $MetaGraphDefs['vs_threads'] = 'meta_graph_vs_threads'; - $MetaGraphDefs['nfs_procedure'] = 'meta_graph_nfs_procedure'; - $MetaGraphDefs['ps_state'] = 'meta_graph_ps_state'; - $MetaGraphDefs['swap'] = 'meta_graph_swap'; - $MetaGraphDefs['apache_scoreboard'] = 'meta_graph_apache_scoreboard'; - $MetaGraphDefs['mysql_commands'] = 'meta_graph_mysql_commands'; - $MetaGraphDefs['mysql_handler'] = 'meta_graph_mysql_commands'; - $MetaGraphDefs['tcp_connections'] = 'meta_graph_tcp_connections'; + $MetaGraphDefs['files_count'] = 'meta_graph_files_count'; + $MetaGraphDefs['files_size'] = 'meta_graph_files_size'; + $MetaGraphDefs['cpu'] = 'meta_graph_cpu'; + $MetaGraphDefs['if_rx_errors'] = 'meta_graph_if_rx_errors'; + $MetaGraphDefs['if_tx_errors'] = 'meta_graph_if_rx_errors'; + $MetaGraphDefs['memory'] = 'meta_graph_memory'; + $MetaGraphDefs['vs_memory'] = 'meta_graph_vs_memory'; + $MetaGraphDefs['vs_threads'] = 'meta_graph_vs_threads'; + $MetaGraphDefs['nfs_procedure'] = 'meta_graph_nfs_procedure'; + $MetaGraphDefs['ps_state'] = 'meta_graph_ps_state'; + $MetaGraphDefs['swap'] = 'meta_graph_swap'; + $MetaGraphDefs['apache_scoreboard'] = 'meta_graph_apache_scoreboard'; + $MetaGraphDefs['mysql_commands'] = 'meta_graph_mysql_commands'; + $MetaGraphDefs['mysql_handler'] = 'meta_graph_mysql_commands'; + $MetaGraphDefs['tcp_connections'] = 'meta_graph_tcp_connections'; - if (function_exists('load_graph_definitions_local')) { - load_graph_definitions_local($logarithmic, $tinylegend); - } - - if ($logarithmic) { - foreach ($GraphDefs as &$GraphDef) { - array_unshift($GraphDef, '-o'); + if (function_exists('load_graph_definitions_local')) { + load_graph_definitions_local($logarithmic, $tinylegend); } - } - if ($tinylegend) { - foreach ($GraphDefs as &$GraphDef) { - for ($i = count($GraphDef)-1; $i >=0; $i--) { - if (strncmp('GPRINT:', $GraphDef[$i], 7) == 0) { - unset($GraphDef[$i]); + + if ($logarithmic) { + foreach ($GraphDefs as &$GraphDef) { + array_unshift($GraphDef, '-o'); + } + } + if ($tinylegend) { + foreach ($GraphDefs as &$GraphDef) { + for ($i = count($GraphDef)-1; $i >=0; $i--) { + if (strncmp('GPRINT:', $GraphDef[$i], 7) == 0) { + unset($GraphDef[$i]); + } } } } - } } function meta_graph_files_count($host, $plugin, $plugin_instance, $type, $type_instances, $opts = array()) diff --git a/includes/html/collectd/functions.php b/includes/html/collectd/functions.php index 35e271e336..f54a01829e 100644 --- a/includes/html/collectd/functions.php +++ b/includes/html/collectd/functions.php @@ -345,8 +345,7 @@ function collectd_flush($identifier) } fclose($socket); - } //end if - else { + } else { error_log(sprintf('graph.php: Failed to open unix-socket to collectd: %d: %s', $u_errno, $u_errmsg)); } return true; diff --git a/includes/html/graphs/application/bind_server_results.inc.php b/includes/html/graphs/application/bind_server_results.inc.php index 86b24dca72..47af6e6f92 100644 --- a/includes/html/graphs/application/bind_server_results.inc.php +++ b/includes/html/graphs/application/bind_server_results.inc.php @@ -51,7 +51,7 @@ if (rrdtool_check_rrd_exists($rrd_filename)) { 'filename' => $rrd_filename, 'descr' => 'Caused Rec', 'ds' => 'qcr', - ); + ); } else { d_echo('RRD "'.$rrd_filename.'" not found'); } diff --git a/includes/html/graphs/application/nfs-server_io.inc.php b/includes/html/graphs/application/nfs-server_io.inc.php index 5ab9be1be0..2b77e8b244 100644 --- a/includes/html/graphs/application/nfs-server_io.inc.php +++ b/includes/html/graphs/application/nfs-server_io.inc.php @@ -51,7 +51,7 @@ require 'includes/html/graphs/generic_v3_multiline.inc.php'; /* This would create a graph with reads above and write belows; -I can't find out how to adapt the legend. If you wish to swap graphs, +I can't find out how to adapt the legend. If you wish to swap graphs, uncomment all the above untill $rrd_filename, 'descr' => 'Reallocated_Sector_Ct', 'ds' => 'id5', - ); + ); $rrd_list[]=array( 'filename' => $rrd_filename, 'descr' => 'Reported_Uncorrect', 'ds' => 'id187', - ); + ); $rrd_list[]=array( 'filename' => $rrd_filename, 'descr' => 'Command_Timeout', 'ds' => 'id188', - ); + ); $rrd_list[]=array( 'filename' => $rrd_filename, 'descr' => 'Current_Pending_Sector', 'ds' => 'id197', - ); + ); $rrd_list[]=array( 'filename' => $rrd_filename, 'descr' => 'Offline_Uncorrectable', 'ds' => 'id198', - ); + ); } diff --git a/includes/html/graphs/device/sla_jitter-latency.inc.php b/includes/html/graphs/device/sla_jitter-latency.inc.php index a54b35d51d..c6877e72c6 100644 --- a/includes/html/graphs/device/sla_jitter-latency.inc.php +++ b/includes/html/graphs/device/sla_jitter-latency.inc.php @@ -1,6 +1,6 @@ * diff --git a/includes/html/modal/alert_schedule.inc.php b/includes/html/modal/alert_schedule.inc.php index 1d7a05ef2b..34b8193eb9 100644 --- a/includes/html/modal/alert_schedule.inc.php +++ b/includes/html/modal/alert_schedule.inc.php @@ -13,7 +13,7 @@ */ if (\Auth::user()->hasGlobalAdmin()) { -?> + ?> -'; - echo csrf_field(); - echo ''; - - $tmp = call_user_func($class.'::configTemplate'); - - foreach ($tmp['config'] as $item) { - if ($item['type'] !== 'hidden') { - echo '
'; - echo ''; - if ($item['type'] == 'text' || $item['type'] == 'password') { - echo '
'; - echo ''; - } else { - echo '>'; - } - echo '
'; - } elseif ($item['type'] == 'checkbox') { - echo '
'; - echo ''; - echo '
'; - $switches[$item['name']] = $item['default']; - } elseif ($item['type'] == 'select') { - echo '
'; - echo ''; - echo '
'; - } elseif ($item['type'] === 'textarea') { - echo '
'; - echo ''; - echo '
'; - } elseif ($item['type'] === 'oauth') { - $class = isset($item['class']) ? $item['class'] : 'btn-success'; - $callback = urlencode(url()->current() . '/?oauthtransport=' . $transport); - $url = $item['url'] . $callback; - - echo ''; - if (isset($item['icon'])) { - echo ' '; - } - echo $item['descr']; - echo ''; - } - echo '
'; + if (!method_exists($class, 'configTemplate')) { + // Skip since support has not been added + continue; } + + echo '
'; + echo csrf_field(); + echo ''; + + $tmp = call_user_func($class.'::configTemplate'); + + foreach ($tmp['config'] as $item) { + if ($item['type'] !== 'hidden') { + echo '
'; + echo ''; + if ($item['type'] == 'text' || $item['type'] == 'password') { + echo '
'; + echo ''; + } else { + echo '>'; + } + echo '
'; + } elseif ($item['type'] == 'checkbox') { + echo '
'; + echo ''; + echo '
'; + $switches[$item['name']] = $item['default']; + } elseif ($item['type'] == 'select') { + echo '
'; + echo ''; + echo '
'; + } elseif ($item['type'] === 'textarea') { + echo '
'; + echo ''; + echo '
'; + } elseif ($item['type'] === 'oauth') { + $class = isset($item['class']) ? $item['class'] : 'btn-success'; + $callback = urlencode(url()->current() . '/?oauthtransport=' . $transport); + $url = $item['url'] . $callback; + + echo ''; + if (isset($item['icon'])) { + echo ' '; + } + echo $item['descr']; + echo ''; + } + echo '
'; + } + } + echo '
'; + echo '
'; + echo ''; + echo '
'; + echo '
'; + echo '
'; } - echo '
'; - echo '
'; - echo ''; - echo '
'; - echo '
'; - echo ''; -} -?> + ?>
diff --git a/includes/html/modal/new_bill.inc.php b/includes/html/modal/new_bill.inc.php index e0adc55578..a51dc009b5 100644 --- a/includes/html/modal/new_bill.inc.php +++ b/includes/html/modal/new_bill.inc.php @@ -24,7 +24,7 @@ if (Auth::user()->hasGlobalAdmin()) { $bill_data['bill_notes'] = $port['port_descr_speed']; $port_device_id = $port['device_id']; } -?> + ?> @@ -72,17 +72,17 @@ if (Auth::user()->hasGlobalAdmin()) { - ' selected'); -$cdr = array('select_mbps' => ' selected'); -include 'includes/html/pages/bill/addoreditbill.inc.php'; -?> + ' selected'); + $cdr = array('select_mbps' => ' selected'); + include 'includes/html/pages/bill/addoreditbill.inc.php'; + ?>
@@ -95,5 +95,5 @@ include 'includes/html/pages/bill/addoreditbill.inc.php';
-hasGlobalAdmin()) { } } } -?> + ?> - - - - - + ?>

Device MIB associations

@@ -87,7 +87,7 @@ if (is_mib_poller_enabled($device)) { } }); - 0) { + ?> Error: - diff --git a/includes/html/pages/device/overview/services.inc.php b/includes/html/pages/device/overview/services.inc.php index 72955afece..4bb6294ffc 100644 --- a/includes/html/pages/device/overview/services.inc.php +++ b/includes/html/pages/device/overview/services.inc.php @@ -38,5 +38,5 @@ if (ObjectCache::serviceCounts(['total'], $device['device_id'])['total'] > 0) {
-Submit '; -?> + ?> diff --git a/includes/html/pages/device/ports.inc.php b/includes/html/pages/device/ports.inc.php index 7a9a5d20ad..c4bf60f891 100644 --- a/includes/html/pages/device/ports.inc.php +++ b/includes/html/pages/device/ports.inc.php @@ -123,7 +123,7 @@ if ($vars['view'] == 'minigraphs') { if ($vars['view'] == 'details') { $port_details = 1; } -?> + ?>
@@ -134,7 +134,7 @@ if ($vars['view'] == 'minigraphs') { - $port) { - $port_cache[$port['port_id']] = $port; - $port_index_cache[$port['device_id']][$port['ifIndex']] = $port; - $ports[$key]["ifOctets_rate"] = $port["ifInOctets_rate"] + $port["ifOutOctets_rate"]; -} + foreach ($ports as $key => $port) { + $port_cache[$port['port_id']] = $port; + $port_index_cache[$port['device_id']][$port['ifIndex']] = $port; + $ports[$key]["ifOctets_rate"] = $port["ifInOctets_rate"] + $port["ifOutOctets_rate"]; + } -switch ($vars["sort"]) { - case 'traffic': - $ports = array_sort_by_column($ports, 'ifOctets_rate', SORT_DESC); - break; - default: - $ports = array_sort_by_column($ports, 'ifIndex', SORT_ASC); - break; -} + switch ($vars["sort"]) { + case 'traffic': + $ports = array_sort_by_column($ports, 'ifOctets_rate', SORT_DESC); + break; + default: + $ports = array_sort_by_column($ports, 'ifIndex', SORT_ASC); + break; + } -foreach ($ports as $port) { - include 'includes/html/print-interface.inc.php'; - $i++; -} + foreach ($ports as $port) { + include 'includes/html/print-interface.inc.php'; + $i++; + } echo '
">PortMac Address
'; }//end if diff --git a/includes/html/pages/device/routing/cisco-otv.inc.php b/includes/html/pages/device/routing/cisco-otv.inc.php index 977d622df8..1b170e0efe 100644 --- a/includes/html/pages/device/routing/cisco-otv.inc.php +++ b/includes/html/pages/device/routing/cisco-otv.inc.php @@ -24,27 +24,27 @@ foreach ($components as $oid => $overlay) { $overlay_status = "".$overlay['error']." - Alert"; $gli = "list-group-item-danger"; } -?> + ?> - - @@ -85,6 +85,6 @@ $graph_array['to'] = \LibreNMS\Config::get('time.now'); $graph_array['type'] = 'device_cisco-otv-mac'; require 'includes/html/print-graphrow.inc.php'; - ?> +?> diff --git a/includes/html/pages/device/sla/jitter.inc.php b/includes/html/pages/device/sla/jitter.inc.php index c42278f22d..7b6e117be1 100644 --- a/includes/html/pages/device/sla/jitter.inc.php +++ b/includes/html/pages/device/sla/jitter.inc.php @@ -11,7 +11,7 @@ $graph_array['type'] = 'device_sla_jitter-latency'; $graph_array['id'] = $vars['id']; require 'includes/html/print-graphrow.inc.php'; -?> + ?>
diff --git a/includes/html/pages/device/sla/rtt.inc.php b/includes/html/pages/device/sla/rtt.inc.php index b8a727f25a..4e7531cbe8 100644 --- a/includes/html/pages/device/sla/rtt.inc.php +++ b/includes/html/pages/device/sla/rtt.inc.php @@ -11,5 +11,5 @@ $graph_array['type'] = 'device_sla'; $graph_array['id'] = $vars['id']; require 'includes/html/print-graphrow.inc.php'; -?> + ?>
diff --git a/includes/html/pages/devices.inc.php b/includes/html/pages/devices.inc.php index 3d45f93217..112baf9b47 100644 --- a/includes/html/pages/devices.inc.php +++ b/includes/html/pages/devices.inc.php @@ -371,7 +371,7 @@ if ($format == "graph") { + ?> $(".devices-headers-table-menu").append( "
" + "
" + @@ -392,7 +392,7 @@ if ($format == "graph") { "
" + "
" ); - diff --git a/includes/html/pages/eventlog.inc.php b/includes/html/pages/eventlog.inc.php index c0e9c84328..b5480e427f 100644 --- a/includes/html/pages/eventlog.inc.php +++ b/includes/html/pages/eventlog.inc.php @@ -42,19 +42,19 @@ $pagetitle[] = 'Eventlog'; '' + + ?> '
' + '' + '' + '
    ' + - ' + "; } diff --git a/includes/html/pages/inventory.inc.php b/includes/html/pages/inventory.inc.php index b1622c164a..1c1118b187 100644 --- a/includes/html/pages/inventory.inc.php +++ b/includes/html/pages/inventory.inc.php @@ -76,7 +76,7 @@ foreach (dbFetchRows('SELECT * FROM `devices` ORDER BY `hostname`') as $data) { if ($_POST['device_string']) { echo $_POST['device_string']; }; -?> + ?> "\" placeholder=\"Description\" class=\"form-control input-sm\"/>"+ ""+ ""+ diff --git a/includes/html/pages/mib_assoc.inc.php b/includes/html/pages/mib_assoc.inc.php index d29ec46f33..6221fed23f 100644 --- a/includes/html/pages/mib_assoc.inc.php +++ b/includes/html/pages/mib_assoc.inc.php @@ -14,7 +14,7 @@ */ if (\LibreNMS\Config::get("poller_modules.mib")) { -?> + ?>

MIB associations for all devices

@@ -48,7 +48,7 @@ if (\LibreNMS\Config::get("poller_modules.mib")) { } }); - + ?>

All MIB definitions

@@ -54,7 +54,7 @@ if (\LibreNMS\Config::get("poller_modules.mib")) { } }); - 0 && !isset($vars['archive'])) {
-
'; +
'; - $class = $notif['severity'] == 2 ? 'text-danger' : 'text-warning'; - echo "

"; - echo " ${notif['title']}"; - echo ""; + $class = $notif['severity'] == 2 ? 'text-danger' : 'text-warning'; + echo "

"; + echo " ${notif['title']}"; + echo ""; - if ($notif['user_id'] != Auth::id()) { - $sticky_user = User::find($notif['user_id']); - echo "Sticky by {$sticky_user->username}"; - } else { - echo ''; - } + if ($notif['user_id'] != Auth::id()) { + $sticky_user = User::find($notif['user_id']); + echo "Sticky by {$sticky_user->username}"; + } else { + echo ''; + } - echo '

'; -?> + echo '

'; + ?>
@@ -108,30 +108,30 @@ foreach ($notifications['sticky'] as $notif) {
- - + +
- -username; - } - echo '
'; - d_echo($notif); - $class = 'text-success'; - if ($notif['severity'] == 1) { - $class='text-warning'; - } elseif ($notif['severity'] == 2) { - $class = 'text-danger'; - } - echo "

${notif['title']}"; + + username; + } + echo '
'; + d_echo($notif); + $class = 'text-success'; + if ($notif['severity'] == 1) { + $class='text-warning'; + } elseif ($notif['severity'] == 2) { + $class = 'text-danger'; + } + echo "

${notif['title']}"; - if (Auth::user()->hasGlobalAdmin()) { - echo ''; - } -?> + if (Auth::user()->hasGlobalAdmin()) { + echo ''; + } + ?> @@ -147,7 +147,7 @@ foreach ($notifications['unread'] as $notif) {

- +

Show Archive

@@ -161,20 +161,20 @@ foreach ($notifications['unread'] as $notif) {

Archive

-
${notif['title']}"; +
${notif['title']}"; - if (Auth::user()->isAdmin()) { - echo ''; - } -?> + if (Auth::user()->isAdmin()) { + echo ''; + } + ?>

@@ -187,7 +187,7 @@ foreach ($notifications['read'] as $notif) {
- + @@ -359,16 +359,16 @@ var height = $(window).height() - 100; $('#visualization').height(height + 'px'); // create an array with nodes var nodes = - + ; // create an array with edges var edges = - + ; // create a network @@ -394,7 +394,7 @@ function highlightNode(e) { $('#highlight_node option[value=""]').prop('selected', true); - * This program is free software: you can redistribute it and/or modify it diff --git a/includes/polling/mempools/ftos.inc.php b/includes/polling/mempools/ftos.inc.php index e1397c1893..55e6651823 100644 --- a/includes/polling/mempools/ftos.inc.php +++ b/includes/polling/mempools/ftos.inc.php @@ -1,6 +1,6 @@ + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/allied.inc.php b/includes/polling/os/allied.inc.php index 0c6dc8e846..d3c15dd616 100644 --- a/includes/polling/os/allied.inc.php +++ b/includes/polling/os/allied.inc.php @@ -32,7 +32,7 @@ if (!$hardware && !$version) { $serial = $data['.1.3.6.1.4.1.207.8.17.1.3.1.8.1']; } -//Gets OS outputting "Alliedware Plus" instead of just Alliedware. +//Gets OS outputting "Alliedware Plus" instead of just Alliedware. if ($hardware && $version) { $version = 'Plus ' .$version; } diff --git a/includes/polling/os/cimc.inc.php b/includes/polling/os/cimc.inc.php index 1dbaa54810..7379e37e5d 100644 --- a/includes/polling/os/cimc.inc.php +++ b/includes/polling/os/cimc.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/cips.inc.php b/includes/polling/os/cips.inc.php index 4f17ba226a..178cd339b2 100644 --- a/includes/polling/os/cips.inc.php +++ b/includes/polling/os/cips.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/deliberant.inc.php b/includes/polling/os/deliberant.inc.php index f67ba740da..acdf8b001e 100644 --- a/includes/polling/os/deliberant.inc.php +++ b/includes/polling/os/deliberant.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/develop.inc.php b/includes/polling/os/develop.inc.php index b8f258f4bf..6b044edd57 100644 --- a/includes/polling/os/develop.inc.php +++ b/includes/polling/os/develop.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/eatonpdu.inc.php b/includes/polling/os/eatonpdu.inc.php index 0552227cd4..4dff03907c 100644 --- a/includes/polling/os/eatonpdu.inc.php +++ b/includes/polling/os/eatonpdu.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/flareos.inc.php b/includes/polling/os/flareos.inc.php index a8d86d9c1c..a1692286c6 100644 --- a/includes/polling/os/flareos.inc.php +++ b/includes/polling/os/flareos.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/foundryos.inc.php b/includes/polling/os/foundryos.inc.php index 2f90b7bc32..443189858f 100644 --- a/includes/polling/os/foundryos.inc.php +++ b/includes/polling/os/foundryos.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/fs-gbn.inc.php b/includes/polling/os/fs-gbn.inc.php index 3230afcd4f..cc468c6339 100644 --- a/includes/polling/os/fs-gbn.inc.php +++ b/includes/polling/os/fs-gbn.inc.php @@ -4,7 +4,7 @@ if (!empty($matches[2])) { $version .= " (" . trim($matches[2]) . ")"; } -// List of OIDs for HW recognition, add any potential HW OID here. +// List of OIDs for HW recognition, add any potential HW OID here. $hwOidList = [ '.1.3.6.1.4.1.13464.1.2.1.1.2.15.0', //GBNPlatformOAM-MIB::productName.0 ]; diff --git a/includes/polling/os/fs-switch.inc.php b/includes/polling/os/fs-switch.inc.php index b6ff4f22a5..a54cfbf53c 100644 --- a/includes/polling/os/fs-switch.inc.php +++ b/includes/polling/os/fs-switch.inc.php @@ -4,7 +4,7 @@ if (!empty($matches[2])) { $version .= " (" . trim($matches[2]) . ")"; } -// List of OIDs for HW recognition, add any potential HW OID here. +// List of OIDs for HW recognition, add any potential HW OID here. $hwOidList = [ '.1.3.6.1.4.1.27975.37.1.5.1.4.1.1', 'FS-MIB::swProdName.0', diff --git a/includes/polling/os/fujitsupyos.inc.php b/includes/polling/os/fujitsupyos.inc.php index 576f57e324..c90f64974b 100644 --- a/includes/polling/os/fujitsupyos.inc.php +++ b/includes/polling/os/fujitsupyos.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/fxos.inc.php b/includes/polling/os/fxos.inc.php index c470f58e76..4fe6152b8b 100644 --- a/includes/polling/os/fxos.inc.php +++ b/includes/polling/os/fxos.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/huaweiups.inc.php b/includes/polling/os/huaweiups.inc.php index 2607b73fb5..6ac200047f 100644 --- a/includes/polling/os/huaweiups.inc.php +++ b/includes/polling/os/huaweiups.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/hwg-poseidon.inc.php b/includes/polling/os/hwg-poseidon.inc.php index 994a83194e..4c4f16c592 100644 --- a/includes/polling/os/hwg-poseidon.inc.php +++ b/includes/polling/os/hwg-poseidon.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/ibmnos.inc.php b/includes/polling/os/ibmnos.inc.php index ee22f13932..d2ce8762e0 100644 --- a/includes/polling/os/ibmnos.inc.php +++ b/includes/polling/os/ibmnos.inc.php @@ -43,7 +43,6 @@ if (strpos($sysdescr_value, 'IBM Networking Operating System') !== false) { $hardware = str_replace('IBM Flex System Fabric', '', $sysdescr_value); $version = trim(snmp_get($device, '.1.3.6.1.2.1.47.1.1.1.1.10.1', '-Ovq'), '" '); $serial = trim(snmp_get($device, '.1.3.6.1.2.1.47.1.1.1.1.11.1', '-Ovq'), '" '); -} //end if -elseif (strpos($sysdescr_value, 'IBM Networking OS 1/10Gb Uplink Ethernet Switch Module') !== false) { +} elseif (strpos($sysdescr_value, 'IBM Networking OS 1/10Gb Uplink Ethernet Switch Module') !== false) { $hardware = "IBM BladeCenter 1/10Gb Uplink Ethernet Switch Module"; }//end if diff --git a/includes/polling/os/iosxe.inc.php b/includes/polling/os/iosxe.inc.php index 6528efac1d..3b390ca769 100644 --- a/includes/polling/os/iosxe.inc.php +++ b/includes/polling/os/iosxe.inc.php @@ -10,7 +10,7 @@ */ /////////////////////////////////////////////////// -// Include the standard IOS polling file. +// Include the standard IOS polling file. // Most of the IOSXE os polling code is identical /////////////////////////////////////////////////// diff --git a/includes/polling/os/kemp.inc.php b/includes/polling/os/kemp.inc.php index d90362c42c..3e7b788391 100644 --- a/includes/polling/os/kemp.inc.php +++ b/includes/polling/os/kemp.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2017 Søren Friis Rosiak + * Copyright (c) 2017 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/mimosa.inc.php b/includes/polling/os/mimosa.inc.php index 56f3ea7461..a2b047cb5c 100644 --- a/includes/polling/os/mimosa.inc.php +++ b/includes/polling/os/mimosa.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/mypoweros.inc.php b/includes/polling/os/mypoweros.inc.php index 97fd1cf8d5..61a2c0c84a 100644 --- a/includes/polling/os/mypoweros.inc.php +++ b/includes/polling/os/mypoweros.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/nimbleos.inc.php b/includes/polling/os/nimbleos.inc.php index 5b2ff13b0b..a9b53b4b9a 100644 --- a/includes/polling/os/nimbleos.inc.php +++ b/includes/polling/os/nimbleos.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/oracle-ilom.inc.php b/includes/polling/os/oracle-ilom.inc.php index 76126b3b21..26b20887bb 100644 --- a/includes/polling/os/oracle-ilom.inc.php +++ b/includes/polling/os/oracle-ilom.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/planetos.inc.php b/includes/polling/os/planetos.inc.php index a9a2d0fee3..e0a451f8ca 100644 --- a/includes/polling/os/planetos.inc.php +++ b/includes/polling/os/planetos.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/ptp670.inc.php b/includes/polling/os/ptp670.inc.php index 3d9fd7ee92..4702746d80 100644 --- a/includes/polling/os/ptp670.inc.php +++ b/includes/polling/os/ptp670.inc.php @@ -1,6 +1,6 @@ * This program is free software: you can redistribute it and/or modify it diff --git a/includes/polling/os/rutos-2xx.inc.php b/includes/polling/os/rutos-2xx.inc.php index 8122a8eb36..e48a02a00e 100644 --- a/includes/polling/os/rutos-2xx.inc.php +++ b/includes/polling/os/rutos-2xx.inc.php @@ -26,9 +26,9 @@ if ($usage_sent >= 0 && $usage_received >= 0) { $fields = array( 'usage_sent' => $usage_sent, 'usage_received' => $usage_received, - ); + ); - $tags = compact('rrd_def'); - data_update($device, 'rutos_2xx_mobileDataUsage', $tags, $fields); - $graphs['rutos_2xx_mobileDataUsage'] = true; + $tags = compact('rrd_def'); + data_update($device, 'rutos_2xx_mobileDataUsage', $tags, $fields); + $graphs['rutos_2xx_mobileDataUsage'] = true; } diff --git a/includes/polling/os/ubiquoss-pon.inc.php b/includes/polling/os/ubiquoss-pon.inc.php index c34c48ab5e..6247812689 100644 --- a/includes/polling/os/ubiquoss-pon.inc.php +++ b/includes/polling/os/ubiquoss-pon.inc.php @@ -3,7 +3,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/unix.inc.php b/includes/polling/os/unix.inc.php index f56aa32a75..f406295c14 100644 --- a/includes/polling/os/unix.inc.php +++ b/includes/polling/os/unix.inc.php @@ -12,8 +12,8 @@ if (in_array($device['os'], array("linux", "endian", "proxmox", "recoveryos"))) $hardware = "Generic SPARC 64-bit"; } elseif (strstr($device['sysDescr'], "mips")) { $hardware = "Generic MIPS"; - } // Except iDrac6 from being detected as armv5 - elseif (strstr($device['sysDescr'], "armv5") && $device['sysObjectID'] != '.1.3.6.1.4.1.674.10892.2') { + } elseif (strstr($device['sysDescr'], "armv5") && $device['sysObjectID'] != '.1.3.6.1.4.1.674.10892.2') { + // Except iDrac6 from being detected as armv5 $hardware = "Generic ARMv5"; } elseif (strstr($device['sysDescr'], "armv6")) { $hardware = "Generic ARMv6"; diff --git a/includes/polling/os/waas.inc.php b/includes/polling/os/waas.inc.php index 2866bdecfc..12cf04a4a2 100644 --- a/includes/polling/os/waas.inc.php +++ b/includes/polling/os/waas.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/os/zynos.inc.php b/includes/polling/os/zynos.inc.php index 798897af58..64a712aff1 100644 --- a/includes/polling/os/zynos.inc.php +++ b/includes/polling/os/zynos.inc.php @@ -2,7 +2,7 @@ /* * LibreNMS * - * Copyright (c) 2016 Søren Friis Rosiak + * Copyright (c) 2016 Søren Friis Rosiak * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or (at your diff --git a/includes/polling/ports.inc.php b/includes/polling/ports.inc.php index 60e4f8c1c4..86c9af361a 100644 --- a/includes/polling/ports.inc.php +++ b/includes/polling/ports.inc.php @@ -470,8 +470,8 @@ foreach ($port_stats as $ifIndex => $port) { dbInsert(array('port_id' => $port_id), 'ports_statistics'); $ports[$port_id] = dbFetchRow('SELECT * FROM `ports` WHERE `port_id` = ?', array($port_id)); echo 'Adding: '.$ifName.'('.$ifIndex.')('.$port_id.')'; - } // Port re-discovered after previous deletion? - elseif ($ports[$port_id]['deleted'] == 1) { + } elseif ($ports[$port_id]['deleted'] == 1) { + // Port re-discovered after previous deletion? dbUpdate(array('deleted' => '0'), 'ports', '`port_id` = ?', array($port_id)); $ports[$port_id]['deleted'] = '0'; } @@ -492,8 +492,8 @@ foreach ($port_stats as $ifIndex => $port) { /* Build a list of all ports, identified by their port_id, found within this poller run. */ $ports_found[] = $port_id; - } // Port vanished (mark as deleted) (except when skipped by selective port polling) - elseif (empty($ports[$port_id]['skipped'])) { + } elseif (empty($ports[$port_id]['skipped'])) { + // Port vanished (mark as deleted) (except when skipped by selective port polling) if ($ports[$port_id]['deleted'] != '1') { dbUpdate(array('deleted' => '1'), 'ports', '`port_id` = ?', array($port_id)); $ports[$port_id]['deleted'] = '1'; diff --git a/includes/polling/ports/os/cxr-ts.inc.php b/includes/polling/ports/os/cxr-ts.inc.php index 438660a7cd..8e07ae9bba 100644 --- a/includes/polling/ports/os/cxr-ts.inc.php +++ b/includes/polling/ports/os/cxr-ts.inc.php @@ -29,7 +29,7 @@ $cxr_stats = snmpwalk_cache_oid($device, 'portStatsTable', $cxr_stats, 'CXR-TS-M d_echo($cxr_stats); //We'll create dummy ifIndexes to add the Serial Ports to the LibreNMS port view. -//These devices are showing only a few interfaces, 1000 seems a sufficient offset. +//These devices are showing only a few interfaces, 1000 seems a sufficient offset. $offset = 1000; diff --git a/includes/polling/sensors/state/eds.inc.php b/includes/polling/sensors/state/eds.inc.php index 655285e9ee..16bd562db5 100644 --- a/includes/polling/sensors/state/eds.inc.php +++ b/includes/polling/sensors/state/eds.inc.php @@ -1,6 +1,6 @@ ([^(:]+\([^)]+\)|[^\[:]+\[[^\]]+\])) ?: ?(?P.*)$#', $entry['msg'], $matches)) { $entry['msg'] = $matches['msg']; $entry['program'] = $matches['program']; - } // SYSLOG CONNECTION BROKEN; FD='6', SERVER='AF_INET(123.213.132.231:514)', time_reopen='60' - // pam_krb5: authentication failure; logname=root uid=0 euid=0 tty=ssh ruser= rhost=123.213.132.231 - // Disabled because broke this: - // diskio.c: don't know how to handle 10 request - // elseif($pos = strpos($entry['msg'], ';') or $pos = strpos($entry['msg'], ':')) { - // $entry['program'] = substr($entry['msg'], 0, $pos); - // $entry['msg'] = substr($entry['msg'], $pos+1); - // } - // fallback, better than nothing... - elseif (empty($entry['program']) and !empty($entry['facility'])) { + } elseif (empty($entry['program']) and !empty($entry['facility'])) { + // SYSLOG CONNECTION BROKEN; FD='6', SERVER='AF_INET(123.213.132.231:514)', time_reopen='60' + // pam_krb5: authentication failure; logname=root uid=0 euid=0 tty=ssh ruser= rhost=123.213.132.231 + // Disabled because broke this: + // diskio.c: don't know how to handle 10 request + // elseif($pos = strpos($entry['msg'], ';') or $pos = strpos($entry['msg'], ':')) { + // $entry['program'] = substr($entry['msg'], 0, $pos); + // $entry['msg'] = substr($entry['msg'], $pos+1); + // } + // fallback, better than nothing... $entry['program'] = $entry['facility']; } diff --git a/misc/phpcs_librenms.xml b/misc/phpcs_librenms.xml index 531000a4d9..8ebfea5862 100644 --- a/misc/phpcs_librenms.xml +++ b/misc/phpcs_librenms.xml @@ -4,7 +4,6 @@ /vendor/* /storage/* /bootstrap/cache/* - /lib/* /html/plugins/* /config.php /_ide_helper.php diff --git a/scripts/manage_bills.php b/scripts/manage_bills.php index 1f31fee4e2..a6faf222b1 100755 --- a/scripts/manage_bills.php +++ b/scripts/manage_bills.php @@ -27,7 +27,7 @@ function list_bills($bill_name) return $bill[0]['bill_id']; } -// Create a new bill. +// Create a new bill. function create_bill($bill_name, $bill_type, $bill_cdr, $bill_day) { /** create_bill