1 | <?php |
||
2 | /** |
||
3 | * tegile.inc.php |
||
4 | * |
||
5 | * LibreNMS storage polling module for Tegile Storage |
||
6 | * |
||
7 | * This program is free software: you can redistribute it and/or modify |
||
8 | * it under the terms of the GNU General Public License as published by |
||
9 | * the Free Software Foundation, either version 3 of the License, or |
||
10 | * (at your option) any later version. |
||
11 | * |
||
12 | * This program is distributed in the hope that it will be useful, |
||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the |
||
15 | * GNU General Public License for more details. |
||
16 | * |
||
17 | * You should have received a copy of the GNU General Public License |
||
18 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
||
19 | * |
||
20 | * @link https://www.librenms.org |
||
21 | * @copyright 2018 Ryan Finney |
||
22 | * @author https://github.com/theherodied/ |
||
23 | */ |
||
24 | if (! is_array($storage_cache['intelliflash-pl'])) { |
||
25 | $storage_cache['intelliflash-pl'] = snmpwalk_cache_oid($device, 'poolEntry', null, 'TEGILE-MIB'); |
||
0 ignored issues
–
show
|
|||
26 | d_echo($storage_cache); |
||
27 | } |
||
28 | //Tegile uses a high 32bit counter and a low 32bit counter to make a 64bit counter. Storage units are in bytes. |
||
29 | $entry = $storage_cache['intelliflash-pl'][$storage['storage_index']]; |
||
30 | $storage['units'] = 1; |
||
31 | $storage['size'] = (($entry['poolSizeHigh'] << 32) + $entry['poolSizeLow']) * $storage['units']; |
||
32 | $storage['used'] = (($entry['poolUsedSizeHigh'] << 32) + $entry['poolUsedSizeLow']) * $storage['units']; |
||
33 | $storage['free'] = ($storage['size'] - $storage['used']); |
||
34 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.