initial commit; version 22.5.12042

This commit is contained in:
2022-12-12 23:28:25 -05:00
commit af1b03d79f
17653 changed files with 22692970 additions and 0 deletions

View File

@ -0,0 +1,83 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage webui
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
?>
<div class="row">
<div class="col-md-12">
<?php
// Select the devices only with ARP/NDP tables
$form_devices = dbFetchColumn('SELECT DISTINCT `device_id` FROM `ip_mac` LEFT JOIN `ports` USING(`port_id`)');
$form_items['devices'] = generate_form_values('device', $form_devices);
$form = array('type' => 'rows',
'space' => '5px',
'submit_by_key' => TRUE,
'url' => 'search/search=arp/');
$form['row'][0]['device_id'] = array(
'type' => 'multiselect',
'name' => 'Device',
'width' => '100%',
'value' => $vars['device_id'],
'groups' => array('', 'UP', 'DOWN', 'DISABLED'), // This is optgroup order for values (if required)
'values' => $form_items['devices']);
$form['row'][0]['ip_version'] = array(
'type' => 'select',
'name' => 'IP',
'width' => '100%',
'value' => $vars['ip_version'],
'values' => array('' => 'IPv4 & IPv6', '4' => 'IPv4 only', '6' => 'IPv6 only'));
$form['row'][0]['searchby'] = array(
'type' => 'select',
'name' => 'Search By',
'width' => '100%',
'onchange' => "$('#address').prop('placeholder', $('#searchby option:selected').text())",
'value' => $vars['searchby'],
'values' => array('mac' => 'MAC Address', 'ip' => 'IP Address'));
$form['row'][0]['address'] = array(
'type' => 'text',
'name' => ($vars['searchby'] == 'ip' ? 'IP Address' : 'MAC Address'),
'width' => '100%',
'grid' => 3,
'placeholder' => TRUE,
'submit_by_key' => TRUE,
'value' => escape_html($vars['address']));
// search button
$form['row'][0]['search'] = array(
'type' => 'submit',
'grid' => 3,
//'name' => 'Search',
//'icon' => 'icon-search',
'value' => 'arp',
'right' => TRUE);
print_form($form);
unset($form, $form_items, $form_devices);
// Pagination
$vars['pagination'] = TRUE;
print_arptable($vars);
register_html_title('ARP/NDP Search');
?>
</div> <!-- col-md-12 -->
</div> <!-- row -->
<?php
// EOF

View File

@ -0,0 +1,93 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage webui
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
?>
<div class="row">
<div class="col-md-12">
<?php
$form_devices = dbFetchColumn('SELECT DISTINCT `device_id` FROM `wifi_sessions`;');
$form_items['devices'] = generate_form_values('device', $form_devices);
$form = array('type' => 'rows',
//'space' => '5px',
'submit_by_key' => TRUE,
'url' => 'search/search=dot1x/');
//Device field
$form['row'][0]['device_id'] = array(
'type' => 'multiselect',
'name' => 'Device',
'width' => '100%',
'grid' => 3,
'value' => $vars['device_id'],
'groups' => array('', 'UP', 'DOWN', 'DISABLED'), // This is optgroup order for values (if required)
'values' => $form_items['devices']);
//Search by field
$form['row'][0]['searchby'] = array(
'type' => 'select',
'name' => 'Search By',
'width' => '100%',
'grid' => 2,
'onchange' => "$('#address').prop('placeholder', $('#searchby option:selected').text())",
'value' => $vars['searchby'],
'values' => array('mac' => 'MAC Address', 'ip' => 'IP Address', 'username' => 'Username'));
if ($vars['searchby'] == 'mac')
{
$name = 'MAC Address';
}
else if ($vars['searchby'] == 'ip')
{
$name = 'IP Address';
} else {
$name = 'Username';
}
//Address field
$form['row'][0]['address'] = array(
'type' => 'text',
'name' => $name,
'width' => '100%',
'grid' => 4,
'placeholder' => TRUE,
'submit_by_key' => TRUE,
'value' => escape_html($vars['address']));
// search button
$form['row'][0]['search'] = array(
'type' => 'submit',
'grid' => 3,
//'name' => 'Search',
//'icon' => 'icon-search',
'value' => 'dot1x',
'right' => TRUE);
print_form($form);
unset($form, $form_items, $form_devices);
// Pagination
$vars['pagination'] = TRUE;
print_dot1xtable($vars);
register_html_title('.1x Session Search');
?>
</div> <!-- col-md-12 -->
</div> <!-- row -->
<?php
// EOF

View File

