Exemplo n.º 1
0
foreach (dbFetchRows('SELECT E.`device_id` AS `device_id`, `hostname`, `entPhysicalModelName`
                     FROM `entPhysical` AS E
                     INNER JOIN `devices` AS D ON D.`device_id` = E.`device_id`' . $where . 'GROUP BY `device_id`, `entPhysicalModelName`;') as $data) {
    $device_id = $data['device_id'];
    $devices_array[$device_id] = $data['hostname'];
    if ($data['entPhysicalModelName'] != '') {
        $parts[$data['entPhysicalModelName']] = $data['entPhysicalModelName'];
    }
}
//Device field
natcasesort($devices_array);
$search[] = array('type' => 'multiselect', 'width' => '160px', 'name' => 'Devices', 'id' => 'device_id', 'value' => $vars['device_id'], 'values' => $devices_array);
//Parts field
ksort($parts);
$search[] = array('type' => 'multiselect', 'width' => '160px', 'name' => 'Parts', 'id' => 'parts', 'value' => $vars['parts'], 'values' => $parts);
//Serial field
$search[] = array('type' => 'text', 'width' => '160px', 'name' => 'Serial', 'id' => 'serial', 'value' => $vars['serial']);
//Description field
$search[] = array('type' => 'text', 'width' => '160px', 'name' => 'Desc', 'id' => 'description', 'value' => $vars['description']);
print_search($search, 'Inventory', 'search', 'inventory/');
// Pagination
$vars['pagination'] = TRUE;
print_inventory($vars);
$pagetitle[] = 'Inventory';
?>

  </div> <!-- col-md-12 -->
</div> <!-- row -->

<?php 
// EOF
		header.hidden=true;

		query_status=document.getElementsByClassName("query_status")[0];
		query_status.hidden=true;

		SponsID=document.getElementsByClassName("SponsID")[0];
		SponsID.hidden=false;

		window.print();

		document.getElementById("printButton").style.visibility="visible";  
		sort.hidden=false;
		search.hidden=false;
		header.hidden=false;
		query_status.hidden=false;
		SponsID.hidden=true;
	}
</script>';
	echo '<button name="print" type="button" value="Print" id="printButton" onClick="printpage()">Print</button>';
	print_sort($result);
	print_search($result);

	print_table($result);

	$_SESSION['main_query'] = $main_query;
	$_SESSION['table_message'] = $table_message;

?>
</div>
</body>
</html>
Exemplo n.º 3
0
} else {
    $navbar['options_right']['searchbar'] = array('text' => 'Hide Search', 'url' => generate_url($vars, array('searchbar' => 'hide')));
}
if ($vars['bare'] == "yes") {
    $navbar['options_right']['header'] = array('text' => 'Show Header', 'url' => generate_url($vars, array('bare' => NULL)));
} else {
    $navbar['options_right']['header'] = array('text' => 'Hide Header', 'url' => generate_url($vars, array('bare' => 'yes')));
}
$navbar['options_right']['reset'] = array('text' => 'Reset', 'url' => generate_url(array('page' => 'devices', 'section' => $vars['section'], 'bare' => $vars['bare'])));
print_navbar($navbar);
unset($navbar);
// Print period options for graphs
if ($vars['format'] == 'graphs') {
    $search = array();
    $search[] = array('type' => 'datetime', 'id' => 'timestamp', 'presets' => TRUE, 'min' => '2007-04-03 16:06:59', 'max' => date('Y-m-d 23:59:59'), 'from' => date('Y-m-d H:i:s', $vars['from']), 'to' => date('Y-m-d H:i:s', $vars['to']));
    print_search($search, NULL, 'update');
    //Do not use url here, because it discards all other vars from url
    unset($search);
}
switch ($vars['sort']) {
    case 'uptime':
    case 'location':
    case 'os':
        $order = ' ORDER BY `' . $vars['sort'] . '`';
    default:
        $order = ' ORDER BY `hostname`';
        break;
}
$query = "SELECT * FROM `devices` " . $where . $query_permitted . $order;
list($format, $subformat) = explode("_", $vars['format'], 2);
$devices = dbFetchRows($query);
Exemplo n.º 4
0
<div class="col-md-12">

