コード例 #1
0
ファイル: mac.inc.php プロジェクト: RomanBogachev/observium
<?php 
unset($search, $devices);
$devices[''] = 'All Devices';
foreach ($cache['devices']['hostname'] as $hostname => $device_id) {
    if ($cache['devices']['id'][$device_id]['disabled'] && !$config['web_show_disabled']) {
        continue;
    }
    $devices[$device_id] = $hostname;
}
//Device field
$search[] = array('type' => 'select', 'name' => 'Devices', 'id' => 'device_id', 'width' => '160px', 'value' => $vars['device_id'], 'values' => $devices);
//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_simple($search, 'MAC Addresses');
// 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 addresses';
?>

  </div> <!-- span12 -->
コード例 #2
0
ファイル: ipv6.inc.php プロジェクト: RomanBogachev/observium
    $devices[$device_id] = $hostname;
}
//Device field
$search[] = array('type' => 'select', 'name' => 'Device', 'id' => 'device_id', 'value' => $vars['device_id'], 'values' => $devices);
//Interface field
$search[] = array('type' => 'select', 'name' => 'Interface', 'id' => 'interface', 'width' => '130px', 'value' => $vars['interface'], 'values' => array('' => 'All Interfaces', '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 only', '6' => 'IPv6 only'));
//IP address field
$search[] = array('type' => 'text', 'name' => 'IP Address', 'id' => 'address', 'value' => $vars['address']);
print_search_simple($search, 'IPv6');
// Pagination
$vars['pagination'] = TRUE;
if (!$vars['pagesize']) {
    $vars['pagesize'] = "100";
}
if (!$vars['pageno']) {
    $vars['pageno'] = "1";
}
// Print addresses
print_addresses($vars);
$pagetitle[] = "IPv6 address search";
?>

  </div> <!-- span12 -->