@ -0,0 +1,126 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage web
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2022 Observium Limited
*
*/
?>
<div class="row">
<div class="col-md-12">
<?php
$where = ' WHERE 1 ';
$where .= generate_query_permitted([ 'device' ], [ 'device_table' => 'F' ]);
// Select devices and vlans only with FDB tables
foreach (dbFetchRows('SELECT F.`device_id`, `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 . 'GROUP BY `device_id`, `vlan_vlan`;') as $data)
{
$form_devices[] = $data['device_id'];
if (is_numeric($data['vlan_vlan'])) {
$form_items['vlans'][$data['vlan_vlan']] = 'Vlan ' . $data['vlan_vlan'];
}
if (strlen($data['vlan_name'])) {
$form_items['vlan_name'][$data['vlan_name']] = $data['vlan_name'];
}
}
if (is_array($form_items['vlans'])) {
ksort($form_items['vlans']);
natcasesort($form_items['vlan_name']);
}
// Select the devices with FDB tables
//$form_devices = dbFetchColumn('SELECT DISTINCT `device_id` FROM `vlans_fdb`');
$form_items['devices'] = generate_form_values('device', $form_devices);
$form = [
'type' => 'rows',
'space' => '5px',
'submit_by_key' => TRUE,
'url' => 'search/search=fdb/'
];
$form['row'][0]['device_id'] = [
'type' => 'multiselect',
'name' => 'Device',
'width' => '100%',
'value' => $vars['device_id'],
'groups' => [ '', 'UP', 'DOWN', 'DISABLED' ], // This is optgroup order for values (if required)
'values' => $form_items['devices']
];
$form['row'][0]['vlan_id'] = [
'type' => 'multiselect',
'name' => 'VLAN IDs',
'width' => '100%',
'value' => $vars['vlan_id'],
'values' => $form_items['vlans']
];
$form['row'][0]['vlan_name'] = [
'type' => 'multiselect',
'name' => 'VLAN Name',
'width' => '100%',
'value' => $vars['vlan_name'],
'values' => $form_items['vlan_name']
];
$form['row'][0]['address'] = [
'type' => 'text',
'name' => 'MAC Address',
'width' => '100%',
'grid' => 3,
'placeholder' => TRUE,
'submit_by_key' => TRUE,
'value' => $vars['address']
];
$form['row'][0]['deleted'] = [
'type' => 'switch-ng',
//'on-text' => 'Disabled',
'on-color' => 'primary',
'on-icon' => 'icon-eye-close',
//'off-text' => 'Enabled',
'off-icon' => 'icon-eye-open',
'grid' => 2,
//'size' => 'large',
//'height' => '15px',
'title' => 'Show Deleted',
//'placeholder' => 'Disabled',
//'readonly' => TRUE,
//'disabled' => TRUE,
//'submit_by_key' => TRUE,
'value' => $vars['deleted']
];
// search button
$form['row'][0]['search'] = [
'type' => 'submit',
'grid' => 1,
//'name' => 'Search',
//'icon' => 'icon-search',
'value' => 'fdb',
'right' => TRUE
];
print_form($form);
unset($form, $form_items, $form_devices);
// Pagination
$vars['pagination'] = TRUE;
print_fdbtable($vars);
register_html_title("FDB Search");
?>
</div> <!-- col-md-12 -->
</div> <!-- row -->
<?php
// EOF

View File

@ -0,0 +1,96 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage webui
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
?>
<div class="row">
<div class="col-md-12">
<?php
//$form_devices = dbFetchColumn('SELECT DISTINCT `device_id` FROM `ipv4_addresses` LEFT JOIN `ports` USING(`port_id`);');
$form_devices = dbFetchColumn('SELECT DISTINCT `device_id` FROM `ipv4_addresses`;');
$form_items['devices'] = generate_form_values('device', $form_devices);
foreach (dbFetchColumn('SELECT DISTINCT `ipv4_type` FROM `ipv4_addresses`;') as $type)
{
$form_items['types'][$type] = [ 'name' => $config['ip_types'][$type]['name'], 'subtext' => $config['ip_types'][$type]['subtext'] ];
}
$form = array('type' => 'rows',
'space' => '5px',
'submit_by_key' => TRUE,
'url' => 'search/search=ipv4/');
$form['row'][0]['device'] = array(
'type' => 'multiselect',
'name' => 'Device',
'width' => '100%',
'value' => $vars['device'],
'groups' => array('', 'UP', 'DOWN', 'DISABLED'), // This is optgroup order for values (if required)
'values' => $form_items['devices']);
$form['row'][0]['interface'] = array(
'type' => 'select',
'name' => 'Interface',
'width' => '100%',
'value' => $vars['interface'],
'values' => array('' => 'All Interfaces', 'Lo' => 'Loopbacks', 'Vlan' => 'Vlans'));
$form['row'][0]['type'] = array(
'type' => 'multiselect',
'name' => 'IP Type',
'width' => '100%',
'value' => $vars['type'],
'values' => $form_items['types']);
$form['row'][0]['network'] = array(
'type' => 'text',
'name' => 'IP Network',
'width' => '100%',
'placeholder' => TRUE,
'ajax' => TRUE,
'ajax_vars' => array('field' => 'ipv4_network'),
'value' => $vars['network']);
$form['row'][0]['address'] = array(
'type' => 'text',
'name' => 'IP Address',
'width' => '100%',
'grid' => 3,
//'div_class' => 'col-lg-3 col-md-3 col-sm-3',
'placeholder' => TRUE,
'value' => $vars['address']);
// search button
$form['row'][0]['search'] = array(
'type' => 'submit',
'grid' => 1,
//'div_class' => 'col-lg-3 col-md-3 col-sm-3',
//'name' => 'Search',
//'icon' => 'icon-search',
'value' => 'ipv4',
'right' => TRUE);
print_form($form);
unset($form, $form_items, $form_devices);
// Pagination
$vars['pagination'] = TRUE;
// Print addresses
print_addresses($vars);
register_html_title("IPv4 Addresses");
?>
</div> <!-- col-md-12 -->
</div> <!-- row -->
<?php
// EOF

View File

@ -0,0 +1,95 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage webui
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
?>
<div class="row">
<div class="col-md-12">
<?php
$form_devices = dbFetchColumn('SELECT DISTINCT `device_id` FROM `ipv6_addresses`;');
$form_items['devices'] = generate_form_values('device', $form_devices);
foreach (dbFetchColumn('SELECT DISTINCT `ipv6_type` FROM `ipv6_addresses`;') as $type)
{
$form_items['types'][$type] = [ 'name' => $config['ip_types'][$type]['name'], 'subtext' => $config['ip_types'][$type]['subtext'] ];
}
$form = array('type' => 'rows',
'space' => '5px',
'submit_by_key' => TRUE,
'url' => 'search/search=ipv6/');
$form['row'][0]['device'] = array(
'type' => 'multiselect',
'name' => 'Device',
'width' => '100%',
'value' => $vars['device'],
'groups' => array('', 'UP', 'DOWN', 'DISABLED'), // This is optgroup order for values (if required)
'values' => $form_items['devices']);
$form['row'][0]['interface'] = array(
'type' => 'select',
'name' => 'Interface',
'width' => '100%',
'value' => $vars['interface'],
'values' => array('' => 'All Interfaces', 'Lo' => 'Loopbacks', 'Vlan' => 'Vlans'));
$form['row'][0]['type'] = array(
'type' => 'multiselect',
'name' => 'IP Type',
'width' => '100%',
'value' => $vars['type'],
'values' => $form_items['types']);
$form['row'][0]['network'] = array(
'type' => 'text',
'name' => 'IP Network',
'width' => '100%',
'placeholder' => TRUE,
'ajax' => TRUE,
'ajax_vars' => array('field' => 'ipv6_network'),
'value' => $vars['network']);
$form['row'][0]['address'] = array(
'type' => 'text',
'name' => 'IP Address',
'width' => '100%',
'grid' => 3,
//'div_class' => 'col-lg-3 col-md-3 col-sm-3',
'placeholder' => TRUE,
'value' => $vars['address']);
// search button
$form['row'][0]['search'] = array(
'type' => 'submit',
'grid' => 1,
//'div_class' => 'col-lg-3 col-md-3 col-sm-3',
//'name' => 'Search',
//'icon' => 'icon-search',
'value' => 'ipv6',
'right' => TRUE);
print_form($form);
unset($form, $form_items, $form_devices);
// Pagination
$vars['pagination'] = TRUE;
// Print addresses
print_addresses($vars);
register_html_title("IPv6 Addresses");
?>
</div> <!-- col-md-12 -->
</div> <!-- row -->
<?php
// EOF

View File

@ -0,0 +1,77 @@
<?php
/**
* Observium
*
* This file is part of Observium.
*
* @package observium
* @subpackage webui
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
*
*/
?>
<div class="row">
<div class="col-md-12">
<?php
$form_items['devices'] = generate_form_values('device');
$form = array('type' => 'rows',
'space' => '5px',
'submit_by_key' => TRUE,
'url' => 'search/search=mac/');
$form['row'][0]['device_id'] = array(
'type' => 'multiselect',
'name' => 'Device',
'width' => '100%',
'value' => $vars['device_id'],
'groups' => array('', 'UP', 'DOWN', 'DISABLED'), // This is optgroup order for values (if required)
'values' => $form_items['devices']);
$form['row'][0]['interface'] = array(
'type' => 'select',
'name' => 'Interfaces',
'width' => '100%',
'value' => $vars['interface'],
'values' => array('' => 'All Interfaces', 'Loopback' => 'Loopbacks', 'Vlan' => 'Vlans'));
$form['row'][0]['address'] = array(
'type' => 'text',
'name' => 'MAC Address',
'width' => '100%',
'grid' => 4,
'placeholder' => TRUE,
'submit_by_key' => TRUE,
'value' => escape_html($vars['address']));
// search button
$form['row'][0]['search'] = array(
'type' => 'submit',
'grid' => 4,
//'name' => 'Search',
//'icon' => 'icon-search',
'value' => 'mac',
'right' => TRUE);
print_form($form);
unset($form, $form_items);
// Pagination
$vars['pagination'] = TRUE;
// Print MAC addresses
print_mac_addresses($vars);
register_html_title('MAC addresses');
?>
</div> <!-- col-md-12 -->
</div> <!-- row -->
<?php
// EOF