Issues (2963)

includes/discovery/storage/datadomain.inc.php (1 issue)

php_analyzer.type_inference.infeasible_condition.generic

Unknown
1
<?php
2
/*
3
 * This program is free software: you can redistribute it and/or modify it
4
 * under the terms of the GNU General Public License as published by the
5
 * Free Software Foundation, either version 3 of the License, or (at your
6
 * option) any later version.  Please see LICENSE.txt at the top level of
7
 * the source code distribution for details.
8
9
 * @package    LibreNMS
10
 * @link       https://www.librenms.org
11
 * @copyright  2019 ACL
12
 * @author     Abel Laura <[email protected]>
13
*/
14
15
$ddos_storage = snmpwalk_cache_oid($device, 'fileSystemSpaceTable', null, 'DATA-DOMAIN-MIB', 'datadomain');
16
if (is_array($ddos_storage)) {
0 ignored issues
show
The condition is_array($ddos_storage) is always false.
Loading history...
17
    foreach ($ddos_storage as $index => $storage) {
18
        $fstype = $storage['fileSystemResourceTier'];
19
        $descr = $storage['fileSystemResourceName'];
20
        $units = 1073741824;
21
        $total = $storage['fileSystemSpaceSize'] * $units;
22
        $used = $storage['fileSystemSpaceUsed'] * $units;
23
        if ($descr == '/data: post-comp') {
24
            discover_storage($valid_storage, $device, $index, $fstype, 'datadomain', $descr, $total, $units, $used);
25
        }
26
    }
27
}
28
unset($fstype, $descr, $total, $used, $units, $ddos_storage);
29