コード例 #3
0
     $link = generate_url($link_array);
     echo '<td align=center>';
     echo '<span class="device-head">' . $text . '</span><br />';
     echo '<a href="' . $link . '">';
     echo generate_graph_tag($graph_array);
     echo '</a>';
     echo '</td>';
 }
 echo '</tr></table>';
 $graph_array = $vars;
 $graph_array['height'] = "300";
 $graph_array['width'] = $graph_width;
 print_optionbar_end();
 $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' => $vars['timestamp_from'], 'to' => $vars['timestamp_to']);
 print_search_simple($search, '', 'update');
 unset($search);
 /// Run the graph to get data array out of it
 $_GET = $graph_array;
 $command_only = 1;
 include "includes/graphs/graph.inc.php";
 /// Print options navbar
 $navbar = array();
 $navbar['brand'] = "Options";
 $navbar['class'] = "navbar-narrow";
 $navbar['options']['legend'] = array('text' => 'Show Legend', 'inverse' => TRUE);
 $navbar['options']['previous'] = array('text' => 'Graph Previous');
 $navbar['options']['trend'] = array('text' => 'Graph Trend');
 $navbar['options']['max'] = array('text' => 'Graph Maximum');
 $navbar['options_right']['showcommand'] = array('text' => 'RRD Command');
 foreach (array('options' => $navbar['options'], 'options_right' => $navbar['options_right']) as $side => $options) {
コード例 #4
0
ファイル: fdb.inc.php プロジェクト: RomanBogachev/observium
<div class="row">
<div class="span12">

<?php 
unset($search, $devices);
$devices[''] = 'All Devices';
foreach (dbFetchRows("SELECT D.device_id AS device_id, `hostname` FROM `vlans_fdb` AS V, `devices` AS D WHERE V.device_id = D.device_id GROUP BY `device_id` ORDER BY `hostname`;") as $data) {
    if ($data['disabled'] && !$config['web_show_disabled']) {
        continue;
    }
    $devices[$data['device_id']] = $data['hostname'];
}
//Device field
$search[] = array('type' => 'select', 'name' => 'Device', 'id' => 'device_id', 'value' => $vars['device_id'], 'values' => $devices);
$search[] = array('type' => 'text', 'name' => 'IP Address', 'id' => 'string', 'value' => $vars['address']);
print_search_simple($search, 'FDB Table');
$pagetitle[] = "FDB Search";
echo '<table class="table table-striped table-condensed table-rounded table-bordered">';
$query = "SELECT * FROM `vlans_fdb` AS F, `vlans` as V, `ports` AS P, `devices` AS D WHERE V.vlan_vlan = F.vlan_id AND V.device_id = F.device_id AND P.port_id = F.port_id and D.device_id = F.device_id ";
$query .= " AND F.`mac_address` LIKE ?";
$param = array("%" . str_replace(array(':', ' ', '-', '.', '0x'), '', mres($_POST['string'])) . "%");
if (is_numeric($_POST['device_id'])) {
    $query .= " AND P.device_id = ?";
    $param[] = $_POST['device_id'];
}
$query .= " ORDER BY F.mac_address";
echo '<thead><tr>
        <th>MAC Address</th>
        <th>Device</th>
        <th>Interface</th>
        <th>VLAN ID</th>
コード例 #5
0
    foreach (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');
    $search[] = array('type' => 'datetime', 'id' => 'timestamp', 'presets' => TRUE, 'min' => $timestamp_min, 'max' => $timestamp_max, 'from' => $vars['timestamp_from'], 'to' => $vars['timestamp_to']);
    print_search_simple($search);
    // Pagination
    $vars['pagination'] = TRUE;
    if (!$vars['pagesize']) {
        $vars['pagesize'] = 100;
    }
    if (!$vars['pageno']) {
        $vars['pageno'] = 1;
    }
    // Print syslog
    print_syslogs($vars);
} else {
    echo '<div class="alert alert-info"><h3>Device not have syslog events</h3><p>This device does not have any syslog entries. Check that the correct set syslog server and config option. See <a href="http://www.observium.org/wiki/Category:Documentation" target="_blank">documentation</a> and <a href="http://www.observium.org/wiki/Configuration_Options#Syslog_Settings" target="_blank">config options</a>.</p></div>';
}
$pagetitle[] = 'Syslog';
コード例 #6
0
ファイル: arp.inc.php プロジェクト: RomanBogachev/observium
<div class="row">
<div class="span12">

<?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_simple($search, 'ARP/NDP Search');
// Pagination
$vars['pagination'] = TRUE;
if (!$vars['pagesize']) {
    $vars['pagesize'] = 100;
}
if (!$vars['pageno']) {
    $vars['pageno'] = 1;
}
print_arptable($vars);
?>

  </div> <!-- span12 -->

</div> <!-- row -->
コード例 #7
0
foreach (dbFetchRows('SELECT S.`device_id` AS `device_id`, hostname FROM `syslog` AS S
                      LEFT JOIN `devices` AS D ON S.device_id = D.device_id
                      GROUP BY `hostname` ORDER BY `hostname`') as $data) {
    $device_id = $data['device_id'];
    // Exclude not permited devices
    if (isset($cache['devices']['id'][$device_id])) {
        if ($cache['devices']['id'][$device_id]['disabled'] && !$config['web_show_disabled']) {
            continue;
        }
        $devices[$device_id] = $data['hostname'];
    }
}
$search[] = array('type' => 'select', 'name' => 'Devices', 'id' => 'device_id', 'width' => '150px', 'value' => $vars['device_id'], 'values' => $devices);
$search[] = array('type' => 'newline');
$search[] = array('type' => 'datetime', 'id' => 'timestamp', 'presets' => TRUE, 'min' => dbFetchCell('SELECT MIN(`timestamp`) FROM `syslog`'), 'max' => dbFetchCell('SELECT MAX(`timestamp`) FROM `syslog`'), 'from' => $vars['timestamp_from'], 'to' => $vars['timestamp_to']);
print_search_simple($search, 'Syslog');
// Pagination
$vars['pagination'] = TRUE;
if (!$vars['pagesize']) {
    $vars['pagesize'] = 100;
}
if (!$vars['pageno']) {
    $vars['pageno'] = 1;
}
// Print syslog
print_syslogs($vars);
$pagetitle[] = 'Syslog';
?>
  </div> <!-- span12 -->

</div> <!-- row -->
コード例 #8
0
<?php

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');
$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_simple($search, 'Eventlog');
/// Pagination
$vars['pagination'] = TRUE;
if (!$vars['pagesize']) {
    $vars['pagesize'] = "100";
}
if (!$vars['pageno']) {
    $vars['pageno'] = "1";
}
print_events($vars);
$pagetitle[] = "Events";