<?php 
unset($search, $vlans, $vlan_names);
// Select vlans only with FDB tables
foreach (dbFetchRows('SELECT `vlan_vlan`, `vlan_name`
                     FROM `vlans_fdb` AS F
                     LEFT JOIN `vlans` as V ON V.`vlan_vlan` = F.`vlan_id` AND V.`device_id` = F.`device_id`
                     WHERE F.`device_id` = ?
                     GROUP BY `vlan_vlan`', array($device['device_id'])) as $data) {
    $vlans[$data['vlan_vlan']] = 'Vlan' . $data['vlan_vlan'];
    $vlan_names[$data['vlan_name']] = $data['vlan_name'];
}
//Vlans field
ksort($vlans);
$search[] = array('type' => 'multiselect', 'name' => 'VLANs', 'id' => 'vlan_id', 'value' => $vars['vlan_id'], 'values' => $vlans);
//Vlan names field
natcasesort($vlan_names);
$search[] = array('type' => 'multiselect', 'width' => '160px', 'name' => 'VLAN names', 'id' => 'vlan_name', 'value' => $vars['vlan_name'], 'values' => $vlan_names);
//MAC address field
$search[] = array('type' => 'text', 'name' => 'MAC Address', 'id' => 'address', 'value' => $vars['address']);
print_search($search);
// Pagination
$vars['pagination'] = TRUE;
print_fdbtable($vars);
?>

  </div> <!-- col-md-12 -->
</div> <!-- row -->
<?php 
// EOF
Exemplo n.º 5
0
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
?>
<div class="row">
<div class="col-md-12">

<?php 
unset($search, $devices);
//Search by field
$search[] = array('type' => 'select', 'name' => '搜索条件', 'id' => 'searchby', 'width' => '120px', 'value' => $vars['searchby'], 'values' => array('mac' => 'MAC地址', 'ip' => 'IP地址'));
//IP version field
$search[] = array('type' => 'select', 'name' => 'IP', 'id' => 'ip_version', 'width' => '120px', 'value' => $vars['ip_version'], 'values' => array('' => 'IPv4 & IPv6', '4' => '仅IPv4', '6' => '仅IPv6'));
//Address field
$search[] = array('type' => 'text', 'name' => '地址', 'id' => 'address', 'value' => $vars['address']);
print_search($search, 'ARP/NDP 搜索');
// Pagination
$vars['pagination'] = TRUE;
if (!$vars['pagesize']) {
    $vars['pagesize'] = 100;
}
if (!$vars['pageno']) {
    $vars['pageno'] = 1;
}
print_arptable($vars);
?>

  </div> <!-- col-md-12 -->

</div> <!-- row -->
<?php 
Exemplo n.º 6
0
$where .= generate_query_permitted(array('port'), array('port_table' => 'M'));
$devices_array = array();
//$devices_array[''] = 'All Devices';
// Select the devices only with ARP/NDP tables
foreach (dbFetchRows('SELECT `device_id` FROM `ip_mac` AS M
                     LEFT JOIN `ports` AS I ON I.`port_id` = M.`port_id`' . $where . 'GROUP BY `device_id`;') as $data) {
    $device_id = $data['device_id'];
    if ($cache['devices']['id'][$device_id]['hostname']) {
        $devices_array[$device_id] = $cache['devices']['id'][$device_id]['hostname'];
    }
}
natcasesort($devices_array);
$search = array();
//Device field
$search[] = array('type' => 'multiselect', 'name' => '设备', 'id' => 'device_id', 'width' => '130px', 'value' => $vars['device_id'], 'values' => $devices_array);
//Search by field
$search[] = array('type' => 'select', 'name' => '搜索', 'id' => 'searchby', 'width' => '120px', 'value' => $vars['searchby'], 'values' => array('mac' => 'MAC地址', 'ip' => 'IP地址'));
//IP version field
$search[] = array('type' => 'select', 'name' => 'IP', 'id' => 'ip_version', 'width' => '120px', 'value' => $vars['ip_version'], 'values' => array('' => 'IPv4 & IPv6', '4' => '仅IPv4', '6' => '仅IPv6'));
//Address field
$search[] = array('type' => 'text', 'name' => '地址', 'id' => 'address', 'width' => '120px', 'value' => $vars['address']);
print_search($search, 'ARP/NDP', NULL, 'search/search=arp/');
// Pagination
$vars['pagination'] = TRUE;
print_arptable($vars);
$page_title[] = 'ARP/NDP搜素';
?>

  </div> <!-- col-md-12 -->
</div> <!-- row -->
Exemplo n.º 7
0
<div class="col-md-12">

<?php 
unset($search, $vlans, $vlan_names);
// Select vlans only with FDB tables
foreach (dbFetchRows('SELECT `vlan_vlan`, `vlan_name`
                     FROM `vlans_fdb` AS F
                     LEFT JOIN `vlans` as V ON V.`vlan_vlan` = F.`vlan_id` AND V.`device_id` = F.`device_id`
                     WHERE F.`device_id` = ? AND F.`port_id` = ?
                     GROUP BY `vlan_vlan`', array($port['device_id'], $port['port_id'])) as $data) {
    $vlans[$data['vlan_vlan']] = 'Vlan' . $data['vlan_vlan'];
    $vlan_names[$data['vlan_name']] = $data['vlan_name'];
}
//Vlans field
ksort($vlans);
$search[] = array('type' => 'multiselect', 'name' => 'VLANs', 'id' => 'vlan_id', 'value' => $vars['vlan_id'], 'values' => $vlans);
//Vlan names field
natcasesort($vlan_names);
$search[] = array('type' => 'multiselect', 'width' => '160px', 'name' => 'VLAN名称', 'id' => 'vlan_name', 'value' => $vars['vlan_name'], 'values' => $vlan_names);
//MAC address field
$search[] = array('type' => 'text', 'name' => 'MAC地址', 'id' => 'address', 'value' => $vars['address']);
print_search($search, NULL, 'search', 'device/device=' . $port['device_id'] . '/tab=port/port=' . $port['port_id'] . '/view=fdb/');
// Pagination
$vars['pagination'] = TRUE;
print_fdbtable($vars);
?>

  </div> <!-- col-md-12 -->
</div> <!-- row -->
<?php 
// EOF
Exemplo n.º 8
0
?>
<div class="row">
<div class="col-md-12">

<?php 
unset($search, $devices_array);
//$devices_array[''] = 'All Devices';
foreach ($cache['devices']['hostname'] as $hostname => $device_id) {
    if ($cache['devices']['id'][$device_id]['disabled'] && !$config['web_show_disabled']) {
        continue;
    }
    $devices_array[$device_id] = $hostname;
}
//Device field
$search[] = array('type' => 'multiselect', 'name' => 'Devices', 'id' => 'device_id', 'width' => '160px', 'value' => $vars['device_id'], 'values' => $devices_array);
//Interface field
$search[] = array('type' => 'select', 'name' => 'Interface', 'id' => 'interface', 'width' => '160px', 'value' => $vars['interface'], 'values' => array('' => 'All Interfaces', 'Loopback%' => 'Loopbacks', 'Vlan%' => 'Vlans'));
//MAC address field
$search[] = array('type' => 'text', 'name' => 'MAC Address', 'id' => 'address', 'width' => '160px', 'value' => $vars['address']);
print_search($search, 'MAC Addresses', NULL, 'search/search=mac/');
// Pagination
$vars['pagination'] = TRUE;
// Print MAC addresses
print_mac_addresses($vars);
$pagetitle[] = 'MAC addresses';
?>

  </div> <!-- col-md-12 -->

</div> <!-- row -->
Exemplo n.º 9
0
foreach ($cache['devices']['hostname'] as $hostname => $device_id) {
    if ($cache['devices']['id'][$device_id]['disabled'] && !$config['web_show_disabled']) {
        continue;
    }
    $devices_array[$device_id] = $hostname;
}
//Device field
$search[] = array('type' => 'multiselect', 'name' => 'Device', 'id' => 'device_id', 'value' => $vars['device_id'], 'values' => $devices_array);
//Interface field
$search[] = array('type' => 'select', 'name' => 'Interface', 'id' => 'interface', 'width' => '130px', 'value' => $vars['interface'], 'values' => array('' => 'All Interfaces', 'Lo' => 'Loopbacks', 'Vlan' => 'Vlans'));
////IP version field
//$search[] = array('type'    => 'select',
//                  'name'    => 'IP',
//                  'id'      => 'ip_version',
//                  'width'   => '120px',
//                  'value'   => $vars['ip_version'],
//                  'values'  => array('' => 'IPv4 & IPv6', '4' => 'IPv4 only', '6' => 'IPv6 only'));
//IP address field
$search[] = array('type' => 'text', 'name' => 'IP Address', 'id' => 'address', 'value' => $vars['address']);
print_search($search, 'IPv6', NULL, 'search/search=ipv6/');
// Pagination
$vars['pagination'] = TRUE;
// Print addresses
print_addresses($vars);
$pagetitle[] = "IPv6 address search";
?>

  </div> <!-- col-md-12 -->

</div> <!-- row -->
Exemplo n.º 10
0
?>
<div class="row">
<div class="col-md-12">

<?php 
unset($search, $devices_array);
//$devices_array[''] = 'All Devices';
// Select the devices only in the wifi_sessions table
foreach (dbFetchRows('SELECT `device_id` FROM `wifi_sessions` GROUP BY `device_id`;') as $data) {
    $device_id = $data['device_id'];
    if ($cache['devices']['id'][$device_id]['hostname']) {
        $devices_array[$device_id] = $cache['devices']['id'][$device_id]['hostname'];
    }
}
natcasesort($devices_array);
//Device field
$search[] = array('type' => 'multiselect', 'name' => 'Device', 'id' => 'device_id', 'width' => '130px', 'value' => $vars['device_id'], 'values' => $devices_array);
//Search by field
$search[] = array('type' => 'select', 'name' => 'Search By', 'id' => 'searchby', 'width' => '120px', 'value' => $vars['searchby'], 'values' => array('mac' => 'MAC Address', 'ip' => 'IP Address', 'username' => 'Username'));
//Address field
$search[] = array('type' => 'text', 'name' => 'Address', 'id' => 'address', 'width' => '120px', 'value' => $vars['address']);
print_search($search, '802.1x', NULL, 'search/search=dot1x/');
// Pagination
$vars['pagination'] = TRUE;
print_dot1xtable($vars);
$pagetitle[] = '.1x Session Search';
?>

  </div> <!-- col-md-12 -->
</div> <!-- row -->
Exemplo n.º 11
0
                     LEFT JOIN `vlans` as V ON V.`vlan_vlan` = F.`vlan_id` AND V.`device_id` = F.`device_id`' . $where . 'GROUP BY `device_id`, `vlan_vlan`;') as $data) {
    $device_id = $data['device_id'];
    if ($cache['devices']['id'][$device_id]['hostname']) {
        $devices_array[$device_id] = $cache['devices']['id'][$device_id]['hostname'];
        if (is_numeric($data['vlan_vlan'])) {
            $vlans[$data['vlan_vlan']] = 'Vlan' . $data['vlan_vlan'];
            $vlan_names[$data['vlan_name']] = $data['vlan_name'];
        }
    }
}
//Device field
natcasesort($devices_array);
$search[] = array('type' => 'multiselect', 'width' => '160px', 'name' => '设备', 'id' => 'device_id', 'value' => $vars['device_id'], 'values' => $devices_array);
//Vlans field
ksort($vlans);
$search[] = array('type' => 'multiselect', 'name' => 'VLANs', 'id' => 'vlan_id', 'value' => $vars['vlan_id'], 'values' => $vlans);
//Vlan names field
natcasesort($vlan_names);
$search[] = array('type' => 'multiselect', 'width' => '160px', 'name' => 'VLAN名称', 'id' => 'vlan_name', 'value' => $vars['vlan_name'], 'values' => $vlan_names);
//MAC address field
$search[] = array('type' => 'text', 'name' => 'MAC地址', 'id' => 'address', 'value' => $vars['address']);
print_search($search, "FDB表", NULL, 'search/search=fdb/');
// Pagination
$vars['pagination'] = TRUE;
print_fdbtable($vars);
$page_title[] = "FDB搜索";
?>

  </div> <!-- col-md-12 -->
</div> <!-- row -->
Exemplo n.º 12
0
foreach ($cache['devices']['hostname'] as $hostname => $device_id) {
    if ($cache['devices']['id'][$device_id]['disabled'] && !$config['web_show_disabled']) {
        continue;
    }
    $devices_array[$device_id] = $hostname;
}
//Device field
$search[] = array('type' => 'multiselect', 'name' => 'Device', 'id' => 'device_id', 'value' => $vars['device_id'], 'values' => $devices_array);
//Interface field
$search[] = array('type' => 'select', 'name' => 'Interface', 'id' => 'interface', 'width' => '130px', 'value' => $vars['interface'], 'values' => array('' => 'All Interfaces', 'Lo' => 'Loopbacks', 'Vlan' => 'Vlans'));
////IP version field
//$search[] = array('type'    => 'select',
//                  'name'    => 'IP',
//                  'id'      => 'ip_version',
//                  'width'   => '120px',
//                  'value'   => $vars['ip_version'],
//                  'values'  => array('' => 'IPv4 & IPv6', '4' => 'IPv4 only', '6' => 'IPv6 only'));
//IP address field
$search[] = array('type' => 'text', 'name' => 'IP Address', 'id' => 'address', 'value' => $vars['address']);
print_search($search, 'IPv4', NULL, 'search/search=ipv4/');
// Pagination
$vars['pagination'] = TRUE;
// Print addresses
print_addresses($vars);
$pagetitle[] = "IPv4 Addresses";
?>

  </div> <!-- col-md-12 -->

</div> <!-- row -->
Exemplo n.º 13
0
<?php

/**
 * Observium Network Management and Monitoring System
 * Copyright (C) 2006-2014, Adam Armstrong - http://www.observium.org
 *
 * @package    observium
 * @subpackage webui
 * @author     Adam Armstrong <*****@*****.**>
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
unset($search, $types);
//Message field
$search[] = array('type' => 'text', 'name' => 'Message', 'id' => 'message', 'value' => $vars['message']);
//Type field
//$types[''] = 'All Types';
$types['system'] = 'System';
foreach (dbFetchRows('SELECT `type` FROM `eventlog` WHERE `device_id` = ? GROUP BY `type` ORDER BY `type`', array($vars['device'])) as $data) {
    $type = $data['type'];
    $types[$type] = ucfirst($type);
}
$search[] = array('type' => 'multiselect', 'name' => 'Types', 'id' => 'type', 'value' => $vars['type'], 'values' => $types);
$search[] = array('type' => 'newline', 'hr' => TRUE);
$search[] = array('type' => 'datetime', 'id' => 'timestamp', 'presets' => TRUE, 'min' => dbFetchCell('SELECT MIN(`timestamp`) FROM `eventlog` WHERE `device_id` = ?', array($vars['device'])), 'max' => dbFetchCell('SELECT MAX(`timestamp`) FROM `eventlog` WHERE `device_id` = ?', array($vars['device'])), 'from' => $vars['timestamp_from'], 'to' => $vars['timestamp_to']);
print_search($search, 'Eventlog');
/// Pagination
$vars['pagination'] = TRUE;
print_events($vars);
$pagetitle[] = "Events";
// EOF
Exemplo n.º 14
0
}
natcasesort($port_ids);
// Ports names field
$search[] = array('type' => 'multiselect', 'width' => '160px', 'name' => 'Ports', 'id' => 'port', 'value' => $vars['port'], 'values' => $port_ids);
// Select vlans only with FDB tables
foreach (dbFetchRows('SELECT `vlan_vlan`, `vlan_name`
                     FROM `vlans_fdb` AS F
                     LEFT JOIN `vlans` as V ON V.`vlan_vlan` = F.`vlan_id` AND V.`device_id` = F.`device_id`
                     WHERE F.`device_id` = ?
                     GROUP BY `vlan_vlan`', array($device['device_id'])) as $data) {
    $vlans[$data['vlan_vlan']] = 'Vlan' . $data['vlan_vlan'];
    $vlan_names[$data['vlan_name']] = $data['vlan_name'];
}
//Vlans field
ksort($vlans);
$search[] = array('type' => 'multiselect', 'name' => 'VLANs', 'id' => 'vlan_id', 'value' => $vars['vlan_id'], 'values' => $vlans);
//Vlan names field
natcasesort($vlan_names);
$search[] = array('type' => 'multiselect', 'width' => '160px', 'name' => 'VLAN名称', 'id' => 'vlan_name', 'value' => $vars['vlan_name'], 'values' => $vlan_names);
//MAC address field
$search[] = array('type' => 'text', 'name' => 'MAC地址', 'id' => 'address', 'value' => $vars['address']);
print_search($search, NULL, 'search', 'device/device=' . $device['device_id'] . '/tab=ports/view=fdb/');
// Pagination
$vars['pagination'] = TRUE;
print_fdbtable($vars);
?>

  </div> <!-- col-md-12 -->
</div> <!-- row -->
<?php 
// EOF
 * @package    observium
 * @subpackage webui
 * @author     Adam Armstrong <*****@*****.**>
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
unset($search, $types);
//Message field
$search[] = array('type' => 'text', 'name' => '信息', 'id' => 'message', 'value' => $vars['message']);
//Type field
//$types[''] = '所有类型';
$types['system'] = '系统';
foreach (dbFetchRows('SELECT `type` FROM `eventlog` WHERE `device_id` = ? GROUP BY `type` ORDER BY `type`', array($vars['device'])) as $data) {
    $type = $data['type'];
    $types[$type] = ucfirst($type);
}
$search[] = array('type' => 'multiselect', 'name' => '类型', 'id' => 'type', 'value' => $vars['type'], 'values' => $types);
$search[] = array('type' => 'newline');
$search[] = array('type' => 'datetime', 'id' => 'timestamp', 'presets' => TRUE, 'min' => dbFetchCell('SELECT MIN(`timestamp`) FROM `eventlog` WHERE `device_id` = ?', array($vars['device'])), 'max' => dbFetchCell('SELECT MAX(`timestamp`) FROM `eventlog` WHERE `device_id` = ?', array($vars['device'])), 'from' => $vars['timestamp_from'], 'to' => $vars['timestamp_to']);
print_search($search, '事件日志');
/// Pagination
$vars['pagination'] = TRUE;
if (!$vars['pagesize']) {
    $vars['pagesize'] = "100";
}
if (!$vars['pageno']) {
    $vars['pageno'] = "1";
}
print_events($vars);
$pagetitle[] = "日志";
// EOF
Exemplo n.º 16
0
', 'toc', $(this));"></a></span>
                                        <div class="bookmark_detail" id="toc_detail_<?php 
        echo $index;
        ?>
">
                                            <div class="bookmark_info" id="toc_info_<?php 
        echo $index;
        ?>
">
                                                <div class="orange-title">®Description® :</div>
                                                <?php 
        print_info($bookmark['description']);
        ?>
                                                <div class="orange-title" style="margin-top: 6px;">®Keywords® : </div>
        <?php 
        print_search($bookmark['keywords']);
        ?>
                                            </div>

                                            <div class="edit_bookmark_form" id="edit_toc_<?php 
        echo $index;
        ?>
">            
                                                <input type="hidden" name="album" id="toc_album_<?php 
        echo $index;
        ?>
" value="<?php 
        echo $bookmark['album'];
        ?>
"/>
                                                <input type="hidden" name="asset" id="toc_asset_<?php 
Exemplo n.º 17
0
                     LEFT JOIN `vlans` as V ON V.`vlan_vlan` = F.`vlan_id` AND V.`device_id` = F.`device_id`' . $where . 'GROUP BY `device_id`, `vlan_vlan`;') as $data) {
    $device_id = $data['device_id'];
    if ($cache['devices']['id'][$device_id]['hostname']) {
        $devices_array[$device_id] = $cache['devices']['id'][$device_id]['hostname'];
        if (is_numeric($data['vlan_vlan'])) {
            $vlans[$data['vlan_vlan']] = 'Vlan' . $data['vlan_vlan'];
            $vlan_names[$data['vlan_name']] = $data['vlan_name'];
        }
    }
}
//Device field
natcasesort($devices_array);
$search[] = array('type' => 'multiselect', 'width' => '160px', 'name' => 'Devices', 'id' => 'device_id', 'value' => $vars['device_id'], 'values' => $devices_array);
//Vlans field
ksort($vlans);
$search[] = array('type' => 'multiselect', 'name' => 'VLANs', 'id' => 'vlan_id', 'value' => $vars['vlan_id'], 'values' => $vlans);
//Vlan names field
natcasesort($vlan_names);
$search[] = array('type' => 'multiselect', 'width' => '160px', 'name' => 'VLAN names', 'id' => 'vlan_name', 'value' => $vars['vlan_name'], 'values' => $vlan_names);
//MAC address field
$search[] = array('type' => 'text', 'name' => 'MAC Address', 'id' => 'address', 'value' => $vars['address']);
print_search($search, "FDB Table", NULL, 'search/search=fdb/');
// Pagination
$vars['pagination'] = TRUE;
print_fdbtable($vars);
$pagetitle[] = "FDB Search";
?>

  </div> <!-- col-md-12 -->
</div> <!-- row -->
Exemplo n.º 18
0
<?php 
unset($search, $devices_array);
//$devices_array[''] = '所有设备';
foreach ($cache['devices']['hostname'] as $hostname => $device_id) {
    if ($cache['devices']['id'][$device_id]['disabled'] && !$config['web_show_disabled']) {
        continue;
    }
    $devices_array[$device_id] = $hostname;
}
//Device field
$search[] = array('type' => 'select', 'name' => '设备', 'id' => 'device_id', 'width' => '160px', 'value' => $vars['device_id'], 'values' => $devices_array);
//Interface field
$search[] = array('type' => 'select', 'name' => '接口', 'id' => 'interface', 'width' => '160px', 'value' => $vars['interface'], 'values' => array('' => '所有接口', 'Loopback%' => '回环', 'Vlan%' => 'Vlans'));
//MAC address field
$search[] = array('type' => 'text', 'name' => 'MAC Address', 'id' => 'address', 'width' => '160px', 'value' => $vars['address']);
print_search($search, 'MAC地址');
// Pagination
$vars['pagination'] = TRUE;
if (!$vars['pagesize']) {
    $vars['pagesize'] = "100";
}
if (!$vars['pageno']) {
    $vars['pageno'] = "1";
}
// Print MAC addresses
print_mac_addresses($vars);
$pagetitle[] = 'MAC地址';
?>

  </div> <!-- col-md-12 -->
Exemplo n.º 19
0
    if ($p > 7) {
        continue;
    }
    $priorities[$p] = ucfirst($priority['name']);
}
$search[] = array('type' => 'multiselect', 'name' => 'Priorities', 'id' => 'priority', 'width' => '150px', 'subtext' => TRUE, 'value' => $vars['priority'], 'values' => $priorities);
//Program field
//$programs[''] = '所有程序';
foreach (dbFetchRows('SELECT `program` FROM `syslog`' . $where . 'GROUP BY `program` ORDER BY `program`') as $data) {
    $program = $data['program'] != '' ? $data['program'] : '[[EMPTY]]';
    $programs[$program] = $program;
}
$search[] = array('type' => 'multiselect', 'name' => 'Programs', 'id' => 'program', 'width' => '150px', 'size' => '15', 'value' => $vars['program'], 'values' => $programs);
$search[] = array('type' => 'newline');
$search[] = array('type' => 'datetime', 'id' => 'timestamp', 'presets' => TRUE, 'min' => dbFetchCell('SELECT MIN(`timestamp`) FROM `syslog`' . $where), 'max' => dbFetchCell('SELECT MAX(`timestamp`) FROM `syslog`' . $where), 'from' => $vars['timestamp_from'], 'to' => $vars['timestamp_to']);
print_search($search, '系统日志');
// Pagination
$vars['pagination'] = TRUE;
if (!$vars['pagesize']) {
    $vars['pagesize'] = 100;
}
if (!$vars['pageno']) {
    $vars['pageno'] = 1;
}
// Print syslog
print_syslogs($vars);
$pagetitle[] = '系统日志';
?>
  </div> <!-- col-md-12 -->

</div> <!-- row -->
Exemplo n.º 20
0
$search[] = array('type' => 'text', 'name' => 'Message', 'id' => 'message', 'width' => '130px', 'value' => $vars['message']);
//Priority field
//$priorities[''] = 'All Priorities';
foreach ($config['syslog']['priorities'] as $p => $priority) {
    if ($p > 7) {
        continue;
    }
    $priorities[$p] = ucfirst($priority['name']);
}
$search[] = array('type' => 'multiselect', 'name' => 'Priorities', 'id' => 'priority', 'width' => '150px', 'subtext' => TRUE, 'value' => $vars['priority'], 'values' => $priorities);
//Program field
//$programs[''] = 'All Programs';
foreach (dbFetchRows('SELECT `program` FROM `syslog`' . $where . 'GROUP BY `program` ORDER BY `program`') as $data) {
    $program = $data['program'] != '' ? $data['program'] : '[[EMPTY]]';
    $programs[$program] = $program;
}
$search[] = array('type' => 'multiselect', 'name' => 'Programs', 'id' => 'program', 'width' => '150px', 'size' => '15', 'value' => $vars['program'], 'values' => $programs);
$search[] = array('type' => 'newline', 'hr' => TRUE);
$search[] = array('type' => 'datetime', 'id' => 'timestamp', 'presets' => TRUE, 'min' => dbFetchCell('SELECT MIN(`timestamp`) FROM `syslog`' . $where), 'max' => dbFetchCell('SELECT MAX(`timestamp`) FROM `syslog`' . $where), 'from' => $vars['timestamp_from'], 'to' => $vars['timestamp_to']);
print_search($search, 'Syslog', 'search', 'syslog/');
// Pagination
$vars['pagination'] = TRUE;
// Print syslog
print_syslogs($vars);
$pagetitle[] = 'Syslog';
?>
  </div> <!-- col-md-12 -->

</div> <!-- row -->
<?php 
// EOF
Exemplo n.º 21
0
?>
<div class="row">
<div class="col-md-12">

<?php 
unset($search, $devices_array);
//$devices_array[''] = '所有设备';
foreach ($cache['devices']['hostname'] as $hostname => $device_id) {
    if ($cache['devices']['id'][$device_id]['disabled'] && !$config['web_show_disabled']) {
        continue;
    }
    $devices_array[$device_id] = $hostname;
}
//Device field
$search[] = array('type' => 'multiselect', 'name' => '设备', 'id' => 'device_id', 'width' => '160px', 'value' => $vars['device_id'], 'values' => $devices_array);
//Interface field
$search[] = array('type' => 'select', 'name' => '接口', 'id' => 'interface', 'width' => '160px', 'value' => $vars['interface'], 'values' => array('' => '所有接口', 'Loopback%' => 'Loopbacks', 'Vlan%' => 'Vlans'));
//MAC address field
$search[] = array('type' => 'text', 'name' => 'MAC地址', 'id' => 'address', 'width' => '160px', 'value' => $vars['address']);
print_search($search, 'MAC地址', NULL, 'search/search=mac/');
// Pagination
$vars['pagination'] = TRUE;
// Print MAC addresses
print_mac_addresses($vars);
$page_title[] = 'MAC地址';
?>

  </div> <!-- col-md-12 -->

</div> <!-- row -->
if (isset($vars['device_id'])) {
    $where .= generate_query_values($vars['device_id'], 'device_id');
}
// Check Field
foreach (dbFetchRows('SELECT `alert_test_id` FROM `alert_log`' . $where . 'GROUP BY `alert_test_id`') as $data) {
    $alert_test_id = $data['alert_test_id'];
    if (is_array($alert_rules[$alert_test_id])) {
        $alert_test_array[$alert_test_id] = $alert_rules[$alert_test_id]['alert_name'];
    }
}
natcasesort($alert_test_array);
$search[] = array('type' => 'multiselect', 'name' => '检测器', 'id' => 'alert_test_id', 'width' => '150px', 'value' => $vars['alert_test_id'], 'values' => $alert_test_array);
#ALERT_NOTIFY,FAIL,FAIL_DELAYED,FAIL_SUPPRESSED,OK,RECOVER_NOTIFY,RECOVER_SUPPRESSED
// Status Field
foreach (array('ALERT_NOTIFY', 'FAIL', 'FAIL_DELAYED', 'FAIL_SUPPRESSED', 'OK', 'RECOVER_NOTIFY') as $status_type) {
    $status_types[$status_type] = $status_type;
}
$search[] = array('type' => 'multiselect', 'name' => '状态类型', 'id' => 'log_type', 'width' => '150px', 'value' => $vars['log_type'], 'values' => $status_types);
$search[] = array('type' => 'datetime', 'id' => 'timestamp', 'presets' => TRUE, 'min' => dbFetchCell('SELECT `timestamp` FROM `alert_log`' . $where . ' ORDER BY `timestamp` LIMIT 0,1;'), 'max' => dbFetchCell('SELECT `timestamp` FROM `alert_log`' . $where . ' ORDER BY `timestamp` DESC LIMIT 0,1;'), 'from' => $vars['timestamp_from'], 'to' => $vars['timestamp_to']);
print_search($search, '警报日志', 'search', 'alert_log/');
// Pagination
$vars['pagination'] = TRUE;
// Print Alert Log
print_alert_log($vars);
$page_title[] = '警报日志';
?>
  </div> <!-- col-md-12 -->

</div> <!-- row -->
<?php 
// EOF
    }
}
natcasesort($alert_test_array);
$search[] = array('type' => 'multiselect', 'name' => '检测器', 'id' => 'alert_test_id', 'width' => '125px', 'value' => $vars['alert_test_id'], 'values' => $alert_test_array);
#ALERT_NOTIFY,FAIL,FAIL_DELAYED,FAIL_SUPPRESSED,OK,RECOVER_NOTIFY,RECOVER_SUPPRESSED
// Status Field
foreach (array('ALERT_NOTIFY', 'FAIL', 'FAIL_DELAYED', 'FAIL_SUPPRESSED', 'OK', 'RECOVER_NOTIFY') as $status_type) {
    $status_types[$status_type] = $status_type;
}
$search[] = array('type' => 'multiselect', 'name' => '状态类型', 'id' => 'log_type', 'width' => '125px', 'value' => $vars['log_type'], 'values' => $status_types);
//Message field
#$search[] = array('type'    => 'text',
#                  'name'    => '信息',
#                  'id'      => 'message',
#                  'width'   => '130px',
#                  'value'   => $vars['message']);
// $search[] = array('type'    => 'newline',
//                  'hr'      => TRUE);
$search[] = array('type' => 'datetime', 'id' => 'timestamp', 'presets' => TRUE, 'min' => dbFetchCell('SELECT `timestamp` FROM `alert_log` WHERE `device_id` = ? ORDER BY `timestamp` LIMIT 0,1;', array($vars['device'])), 'max' => dbFetchCell('SELECT `timestamp` FROM `alert_log` WHERE `device_id` = ? ORDER BY `timestamp` DESC LIMIT 0,1;', array($vars['device'])), 'from' => $vars['timestamp_from'], 'to' => $vars['timestamp_to']);
print_search($search, '警报日志', 'search');
// Pagination
$vars['pagination'] = TRUE;
// Print Alert Log
print_alert_log($vars);
$page_title[] = '警报日志';
?>
  </div> <!-- col-md-12 -->

</div> <!-- row -->
<?php 
// EOF
Exemplo n.º 24
0
 * Copyright (C) 2006-2014, Adam Armstrong - http://www.observium.org
 *
 * @package    observium
 * @subpackage webui
 * @author     Adam Armstrong <*****@*****.**>
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
?>
<div class="row">
<div class="col-md-12">

<?php 
unset($search, $devices);
//Search by field
$search[] = array('type' => 'select', 'name' => 'Search By', 'id' => 'searchby', 'width' => '120px', 'value' => $vars['searchby'], 'values' => array('mac' => 'MAC Address', 'ip' => 'IP Address'));
//IP version field
$search[] = array('type' => 'select', 'name' => 'IP', 'id' => 'ip_version', 'width' => '120px', 'value' => $vars['ip_version'], 'values' => array('' => 'IPv4 & IPv6', '4' => 'IPv4 only', '6' => 'IPv6 only'));
//Address field
$search[] = array('type' => 'text', 'name' => 'Address', 'id' => 'address', 'value' => $vars['address']);
print_search($search, 'ARP/NDP Search');
// Pagination
$vars['pagination'] = TRUE;
print_arptable($vars);
?>

  </div> <!-- col-md-12 -->

</div> <!-- row -->
<?php 
// EOF
foreach (dbFetchColumn('SELECT DISTINCT `severity` FROM `eventlog`' . $where) as $severity) {
    $severities[$severity] = ucfirst($config['syslog']['priorities'][$severity]['name']);
}
krsort($severities);
$search[] = array('type' => 'multiselect', 'name' => '严重程度', 'id' => 'severity', 'width' => '110px', 'subtext' => TRUE, 'value' => $vars['severity'], 'values' => $severities);
//Types field
$types['device'] = '设备';
foreach (dbFetchColumn('SELECT DISTINCT `entity_type` FROM `eventlog` IGNORE INDEX (`type`)' . $where) as $type) {
    //$type = $data['type'];
    $types[$type] = ucfirst($type);
}
$search[] = array('type' => 'multiselect', 'name' => '类型', 'id' => 'type', 'width' => '100px', 'value' => $vars['type'], 'values' => $types);
// Newline
//$search[] = array('type'    => 'newline',
//                  'hr'      => TRUE);
// Datetime field
$search[] = array('type' => 'datetime', 'id' => 'timestamp', 'presets' => TRUE, 'min' => dbFetchCell('SELECT `timestamp` FROM `eventlog`' . $where . ' ORDER BY `timestamp` LIMIT 0,1;'), 'max' => dbFetchCell('SELECT `timestamp` FROM `eventlog`' . $where . ' ORDER BY `timestamp` DESC LIMIT 0,1;'), 'from' => $vars['timestamp_from'], 'to' => $vars['timestamp_to']);
print_search($search, '事件日志', 'search', 'eventlog/');
// Pagination
$vars['pagination'] = TRUE;
// Print events
print_events($vars);
$page_title[] = '事件日志';
?>

  </div> <!-- col-md-12 -->

</div> <!-- row -->

<?php 
// EOF
Exemplo n.º 26
0
//Priority field
//$priorities[''] = '所有优先级';
foreach ($config['syslog']['priorities'] as $p => $priority) {
    if ($p > 7) {
        continue;
    }
    $priorities[$p] = ucfirst($priority['name']);
}
$search[] = array('type' => 'multiselect', 'name' => '优先级', 'id' => 'priority', 'width' => '125px', 'subtext' => TRUE, 'value' => $vars['priority'], 'values' => $priorities);
//Program field
//$programs[''] = '所有程序';
foreach (dbFetchColumn('SELECT `program` FROM `syslog` IGNORE INDEX (`program`)' . $where . 'GROUP BY `program`;') as $program) {
    $program = $program != '' ? $program : OBS_VAR_UNSET;
    $programs[$program] = $program;
}
$search[] = array('type' => 'multiselect', 'name' => '程序', 'id' => 'program', 'width' => '125px', 'size' => '15', 'value' => $vars['program'], 'values' => $programs);
//$search[] = array('type'    => 'newline',
//                  'hr'      => TRUE);
$search[] = array('type' => 'datetime', 'id' => 'timestamp', 'presets' => TRUE, 'min' => dbFetchCell('SELECT `timestamp` FROM `syslog`' . $where . ' ORDER BY `timestamp` LIMIT 0,1;'), 'max' => dbFetchCell('SELECT `timestamp` FROM `syslog`' . $where . ' ORDER BY `timestamp` DESC LIMIT 0,1;'), 'from' => $vars['timestamp_from'], 'to' => $vars['timestamp_to']);
print_search($search, '系统日志', 'search', 'syslog/');
// Pagination
$vars['pagination'] = TRUE;
// Print syslog
print_syslogs($vars);
$page_title[] = '系统日志';
?>
  </div> <!-- col-md-12 -->

</div> <!-- row -->
<?php 
// EOF
Exemplo n.º 27
0
    $devices_array[$device_id] = $hostname;
}
//Device field
$search[] = array('type' => 'select', 'name' => '设备', 'id' => 'device_id', 'value' => $vars['device_id'], 'values' => $devices_array);
//Interface field
$search[] = array('type' => 'select', 'name' => '接口', 'id' => 'interface', 'width' => '130px', 'value' => $vars['interface'], 'values' => array('' => '所有接口', 'Loopback%' => 'Loopbacks', 'Vlan%' => 'Vlans'));
////IP version field
//$search[] = array('type'    => 'select',
//                  'name'    => 'IP',
//                  'id'      => 'ip_version',
//                  'width'   => '120px',
//                  'value'   => $vars['ip_version'],
//                  'values'  => array('' => 'IPv4 & IPv6', '4' => '仅IPv4', '6' => '仅IPv6'));
//IP address field
$search[] = array('type' => 'text', 'name' => 'IP地址', 'id' => 'address', 'value' => $vars['address']);
print_search($search, 'IPv4');
// Pagination
$vars['pagination'] = TRUE;
if (!$vars['pagesize']) {
    $vars['pagesize'] = "100";
}
if (!$vars['pageno']) {
    $vars['pageno'] = "1";
}
// Print addresses
print_addresses($vars);
$pagetitle[] = "IPv4地址";
?>

  </div> <!-- col-md-12 -->
Exemplo n.º 28
0
    //$priorities[''] = 'All Priorities';
    foreach ($config['syslog']['priorities'] as $p => $priority) {
        if ($p > 7) {
            continue;
        }
        $priorities[$p] = ucfirst($priority['name']);
    }
    $search[] = array('type' => 'multiselect', 'name' => 'Priorities', 'id' => 'priority', 'width' => '160px', 'subtext' => TRUE, 'value' => $vars['priority'], 'values' => $priorities);
    //Program field
    //$programs[''] = 'All Programs';
    foreach (dbFetchRows('SELECT `program` FROM `syslog` WHERE `device_id` = ? GROUP BY `program` ORDER BY `program`', array($vars['device'])) as $data) {
        $program = $data['program'] ? $data['program'] : '[[EMPTY]]';
        $programs[$program] = $program;
    }
    $search[] = array('type' => 'multiselect', 'name' => 'Programs', 'id' => 'program', 'width' => '160px', 'value' => $vars['program'], 'values' => $programs);
    $search[] = array('type' => 'newline', 'hr' => TRUE);
    $search[] = array('type' => 'datetime', 'id' => 'timestamp', 'presets' => TRUE, 'min' => $timestamp_min, 'max' => $timestamp_max, 'from' => $vars['timestamp_from'], 'to' => $vars['timestamp_to']);
    print_search($search, 'Syslog');
    // Pagination
    $vars['pagination'] = TRUE;
    // Print syslog
    print_syslogs($vars);
} else {
    print_warning('<h4>No syslog entries found!</h4>
This device does not have any syslog entries.
Check that the syslog daemon and Observium configuration options are set correctly, that this device is configured to send syslog to Observium and that there are no firewalls blocking the messages.

See <a href="' . OBSERVIUM_URL . '/wiki/Category:Documentation" target="_blank">documentation</a> and <a href="' . OBSERVIUM_URL . '/wiki/Configuration_Options#Syslog_Settings" target="_blank">configuration options</a> for more information.');
}
$pagetitle[] = 'Syslog';
// EOF
        if ($data['entPhysicalModelName'] != '') {
            $parts[$data['entPhysicalModelName']] = $data['entPhysicalModelName'];
        }
    }
}
//Device field
natcasesort($devices);
$search[] = array('type' => 'select', 'width' => '160px', 'name' => '设备', 'id' => 'device_id', 'value' => $vars['device_id'], 'values' => $devices);
//Parts field
ksort($parts);
$search[] = array('type' => 'multiselect', 'width' => '160px', 'name' => '部件', 'id' => 'parts', 'value' => $vars['parts'], 'values' => $parts);
//Serial field
$search[] = array('type' => 'text', 'width' => '160px', 'name' => '系列', 'id' => 'serial', 'value' => $vars['serial']);
//Description field
$search[] = array('type' => 'text', 'width' => '160px', 'name' => '说明', 'id' => 'description', 'value' => $vars['description']);
print_search($search, '清单');
// Pagination
$vars['pagination'] = TRUE;
if (!$vars['pagesize']) {
    $vars['pagesize'] = 100;
}
if (!$vars['pageno']) {
    $vars['pageno'] = 1;
}
print_inventory($vars);
$pagetitle[] = '清单';
?>

  </div> <!-- col-md-12 -->
</div> <!-- row -->
Exemplo n.º 30
0
 *
 *   This file is part of Observium.
 *
 * @package    observium
 * @subpackage webui
 * @copyright  (C) 2006-2014 Adam Armstrong
 *
 */
// Build a list of user ids we can use to search for bills that user is allowed to see.
if ($isAdmin) {
    foreach (dbFetchRows("SELECT * FROM `entity_permissions` WHERE `entity_type` = 'bill' GROUP BY `user_id` ORDER BY `user_id` ") as $customers) {
        if (bill_permitted($customers['entity_id'])) {
            $customer = dbFetchRow("SELECT * FROM `users` WHERE `user_id` = ? ORDER BY `user_id`", array($customers['user_id']));
            $name = empty($customer['realname']) ? $customer['username'] : $customer['realname'];
            $select = $vars['billinguser'] == $customer['user_id'] ? " selected" : "";
            $users[$customer['user_id']] = $name;
        }
    }
} else {
    $users[$_SESSION['user_id']] = $_SESSION['username'];
}
// Billing name field
$search[] = array('type' => 'text', 'name' => '账单名称', 'id' => 'billingname', 'value' => $vars['billingname']);
// Billing type field
$search[] = array('type' => 'select', 'name' => '所有类型', 'id' => 'billingtype', 'value' => $vars['billingtype'], 'values' => array('cdr' => 'CDR/95th', 'quota' => '限额'));
//Billing user field
$search[] = array('type' => 'select', 'name' => '用户', 'id' => 'billinguser', 'width' => '130px', 'value' => $vars['billinguser'], 'values' => $users);
print_search($search, '账单搜索');
?>