Example #1
0
 if ($port['ifAdminStatus'] == "down") {
     $status = "<span class='grey'>Disabled</span>";
 } else {
     if ($port['ifAdminStatus'] == "up") {
         if ($port['ifOperStatus'] == "down" || $port['ifOperStatus'] == "lowerLayerDown") {
             $status = "<span class='red'>Enabled / Disconnected</span>";
         } else {
             $status = "<span class='green'>Enabled / Connected</span>";
         }
     }
 }
 $i = 1;
 $show_all = 1;
 echo generate_box_open();
 echo '<table class="table table-hover table-striped table-condensed">';
 print_port_row($port, array_merge($vars, array('view' => 'details')));
 echo '</table>';
 echo generate_box_close();
 // Start Navbar
 $link_array = array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'port', 'port' => $port['port_id']);
 $navbar['options']['graphs']['text'] = 'Graphs';
 $navbar['options']['alerts']['text'] = 'Alerts';
 $navbar['options']['alertlog']['text'] = 'Alert Log';
 if (dbFetchCell("SELECT COUNT(*) FROM `sensors` WHERE `measured_class` = 'port' AND `measured_entity` = ? and `device_id` = ?", array($port['port_id'], $device['device_id']))) {
     $navbar['options']['sensors']['text'] = 'Sensors';
 }
 $navbar['options']['realtime']['text'] = 'Real time';
 // FIXME CONDITIONAL
 if (dbFetchCell('SELECT COUNT(*) FROM `ip_mac` WHERE `port_id` = ?', array($port['port_id']))) {
     $navbar['options']['arp']['text'] = 'ARP/NDP Table';
 }
Example #2
0
        }
        //$where = ' IN ('.implode(',', array_keys($port_cache)).')';
        $where = generate_query_values(array_keys($port_cache), 'port_id');
        foreach ($ext_tables as $table) {
            // Here stored port_id!
            $cache['ports_option'][$table] = dbFetchColumn("SELECT DISTINCT `port_id` FROM `{$table}` WHERE 1 " . $where);
        }
        $cache['ports_vlan'] = array();
        // Cache port vlans
        foreach (dbFetchRows('SELECT * FROM `ports_vlans` AS PV LEFT JOIN vlans AS V ON PV.`vlan` = V.`vlan_vlan` AND PV.`device_id` = V.`device_id`
                       WHERE PV.`device_id` = ? ORDER BY PV.`vlan`', array($device['device_id'])) as $entry) {
            $cache['ports_vlan'][$entry['port_id']][$entry['vlan']] = $entry;
        }
        echo generate_box_open();
        echo '<table class="' . $table_class . ' table-hover">' . PHP_EOL;
        $cols = array(array(NULL, 'class="state-marker"'), array(NULL), 'port' => array('Port'), array(NULL), 'traffic' => array('Traffic'), 'speed' => array('Speed'), 'mac' => array('MAC Address'), array(NULL));
        echo get_table_header($cols, $vars);
        echo '<tbody>' . PHP_EOL;
        foreach ($ports as $port) {
            if (is_filtered()) {
                continue;
            }
            print_port_row($port, $vars);
        }
        echo '</tbody></table>';
        echo generate_box_close();
    }
}
register_html_title("Ports");
unset($where, $ext_tables, $cache['ports_option'], $cache['ports_vlan']);
// EOF
Example #3
0
    // Print single VRF
    echo generate_box_open();
    echo '<table class="table  table-striped">';
    $vrf = dbFetchRow("SELECT * FROM `vrfs` WHERE `mplsVpnVrfRouteDistinguisher` = ? " . $GLOBALS['cache']['where']['devices_permitted'], array($vars['vrf']));
    echo '<tr>';
    echo '<td style="width: 200px;" class="entity-title"><a href="' . generate_url($link_array, array('vrf' => $vrf['mplsVpnVrfRouteDistinguisher'])) . '">' . $vrf['vrf_name'] . '</a></td>';
    echo '<td style="width: 100px;" class="small">' . $vrf['mplsVpnVrfRouteDistinguisher'] . '</td>';
    echo '<td style="width: 200px;" class="small">' . $vrf['mplsVpnVrfDescription'] . '</td>';
    echo '</table>';
    echo generate_box_close();
    $vrf_devices = dbFetchRows("SELECT * FROM `vrfs` LEFT JOIN `devices` USING (`device_id`) WHERE `mplsVpnVrfRouteDistinguisher` = ? " . $GLOBALS['cache']['where']['devices_permitted'], array($vrf['mplsVpnVrfRouteDistinguisher']));
    foreach ($vrf_devices as $device) {
        $hostname = $device['hostname'];
        echo generate_box_open();
        echo '<table cellpadding="10" cellspacing="0" class="table  table-striped" width="100%">';
        print_device_row($device);
        echo '</table>';
        echo generate_box_close();
        unset($seperator);
        echo '<div style="margin: 10px;"><table class="table  table-striped">';
        $i = 1;
        foreach (dbFetchRows("SELECT * FROM `ports` WHERE `ifVrf` = ? AND `device_id` = ?" . $GLOBALS['cache']['where']['ports_permitted'], array($device['vrf_id'], $device['device_id'])) as $port) {
            print_port_row($port);
            $i++;
        }
        $x++;
        echo '</table></div>';
        echo '<div style="height: 10px;"></div>';
    }
}
// EOF