Issues (2963)

includes/html/pages/apps/proxmox/vm.inc.php (1 issue)

1
<?php
2
3
$vm = proxmox_vm_info(var_get('vmid'), var_get('instance'));
0 ignored issues
show
var_get('vmid') of type boolean|string is incompatible with the type integer expected by parameter $vmid of proxmox_vm_info(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

3
$vm = proxmox_vm_info(/** @scrutinizer ignore-type */ var_get('vmid'), var_get('instance'));
Loading history...
4
5
$graphs = [
6
    'proxmox_traffic'       => 'Traffic',
7
];
8
9
foreach ($vm['ports'] as $port) {
10
    foreach ($graphs as $key => $text) {
11
        $graph_type = 'proxmox_traffic';
12
13
        $graph_array['height'] = '100';
14
        $graph_array['width'] = '215';
15
        $graph_array['to'] = \LibreNMS\Config::get('time.now');
16
        $graph_array['id'] = $vm['app_id'];
17
        $graph_array['device_id'] = $vm['device_id'];
18
        $graph_array['type'] = 'application_' . $key;
19
        $graph_array['port'] = $port['port'];
20
        $graph_array['vmid'] = $vm['vmid'];
21
        $graph_array['cluster'] = $vm['cluster'];
22
        $graph_array['hostname'] = $vm['description'];
23
24
        echo '<h3>' . $text . ' ' . $port['port'] . '@' . $vm['description'] . '</h3>';
25
26
        echo "<tr bgcolor='$row_colour'><td colspan=5>";
27
28
        include 'includes/html/print-graphrow.inc.php';
29
30
        echo '</td></tr>';
31
    }
32
}
33