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-pr'])) { |
||
25 | $storage_cache['intelliflash-pr'] = snmpwalk_cache_oid($device, 'projectEntry', 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-pr'][$storage['storage_index']]; |
||
30 | $storage['units'] = 1; |
||
31 | $pdsh = ($entry['projectDataSizeHigh'] << 32); |
||
32 | $pdsl = ($entry['projectDataSizeLow']); |
||
33 | $pdst = (($pdsh + $pdsl) * $storage['units']); |
||
34 | $pfsh = ($entry['projectFreeSizeHigh'] << 32); |
||
35 | $pfsl = ($entry['projectFreeSizeLow']); |
||
36 | $pfst = (($pfsh + $pfsl) * $storage['units']); |
||
37 | $storage['used'] = ($pdst); |
||
38 | $storage['free'] = ($pfst); |
||
39 | $storage['size'] = ($pdst + $pfst); |
||
40 |
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.