mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-03 08:01:38 +02:00
syntaxer run
git-svn-id: http://www.observium.org/svn/observer/trunk@2970 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
if ($_SESSION['userlevel'] < 10)
|
||||
{
|
||||
include("includes/error-no-perm.inc.php");
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,17 +63,13 @@ if (bill_permitted($bill_id))
|
||||
WHERE B.bill_id = ? AND P.interface_id = B.port_id
|
||||
AND D.device_id = P.device_id", array($bill_id));
|
||||
|
||||
|
||||
|
||||
echo("<font face=\"Verdana, Arial, Sans-Serif\"><h2>
|
||||
Bill : " . $bill_data['bill_name'] . "</h2>");
|
||||
|
||||
|
||||
print_optionbar_start();
|
||||
|
||||
echo("<span style='font-weight: bold;'>Bill</span> » ");
|
||||
|
||||
|
||||
if (!$vars['view']) { $vars['view'] = "quick"; }
|
||||
|
||||
if ($vars['view'] == "quick") { echo("<span class='pagemenu-selected'>"); }
|
||||
@@ -118,7 +114,6 @@ if (bill_permitted($bill_id))
|
||||
|
||||
echo('<div style="font-weight: bold; float: right;"><a href="'.generate_url(array('page' => "bills")).'/"><img align=absmiddle src="/images/16/arrow_left.png"> Back to Bills</a></div>');
|
||||
|
||||
|
||||
print_optionbar_end();
|
||||
|
||||
if ($vars['view'] == "edit" && $_SESSION['userlevel'] == "10")
|
||||
|
||||
@@ -49,10 +49,12 @@ if ($_POST['action'] == "delete_bill_port")
|
||||
}
|
||||
if ($_POST['action'] == "update_bill")
|
||||
{
|
||||
|
||||
if(isset($_POST['bill_quota']) or isset($_POST['bill_cdr'])) {
|
||||
if ($_POST['bill_type'] == "quota") {
|
||||
if (isset($_POST['bill_quota_type'])) {
|
||||
if (isset($_POST['bill_quota']) or isset($_POST['bill_cdr']))
|
||||
{
|
||||
if ($_POST['bill_type'] == "quota")
|
||||
{
|
||||
if (isset($_POST['bill_quota_type']))
|
||||
{
|
||||
if ($_POST['bill_quota_type'] == "MB") { $multiplier = 1 * $config['billing']['base']; }
|
||||
if ($_POST['bill_quota_type'] == "GB") { $multiplier = 1 * $config['billing']['base'] * $config['billing']['base']; }
|
||||
if ($_POST['bill_quota_type'] == "TB") { $multiplier = 1 * $config['billing']['base'] * $config['billing']['base'] * $config['billing']['base']; }
|
||||
@@ -60,8 +62,10 @@ if ($_POST['action'] == "update_bill")
|
||||
$bill_cdr = 0;
|
||||
}
|
||||
}
|
||||
if ($_POST['bill_type'] == "cdr") {
|
||||
if (isset($_POST['bill_cdr_type'])) {
|
||||
if ($_POST['bill_type'] == "cdr")
|
||||
{
|
||||
if (isset($_POST['bill_cdr_type']))
|
||||
{
|
||||
if ($_POST['bill_cdr_type'] == "Kbps") { $multiplier = 1 * $config['billing']['base']; }
|
||||
if ($_POST['bill_cdr_type'] == "Mbps") { $multiplier = 1 * $config['billing']['base'] * $config['billing']['base']; }
|
||||
if ($_POST['bill_cdr_type'] == "Gbps") { $multiplier = 1 * $config['billing']['base'] * $config['billing']['base'] * $config['billing']['base']; }
|
||||
|
||||
@@ -49,9 +49,9 @@ if ($bill_data['bill_type'] == "cdr") {
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="bill_type"><strong>Billing Type</strong></label>
|
||||
<div class="controls">
|
||||
<input type="radio" name="bill_type" value="cdr" onchange="javascript: billType();" <?php if($bill_data['bill_type'] == "cdr") { echo('checked '); } ?>/> CDR 95th
|
||||
<input type="radio" name="bill_type" value="quota" onchange="javascript: billType();" <?php if($bill_data['bill_type'] == "quota") { echo('checked '); } ?>/> Quota
|
||||
<div id="cdrDiv"<?php if($bill_data['bill_type'] == "quota") { echo(' style="display: none"'); } ?>>
|
||||
<input type="radio" name="bill_type" value="cdr" onchange="javascript: billType();" <?php if ($bill_data['bill_type'] == "cdr") { echo('checked '); } ?>/> CDR 95th
|
||||
<input type="radio" name="bill_type" value="quota" onchange="javascript: billType();" <?php if ($bill_data['bill_type'] == "quota") { echo('checked '); } ?>/> Quota
|
||||
<div id="cdrDiv"<?php if ($bill_data['bill_type'] == "quota") { echo(' style="display: none"'); } ?>>
|
||||
<input class="span1" type="text" name="bill_cdr" value="<?php echo $cdr['data']; ?>">
|
||||
<select name="bill_cdr_type" style="width: 233px;">
|
||||
<option value="Kbps"<?php echo $cdr['select_kbps']; ?>>Kilobits per second (Kbps)</option>
|
||||
@@ -59,7 +59,7 @@ if ($bill_data['bill_type'] == "cdr") {
|
||||
<option value="Gbps"<?php echo $cdr['select_gbps']; ?>>Gigabits per second (Gbps)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="quotaDiv"<?php if($bill_data['bill_type'] == "cdr") { echo(' style="display: none"'); } ?>>
|
||||
<div id="quotaDiv"<?php if ($bill_data['bill_type'] == "cdr") { echo(' style="display: none"'); } ?>>
|
||||
<input class="span1" type="text" name="bill_quota" value="<?php echo $quota['data']; ?>">
|
||||
<select name="bill_quota_type" style="width: 233px;">
|
||||
<option value="MB"<?php echo $quota['select_mb']; ?>>Megabytes (MB)</option>
|
||||
@@ -160,7 +160,6 @@ if (is_array($ports))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
@@ -15,9 +15,8 @@
|
||||
$portret = $pdf->serializeTCPDFtagParameters(array('P'));
|
||||
$landscape = $pdf->serializeTCPDFtagParameters(array('L'));
|
||||
|
||||
|
||||
// History Database content
|
||||
foreach(dbFetchRows("SELECT * FROM `bill_hist` WHERE `bill_id`= ? AND `id` = ? ORDER BY `bill_datefrom` DESC LIMIT 1", array($bill_id, $history_id)) as $row) {
|
||||
foreach (dbFetchRows("SELECT * FROM `bill_hist` WHERE `bill_id`= ? AND `id` = ? ORDER BY `bill_datefrom` DESC LIMIT 1", array($bill_id, $history_id)) as $row) {
|
||||
if (bill_permitted($row['bill_id'])) {
|
||||
$history['datefrom'] = strftime("%A, %e %B %Y @ %T", strtotime($row['bill_datefrom']));
|
||||
$history['dateto'] = strftime("%A, %e %B %Y @ %T", strtotime($row['bill_dateto']));
|
||||
@@ -45,9 +44,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Customer Database content
|
||||
foreach(dbFetchRows("SELECT bill_name, bill_custid, bill_ref, bill_notes FROM `bills` WHERE `bill_id` = ? ORDER BY `bill_id` LIMIT 1", array($bill_id)) as $row) {
|
||||
foreach (dbFetchRows("SELECT bill_name, bill_custid, bill_ref, bill_notes FROM `bills` WHERE `bill_id` = ? ORDER BY `bill_id` LIMIT 1", array($bill_id)) as $row) {
|
||||
if (bill_permitted($bill_id)) {
|
||||
$customer['id'] = $row['bill_custid'];
|
||||
$customer['name'] = $row['bill_name'];
|
||||
@@ -56,13 +54,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Billing types
|
||||
$bill_type['95per'] = (($history['type'] != "CDR") ? "[ ] 95 Percentile" : "<b>[X] 95 Percentile</b>");
|
||||
$bill_type['quota'] = (($history['type'] != "Quota") ? "[ ] Quota" : "<b>[X] Quota</b>");
|
||||
$bill_type['average'] = (($history['type'] != "Ave") ? "[ ] Average" : "<b>[X] Average</b>");
|
||||
|
||||
|
||||
// QR Tag
|
||||
$http = ((empty($_SERVER['HTTPS'])) ? "http" : "https" );
|
||||
$url['his'] = $http."://".$_SERVER['HTTP_HOST']."/bill/bill_id=".$bill_id."/view=history/detail=".$history_id."/";
|
||||
@@ -73,22 +69,22 @@
|
||||
$qrStyle = array('border' => false, 'vpadding' => auto, 'hpadding' => auto, 'fgcolor' => array(0, 0, 0), 'bgcolor' => false, 'module_width' => 1, 'module_height' => 1);
|
||||
$qrTag = $pdf->serializeTCPDFtagParameters(array($qrInfo, 'QRCODE,H', 162, 68, 50, 50, $qrStyle, 'N'));
|
||||
|
||||
|
||||
// Include css
|
||||
include_once("pdf_css.inc.php");
|
||||
$html .= $css;
|
||||
|
||||
include_once("pdf_css.inc.php");
|
||||
|
||||
$html .= $css;
|
||||
|
||||
// GB Convert (1000 vs 1024)
|
||||
function gbConvert($data) {
|
||||
global $config;
|
||||
|
||||
$count = strlen($data);
|
||||
$div = floor($count / 4);
|
||||
$res = round($data / pow(1000, $div) * pow($config['billing']['base'], $div));
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
// Generate graphs
|
||||
function genGraphs($bill_id, $imgtype, $from, $to, $bittype = "Quota") {
|
||||
$http = ((empty($_SERVER['HTTPS'])) ? "http" : "https" );
|
||||
@@ -112,7 +108,6 @@
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
// Device Information
|
||||
function listBillPorts($bill_id) {
|
||||
$res = "";
|
||||
@@ -125,7 +120,7 @@
|
||||
//$res .= " <th>Description</th>";
|
||||
//$res .= " <th>Notes</th>";
|
||||
$res .= " </tr>";
|
||||
foreach(dbFetchRows("SELECT * FROM `bill_ports` as b, `ports` as p, `devices` as d WHERE b.bill_id = ? AND p.interface_id = b.port_id AND d.device_id = p.device_id", array($bill_id)) as $row) {
|
||||
foreach (dbFetchRows("SELECT * FROM `bill_ports` as b, `ports` as p, `devices` as d WHERE b.bill_id = ? AND p.interface_id = b.port_id AND d.device_id = p.device_id", array($bill_id)) as $row) {
|
||||
if (bill_permitted($bill_id)) {
|
||||
$device['name'] = $row['sysName'];
|
||||
//$device['port'] = $row['ifName']." (".$row['ifDescr'].")";
|
||||
@@ -148,10 +143,10 @@
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
// Bitrate Graph overview
|
||||
function graphOverviewBitrate($bill_id, $history) {
|
||||
global $pdf;
|
||||
|
||||
$img['bitrate'] = genGraphs($bill_id, "bitrate", $history['timestampfrom'], $history['timestampto'], $history['type']);
|
||||
$bitrate = $pdf->serializeTCPDFtagParameters(array($img['bitrate'], 10, 44, 280, '', 'PNG', '', 'T'));
|
||||
$res = "";
|
||||
@@ -159,10 +154,10 @@
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
// Transfer Graph overview
|
||||
function graphOverviewTransfer($bill_id, $history) {
|
||||
global $pdf;
|
||||
|
||||
$img['bw_day'] = genGraphs($bill_id, "day", $history['timestampfrom'], $history['timestampto']);
|
||||
$img['bw_hour'] = genGraphs($bill_id, "hour", $history['timestampfrom'], $history['timestampto']);
|
||||
$bw_day = $pdf->serializeTCPDFtagParameters(array($img['bw_day'], 10, 44, 280, '', 'PNG', '', 'T'));
|
||||
@@ -173,10 +168,10 @@
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
// Transfer overview
|
||||
function transferOverview($bill_id, $history) {
|
||||
global $list_colour_a, $list_colour_b, $config['billing']['base'];
|
||||
|
||||
$i = 0;
|
||||
$tot = array();
|
||||
$traf = array();
|
||||
@@ -191,7 +186,7 @@
|
||||
$res .= " <th class=\"outbound\">Outbound</th>";
|
||||
$res .= " <th class=\"total\">Total</th>";
|
||||
$res .= " </tr>";
|
||||
foreach(dbFetch("SELECT DISTINCT UNIX_TIMESTAMP(timestamp) as timestamp, SUM(delta) as traf_total, SUM(in_delta) as traf_in, SUM(out_delta) as traf_out FROM bill_data WHERE `bill_id`= ? AND `timestamp` >= FROM_UNIXTIME(?) AND `timestamp` <= FROM_UNIXTIME(?) GROUP BY DATE(timestamp) ORDER BY timestamp ASC", array($bill_id, $start, $end)) as $data) {
|
||||
foreach (dbFetch("SELECT DISTINCT UNIX_TIMESTAMP(timestamp) as timestamp, SUM(delta) as traf_total, SUM(in_delta) as traf_in, SUM(out_delta) as traf_out FROM bill_data WHERE `bill_id`= ? AND `timestamp` >= FROM_UNIXTIME(?) AND `timestamp` <= FROM_UNIXTIME(?) GROUP BY DATE(timestamp) ORDER BY timestamp ASC", array($bill_id, $start, $end)) as $data) {
|
||||
$date = strftime("%A, %e %B %Y", $data['timestamp']);
|
||||
$tot['in'] += gbConvert($data['traf_in']);
|
||||
$tot['out'] += gbConvert($data['traf_out']);
|
||||
@@ -221,7 +216,6 @@
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
// Html template
|
||||
$logo = $pdf->serializeTCPDFtagParameters(array('images/observium-logo.png', 15, 18, 100, '', '', 'www.observium.org', 'T'));
|
||||
$html .= "<tcpdf method=\"Image\" params=\"".$logo."\" />";
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
<form name="form1" action="" method="post" class="form-horizontal">
|
||||
<link rel="stylesheet" href="<?php echo $config['base_url']; ?>/css/bootstrap.min.css">
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<?php
|
||||
|
||||
|
||||
if ($_POST['addbill'] == "yes")
|
||||
{
|
||||
$updated = '1';
|
||||
|
||||
if(isset($_POST['bill_quota']) or isset($_POST['bill_cdr'])) {
|
||||
if (isset($_POST['bill_quota']) or isset($_POST['bill_cdr'])) {
|
||||
if ($_POST['bill_type'] == "quota") {
|
||||
if (isset($_POST['bill_quota_type'])) {
|
||||
if ($_POST['bill_quota_type'] == "MB") { $multiplier = 1 * $config['billing']['base']; }
|
||||
@@ -42,7 +41,6 @@ if ($_POST['addbill'] == "yes")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$pagetitle[] = "Billing";
|
||||
|
||||
echo("<meta http-equiv='refresh' content='10000'>");
|
||||
@@ -54,7 +52,7 @@ if ($_GET['opta'] == "history")
|
||||
}
|
||||
elseif ($_GET['opta'] == "add")
|
||||
{
|
||||
if(is_numeric($vars['port']))
|
||||
if (is_numeric($vars['port']))
|
||||
{
|
||||
$port = dbFetchRow("SELECT * FROM `ports` AS P, `devices` AS D WHERE `interface_id` = ? AND D.device_id = P.device_id", array($vars['port']));
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
if ($_SESSION['userlevel'] < 10)
|
||||
{
|
||||
include("includes/error-no-perm.inc.php");
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
|
||||
echo('<table style="margin: 0px 7px 7px 7px;" cellspacing="0" class="devicetable" width="99%">');
|
||||
#include("includes/hostbox.inc.php");
|
||||
include("includes/device-header.inc.php");
|
||||
|
||||
echo('</table>');
|
||||
|
||||
echo('<div class="tabBox">');
|
||||
@@ -155,13 +156,13 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
|
||||
|
||||
### $loadbalancer_tabs is used in device/loadbalancer/ to build the submenu. we do it here to save queries
|
||||
|
||||
if($device['os'] == "netscaler") /// Netscaler
|
||||
if ($device['os'] == "netscaler") /// Netscaler
|
||||
{
|
||||
$device_loadbalancer_count['netscaler_vsvr'] = dbFetchCell("SELECT COUNT(*) FROM `netscaler_vservers` WHERE `device_id` = ?", array($device['device_id']));
|
||||
if ($device_loadbalancer_count['netscaler_vsvr']) { $loadbalancer_tabs[] = 'netscaler_vsvr'; }
|
||||
}
|
||||
|
||||
if($device['os'] == "acsw") /// Cisco ACE
|
||||
if ($device['os'] == "acsw") /// Cisco ACE
|
||||
{
|
||||
$device_loadbalancer_count['loadbalancer_vservers'] = dbFetchCell("SELECT COUNT(*) FROM `loadbalancer_vservers` WHERE `device_id` = ?", array($device['device_id']));
|
||||
if ($device_loadbalancer_count['loadbalancer_vservers']) { $loadbalancer_tabs[] = 'loadbalancer_vservers'; }
|
||||
|
||||
@@ -17,7 +17,9 @@ foreach ($graphs as $key => $text)
|
||||
|
||||
echo('<h3>'.$text.'</h3>');
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo("</td></tr>");
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ foreach ($graphs as $key => $text)
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo("</td></tr>");
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ foreach ($graphs as $key => $text)
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo("</td></tr>");
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,9 @@ foreach ($graphs as $key => $text) {
|
||||
$graph_array['type'] = "application_".$key;
|
||||
echo('<h3>'.$text.'</h3>');
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo("</td></tr>");
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,9 @@ foreach ($graphs as $key => $text) {
|
||||
$graph_array['type'] = "application_".$key;
|
||||
echo('<h3>'.$text.'</h3>');
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo("</td></tr>");
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,9 @@ if (isset($total) && $total == true)
|
||||
$graph_array['type'] = "application_".$key;
|
||||
echo('<h3>'.$text.'</h3>');
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo("</td></tr>");
|
||||
}
|
||||
}
|
||||
@@ -64,7 +66,9 @@ foreach ($files as $id => $file)
|
||||
$graph_array['hostname'] = $hostname;
|
||||
echo('<h3>'.$text.'</h3>');
|
||||
echo("<tr bgcolor='$row_colour'><td colspan=5>");
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo("</td></tr>");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ foreach ($config['graph_types']['device'] as $graph => $entry)
|
||||
{
|
||||
$graph_title = $config['graph_types']['device'][$graph]['descr'];
|
||||
$graph_type = "device_" . $graph;
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ucd_cpu.rrd"))
|
||||
{
|
||||
$graph_title = "Processor Utilisation";
|
||||
$graph_type = "device_cpu";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ if ($device['os'] == "fortigate" || $device['os_group'] == "fortigate")
|
||||
{
|
||||
$graph_title = "Firewall Sessions";
|
||||
$graph_type = "fortigate_sessions";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/hrSystem.rrd"))
|
||||
{
|
||||
$graph_title = "Running Processes";
|
||||
$graph_type = "device_hrprocesses";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/hrSystem.rrd"))
|
||||
{
|
||||
$graph_title = "Users Logged On";
|
||||
$graph_type = "device_hrusers";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
<?
|
||||
<?php
|
||||
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ipSystemStats-ipv6.rrd")) {
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ipSystemStats-ipv6.rrd"))
|
||||
{
|
||||
$graph_title = "IPv6 IP Packet Statistics";
|
||||
$graph_type = "device_ipSystemStats_v6";
|
||||
include ("includes/print-device-graph.php");
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
|
||||
$graph_title = "IPv6 IP Fragmentation Statistics";
|
||||
$graph_type = "device_ipSystemStats_v6_frag";
|
||||
include ("includes/print-device-graph.php");
|
||||
|
||||
}
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ipSystemStats-ipv4.rrd")) {
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ipSystemStats-ipv4.rrd"))
|
||||
{
|
||||
$graph_title = "IPv4 IP Packet Statistics";
|
||||
$graph_type = "device_ipSystemStats_v4";
|
||||
include ("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -4,6 +4,7 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ucd_mem.rrd"))
|
||||
{
|
||||
$graph_title = "Memory Utilisation";
|
||||
$graph_type = "device_memory";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,12 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ipSystemStats-ipv6
|
||||
{
|
||||
$graph_title = "IPv6 IP Packet Statistics";
|
||||
$graph_type = "device_ipSystemStats_v6";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
|
||||
$graph_title = "IPv6 IP Fragmentation Statistics";
|
||||
$graph_type = "device_ipSystemStats_v6_frag";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
@@ -15,6 +17,7 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ipSystemStats-ipv4
|
||||
{
|
||||
$graph_title = "IPv4 IP Packet Statistics";
|
||||
$graph_type = "device_ipSystemStats_v4";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
@@ -22,10 +25,12 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-ip.rrd"))
|
||||
{
|
||||
$graph_title = "IP Statistics";
|
||||
$graph_type = "device_ip";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
|
||||
$graph_title = "IP Fragmented Statistics";
|
||||
$graph_type = "device_ip_fragmented";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
@@ -33,6 +38,7 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-tcp.rrd")
|
||||
{
|
||||
$graph_title = "TCP Statistics";
|
||||
$graph_type = "device_tcp";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
@@ -40,6 +46,7 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-udp.rrd")
|
||||
{
|
||||
$graph_title = "UDP Statistics";
|
||||
$graph_type = "device_udp";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
@@ -47,10 +54,12 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-snmp.rrd"
|
||||
{
|
||||
$graph_title = "SNMP Packets Statistics";
|
||||
$graph_type = "device_snmp_packets";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
|
||||
$graph_title = "SNMP Message Type Statistics";
|
||||
$graph_type = "device_snmp_statistics";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
@@ -58,10 +67,12 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-icmp.rrd"
|
||||
{
|
||||
$graph_title = "ICMP Statistics";
|
||||
$graph_type = "device_icmp";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
|
||||
$graph_title = "ICMP Informational Statistics";
|
||||
$graph_type = "device_icmp_informational";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-icmp.rrd"
|
||||
{
|
||||
$graph_title = "ICMP Informational Statistics";
|
||||
$graph_type = "device_icmp_informational";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-icmp.rrd"
|
||||
{
|
||||
$graph_title = "ICMP Statistics";
|
||||
$graph_type = "device_icmp";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,12 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-ip.rrd"))
|
||||
{
|
||||
$graph_title = "IP Statistics";
|
||||
$graph_type = "device_ip";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
|
||||
$graph_title = "IP Fragmented Statistics";
|
||||
$graph_type = "device_ip_fragmented";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,12 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-snmp.rrd"
|
||||
{
|
||||
$graph_title = "SNMP Packets Statistics";
|
||||
$graph_type = "device_snmp_packets";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
|
||||
$graph_title = "SNMP Message Type Statistics";
|
||||
$graph_type = "device_snmp_statistics";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-tcp.rrd")
|
||||
{
|
||||
$graph_title = "TCP Statistics";
|
||||
$graph_type = "device_tcp";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/netstats-udp.rrd")
|
||||
{
|
||||
$graph_title = "UDP Statistics";
|
||||
$graph_type = "device_udp";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ if ($device['os'] == "netscreen" || $device['os_group'] == "netscreen")
|
||||
{
|
||||
$graph_title = "Firewall Sessions";
|
||||
$graph_type = "netscreen_sessions";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ if ($device['os'] == "screenos" && is_file($config['rrd_dir'] . "/" . $device['h
|
||||
{
|
||||
$graph_title = "Firewall Sessions";
|
||||
$graph_type = "screenos_sessions";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ if (is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/wificlients-radio1
|
||||
{
|
||||
$graph_title = "Wireless clients";
|
||||
$graph_type = "device_wificlients";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,7 @@ if (is_file("pages/device/health/".mres($vars['metric']).".inc.php"))
|
||||
{
|
||||
$graph_title = $type_text[$type];
|
||||
$graph_type = "device_".$type;
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ if(count($smokeping_files['out'][$device['hostname']]))
|
||||
$sep = "";
|
||||
foreach ($menu_options as $option => $text)
|
||||
{
|
||||
if(!$vars['view']) { $vars['view'] = $option; }
|
||||
if (!$vars['view']) { $vars['view'] = $option; }
|
||||
echo($sep);
|
||||
if ($vars['view'] == $option)
|
||||
{
|
||||
@@ -43,38 +43,41 @@ if($vars['view'] == "incoming")
|
||||
$graph_array['id'] = $device['device_id'];
|
||||
echo('<tr><td>');
|
||||
echo('<h3>Average</h3>');
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo('</td></tr>');
|
||||
|
||||
$graph_array['type'] = "device_smokeping_in_all";
|
||||
$graph_array['legend'] = no;
|
||||
echo('<tr><td>');
|
||||
echo('<h3>Aggregate</h3>');
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo('</td></tr>');
|
||||
|
||||
unset($graph_array['legend']);
|
||||
|
||||
|
||||
ksort($smokeping_files['in'][$device['hostname']]);
|
||||
foreach($smokeping_files['in'][$device['hostname']] AS $src => $host)
|
||||
foreach ($smokeping_files['in'][$device['hostname']] AS $src => $host)
|
||||
{
|
||||
$hostname = str_replace(".rrd", "", $host);
|
||||
$host = device_by_name($src);
|
||||
if(is_numeric($host['device_id']))
|
||||
if (is_numeric($host['device_id']))
|
||||
{
|
||||
echo('<tr><td>');
|
||||
echo('<h3>'.generate_device_link($host).'</h3>');
|
||||
$graph_array['type'] = "smokeping_in";
|
||||
$graph_array['id'] = $device['device_id'];
|
||||
$graph_array['src'] = $host['device_id'];
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo('</td></tr>');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
} elseif ($vars['view'] == "outgoing") {
|
||||
@@ -86,33 +89,38 @@ if($vars['view'] == "incoming")
|
||||
$graph_array['id'] = $device['device_id'];
|
||||
echo('<tr><td>');
|
||||
echo('<h3>Aggregate</h3>');
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo('</td></tr>');
|
||||
|
||||
$graph_array['type'] = "device_smokeping_out_all";
|
||||
$graph_array['legend'] = no;
|
||||
echo('<tr><td>');
|
||||
echo('<h3>Aggregate</h3>');
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
echo('</td></tr>');
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo('</td></tr>');
|
||||
|
||||
unset($graph_array['legend']);
|
||||
|
||||
asort($smokeping_files['out'][$device['hostname']]);
|
||||
foreach($smokeping_files['out'][$device['hostname']] AS $host)
|
||||
foreach ($smokeping_files['out'][$device['hostname']] AS $host)
|
||||
{
|
||||
$hostname = str_replace(".rrd", "", $host);
|
||||
list($hostname) = explode("~", $hostname);
|
||||
$host = device_by_name($hostname);
|
||||
if(is_numeric($host['device_id']))
|
||||
if (is_numeric($host['device_id']))
|
||||
{
|
||||
echo('<tr><td>');
|
||||
echo('<h3>'.generate_device_link($host).'</h3>');
|
||||
$graph_array['type'] = "smokeping_out";
|
||||
$graph_array['id'] = $device['device_id'];
|
||||
$graph_array['dest'] = $host['device_id'];
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo('</td></tr>');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,12 +52,15 @@ if (is_file("pages/device/loadbalancer/".mres($vars['type']).".inc.php"))
|
||||
|
||||
echo('<div style="background-color: '.$row_colour.';">');
|
||||
echo('<div style="padding:4px 0px 0px 8px;"><span class=graphhead>'.$type_text[$type].'</span>');
|
||||
|
||||
include("pages/device/loadbalancer/overview/".mres($type).".inc.php");
|
||||
|
||||
echo('</div>');
|
||||
echo('</div>');
|
||||
} else {
|
||||
$graph_title = $type_text[$type];
|
||||
$graph_type = "device_".$type;
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ $graph_array['id'] = $rserver['rserver_id'];
|
||||
$graph_array['type'] = $graph_type;
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
#include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
echo("
|
||||
|
||||
@@ -28,7 +28,6 @@ $graph_types = array("bits" => "Bits",
|
||||
"pkts" => "Packets",
|
||||
"conns" => "Connections");
|
||||
|
||||
|
||||
foreach ($graph_types as $type => $descr)
|
||||
{
|
||||
echo("$type_sep");
|
||||
|
||||
@@ -22,7 +22,7 @@ foreach (dbFetchRows("SELECT * FROM `netscaler_vservers` WHERE `device_id` = ? A
|
||||
|
||||
if (is_integer($i/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; }
|
||||
|
||||
if($vsvr['vsvr_state'] == "up") { $vsvr_class="green"; } else { $vsvr_class="red"; }
|
||||
if ($vsvr['vsvr_state'] == "up") { $vsvr_class="green"; } else { $vsvr_class="red"; }
|
||||
|
||||
echo("<tr bgcolor='$bg_colour'>");
|
||||
echo('<td width=320 class=list-large><a href="'.generate_url($vars, array('vsvr' => $vsvr['vsvr_id'], 'view' => NULL, 'graph' => NULL)).'">' . $vsvr['vsvr_name'] . '</a></td>');
|
||||
@@ -32,7 +32,7 @@ foreach (dbFetchRows("SELECT * FROM `netscaler_vservers` WHERE `device_id` = ? A
|
||||
echo("<td width=320 class=list-small>" . format_si($vsvr['vsvr_bps_out']*8) . "bps</a></td>");
|
||||
echo("</tr>");
|
||||
|
||||
foreach($graph_types as $graph_type => $graph_text)
|
||||
foreach ($graph_types as $graph_type => $graph_text)
|
||||
{
|
||||
$i++;
|
||||
echo('<tr class="list-bold" bgcolor="'.$bg_colour.'">');
|
||||
@@ -56,7 +56,6 @@ foreach (dbFetchRows("SELECT * FROM `netscaler_vservers` WHERE `device_id` = ? A
|
||||
|
||||
echo("</table></div>");
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
print_optionbar_start();
|
||||
@@ -85,7 +84,6 @@ $graph_types = array("bits" => "Bits",
|
||||
"reqs" => "Requests",
|
||||
"hitmiss" => "Hit/Miss");
|
||||
|
||||
|
||||
foreach ($graph_types as $type => $descr)
|
||||
{
|
||||
echo("$type_sep");
|
||||
@@ -103,7 +101,7 @@ foreach (dbFetchRows("SELECT * FROM `netscaler_vservers` WHERE `device_id` = ? O
|
||||
{
|
||||
if (is_integer($i/2)) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; }
|
||||
|
||||
if($vsvr['vsvr_state'] == "up") { $vsvr_class="green"; } else { $vsvr_class="red"; }
|
||||
if ($vsvr['vsvr_state'] == "up") { $vsvr_class="green"; } else { $vsvr_class="red"; }
|
||||
|
||||
echo("<tr bgcolor='$bg_colour'>");
|
||||
echo('<td width=320 class=list-large><a href="'.generate_url($vars, array('vsvr' => $vsvr['vsvr_id'], 'view' => NULL, 'graph' => NULL)).'">' . $vsvr['vsvr_name'] . '</a></td>');
|
||||
|
||||
@@ -10,6 +10,7 @@ foreach ($datas as $name=>$type)
|
||||
{
|
||||
$graph_title = $name;
|
||||
$graph_type = "device_".$type;
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -22,10 +22,12 @@ echo("<table width=100% cellspacing=0 cellpadding=0><tr><td style='width: 50%; v
|
||||
# echo("<p class=sectionhead>Device Data</p><div style='height: 5px;'></div>");
|
||||
# include("includes/dev-data-" . strtolower($device[os]) . ".inc.php");
|
||||
include("includes/dev-overview-data.inc.php");
|
||||
|
||||
echo("</div>");
|
||||
#}
|
||||
|
||||
include("overview/ports.inc.php");
|
||||
|
||||
#include("overview/current.inc.php");
|
||||
|
||||
if ($services['total'])
|
||||
@@ -81,7 +83,9 @@ echo("<td style='width: 50%; vertical-align: top;'>");
|
||||
include("overview/processors.inc.php");
|
||||
include("overview/mempools.inc.php");
|
||||
include("overview/storage.inc.php");
|
||||
|
||||
if(is_array($entity_state['group']['c6kxbar'])) { include("overview/c6kxbar.inc.php"); }
|
||||
|
||||
include("overview/sensors/temperatures.inc.php");
|
||||
include("overview/sensors/humidity.inc.php");
|
||||
include("overview/sensors/fanspeeds.inc.php");
|
||||
@@ -91,7 +95,6 @@ include("overview/sensors/current.inc.php");
|
||||
include("overview/sensors/power.inc.php");
|
||||
include("overview/sensors/frequencies.inc.php");
|
||||
|
||||
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p style='padding: 0px 5px 5px;' class=sectionhead>");
|
||||
echo('<a class="sectionhead" href="device/device='.$device['device_id'].'/tab=logs/section=eventlog/">');
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<?php
|
||||
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p style='padding: 0px 5px 5px;' class=sectionhead>");
|
||||
echo('<a class="sectionhead" href="device/device='.$device['device_id'].'/tab=health/metric=mempool/">');
|
||||
echo("<img align='absmiddle' src='images/16/arrow_switch.png'> Catalyst 6k Crossbar</a></p>");
|
||||
echo("<table width=100% cellspacing=0 cellpadding=5>");
|
||||
$c6kxbar_rows = '0';
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p style='padding: 0px 5px 5px;' class=sectionhead>");
|
||||
echo('<a class="sectionhead" href="device/device='.$device['device_id'].'/tab=health/metric=mempool/">');
|
||||
echo("<img align='absmiddle' src='images/16/arrow_switch.png'> Catalyst 6k Crossbar</a></p>");
|
||||
echo("<table width=100% cellspacing=0 cellpadding=5>");
|
||||
$c6kxbar_rows = '0';
|
||||
|
||||
foreach($entity_state['group']['c6kxbar'] as $index => $entry)
|
||||
foreach ($entity_state['group']['c6kxbar'] as $index => $entry)
|
||||
{
|
||||
if (is_integer($c6kxbar_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
// fixme i'm not sure if this is the correct way to decide what entphysical index it is. slotnum+1? :>
|
||||
// FIXME i'm not sure if this is the correct way to decide what entphysical index it is. slotnum+1? :>
|
||||
$entity = dbFetchRow("SELECT * FROM entPhysical WHERE device_id = ? AND entPhysicalIndex = ?", array($device['device_id'], $index+1));
|
||||
|
||||
echo("<tr bgcolor=$row_colour>
|
||||
@@ -33,15 +33,14 @@ foreach($entity_state['group']['c6kxbar'] as $index => $entry)
|
||||
echo $entry['']['cc6kxbarModuleModeSwitchingMode'];
|
||||
}
|
||||
|
||||
|
||||
echo("</td>
|
||||
</tr>");
|
||||
|
||||
foreach($entity_state['group']['c6kxbar'][$index] as $subindex => $fabric)
|
||||
foreach ($entity_state['group']['c6kxbar'][$index] as $subindex => $fabric)
|
||||
{
|
||||
if(is_numeric($subindex)) {
|
||||
|
||||
if($fabric['cc6kxbarModuleChannelFabStatus'] == "ok")
|
||||
if (is_numeric($subindex))
|
||||
{
|
||||
if ($fabric['cc6kxbarModuleChannelFabStatus'] == "ok")
|
||||
{
|
||||
$fabric['mode_class'] = "green";
|
||||
} else {
|
||||
@@ -89,15 +88,13 @@ foreach($entity_state['group']['c6kxbar'] as $index => $entry)
|
||||
<td>".print_percentage_bar (125, 20, $percent_in, "Ingress", "ffffff", $background['left'], $percent_in . "%", "ffffff", $background['right'])."</td>
|
||||
<td>".print_percentage_bar (125, 20, $percent_out, "Egress", "ffffff", $background['left'], $percent_out . "%", "ffffff", $background['right'])."</td>
|
||||
</tr>");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$c6kxbar_rows++;
|
||||
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
|
||||
?>
|
||||
|
||||
@@ -8,18 +8,13 @@ foreach (dbFetchRows("SELECT * FROM `packages` WHERE `device_id` = ? ORDER BY `n
|
||||
if (!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
echo("<tr bgcolor=$row_colour>");
|
||||
echo('<td width=200><a href="'. generate_url($vars, array('name' => $entry['name'])).'">'.$entry['name'].'</a></td>');
|
||||
|
||||
echo("<td>".$entry['version']."-".$entry['build']."</td>");
|
||||
|
||||
echo("<td>".$entry['arch']."</td>");
|
||||
echo("<td>".$entry['manager']."</td>");
|
||||
echo("<td>".format_si($entry['size'])."</td>");
|
||||
|
||||
|
||||
echo("</tr>");
|
||||
|
||||
$i++;
|
||||
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
|
||||
@@ -70,7 +70,6 @@ if (dbFetchCell("SELECT COUNT(*) FROM `ports` WHERE `pagpGroupIfIndex` = '".$por
|
||||
if (dbFetchCell("SELECT COUNT(*) FROM `ports_vlans` WHERE `interface_id` = '".$port['interface_id']."' and `device_id` = '".$device['device_id']."'") )
|
||||
{ $menu_options['vlans'] = 'VLANs'; }
|
||||
|
||||
|
||||
$sep = "";
|
||||
foreach ($menu_options as $option => $text)
|
||||
{
|
||||
@@ -149,7 +148,9 @@ if ($_SESSION['userlevel'] == '10')
|
||||
print_optionbar_end();
|
||||
|
||||
echo("<div style='margin: 5px;'>");
|
||||
|
||||
include("pages/device/port/".mres($vars['view']).".inc.php");
|
||||
|
||||
echo("</div>");
|
||||
|
||||
?>
|
||||
|
||||
@@ -5,18 +5,22 @@ if (file_exists($config['rrd_dir'] . "/" . $device['hostname'] . "/port-". $port
|
||||
$iid = $id;
|
||||
echo("<div class=graphhead>ADSL Line Speed</div>");
|
||||
$graph_type = "port_adsl_speed";
|
||||
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
echo("<div class=graphhead>ADSL Line Attenuation</div>");
|
||||
$graph_type = "port_adsl_attenuation";
|
||||
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
echo("<div class=graphhead>ADSL Line SNR Margin</div>");
|
||||
$graph_type = "port_adsl_snr";
|
||||
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
echo("<div class=graphhead>ADSL Output Powers</div>");
|
||||
$graph_type = "port_adsl_power";
|
||||
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -12,5 +12,4 @@ echo('</table>');
|
||||
|
||||
$pagetitle[] = "Events";
|
||||
|
||||
|
||||
?>
|
||||
|
||||
@@ -5,24 +5,29 @@ if (file_exists($config['rrd_dir'] . "/" . $device['hostname'] . "/port-". $port
|
||||
$iid = $id;
|
||||
echo("<div class=graphhead>Interface Traffic</div>");
|
||||
$graph_type = "port_bits";
|
||||
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
echo("<div class=graphhead>Interface Packets</div>");
|
||||
$graph_type = "port_upkts";
|
||||
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
echo("<div class=graphhead>Interface Non Unicast</div>");
|
||||
$graph_type = "port_nupkts";
|
||||
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
echo("<div class=graphhead>Interface Errors</div>");
|
||||
$graph_type = "port_errors";
|
||||
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
if (is_file($config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . $port['ifIndex'] . "-dot3.rrd"))
|
||||
{
|
||||
echo("<div class=graphhead>Ethernet Errors</div>");
|
||||
$graph_type = "port_etherlike";
|
||||
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,7 +183,9 @@ if ($vars['subview'] == "top10")
|
||||
$graph_array['width'] = "216";
|
||||
$graph_array['to'] = $now;
|
||||
echo('<tr bgcolor="'.$bg_colour.'"' . ($bg_image ? ' background="'.$bg_image.'"' : '') . '"><td colspan="7">');
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo("</td></tr>");
|
||||
|
||||
$i++;
|
||||
|
||||
@@ -7,7 +7,7 @@ echo('<table border="0" cellspacing="0" cellpadding="5" width="100%">');
|
||||
echo("<tr><th>VLAN</th><th>Description</th><th>Cost</th><th>Priority</th><th>State</th><th>Other Ports</th></tr>");
|
||||
|
||||
$row=0;
|
||||
foreach($vlans as $vlan)
|
||||
foreach ($vlans as $vlan)
|
||||
{
|
||||
$row++;
|
||||
if (is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
@@ -16,18 +16,18 @@ foreach($vlans as $vlan)
|
||||
echo("<td width=100 class=list-large> Vlan " . $vlan['vlan'] . "</td>");
|
||||
echo("<td width=200 class=box-desc>" . $vlan['vlan_descr'] . "</td>");
|
||||
|
||||
if($vlan['state'] == "blocking") { $class="red"; } elseif ($vlan['state'] == "forwarding" ) { $class="green"; } else { $class = "none"; }
|
||||
if ($vlan['state'] == "blocking") { $class="red"; } elseif ($vlan['state'] == "forwarding" ) { $class="green"; } else { $class = "none"; }
|
||||
|
||||
echo("<td>".$vlan['cost']."</td><td>".$vlan['priority']."</td><td class=$class>".$vlan['state']."</td>");
|
||||
|
||||
$vlan_ports = array();
|
||||
$otherports = dbFetchRows("SELECT * FROM `ports_vlans` AS V, `ports` as P WHERE V.`device_id` = ? AND V.`vlan` = ? AND P.interface_id = V.interface_id", array($device['device_id'], $vlan['vlan']));
|
||||
foreach($otherports as $otherport)
|
||||
foreach ($otherports as $otherport)
|
||||
{
|
||||
$vlan_ports[$otherport[ifIndex]] = $otherport;
|
||||
}
|
||||
$otherports = dbFetchRows("SELECT * FROM ports WHERE `device_id` = ? AND `ifVlan` = ?", array($device['device_id'], $vlan['vlan']));
|
||||
foreach($otherports as $otherport)
|
||||
foreach ($otherports as $otherport)
|
||||
{
|
||||
$vlan_ports[$otherport[ifIndex]] = array_merge($otherport, array('untagged' => '1'));
|
||||
}
|
||||
@@ -35,10 +35,10 @@ foreach($vlans as $vlan)
|
||||
|
||||
echo("<td>");
|
||||
$vsep='';
|
||||
foreach($vlan_ports as $otherport)
|
||||
foreach ($vlan_ports as $otherport)
|
||||
{
|
||||
echo($vsep.generate_port_link($otherport, makeshortif($otherport['ifDescr'])));
|
||||
if($otherport['untagged']) { echo("(U)"); }
|
||||
if ($otherport['untagged']) { echo("(U)"); }
|
||||
$vsep=", ";
|
||||
}
|
||||
echo("</td>");
|
||||
|
||||
@@ -108,6 +108,7 @@ if ($vars['view'] == 'minigraphs')
|
||||
foreach ($ports as $port)
|
||||
{
|
||||
include("includes/print-interface.inc.php");
|
||||
|
||||
$i++;
|
||||
}
|
||||
echo("</table></div>");
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
foreach ($ports as $port)
|
||||
{
|
||||
include("includes/print-interface-adsl.inc.php");
|
||||
|
||||
$i++;
|
||||
}
|
||||
echo("</table></div>");
|
||||
|
||||
@@ -60,12 +60,15 @@ if (is_file("pages/device/routing/".mres($vars['proto']).".inc.php"))
|
||||
|
||||
echo('<div style="background-color: '.$row_colour.';">');
|
||||
echo('<div style="padding:4px 0px 0px 8px;"><span class=graphhead>'.$type_text[$type].'</span>');
|
||||
|
||||
include("pages/device/routing/overview/".mres($type).".inc.php");
|
||||
|
||||
echo('</div>');
|
||||
echo('</div>');
|
||||
} else {
|
||||
$graph_title = $type_text[$type];
|
||||
$graph_type = "device_".$type;
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,9 @@ foreach (dbFetchRows("SELECT * FROM `bgpPeers` WHERE `device_id` = ? ORDER BY `b
|
||||
$graph_array['width'] = "216";
|
||||
$graph_array['to'] = $now;
|
||||
echo('<tr bgcolor="'.$bg_colour.'"' . ($bg_image ? ' background="'.$bg_image.'"' : '') . '"><td colspan="7">');
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo("</td></tr>");
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ $i = "0";
|
||||
foreach (dbFetchRows("SELECT * FROM `vrfs` WHERE `device_id` = ? ORDER BY `vrf_name`", array($device['device_id'])) as $vrf)
|
||||
{
|
||||
include("includes/print-vrf.inc.php");
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
$graph_title = "Toner";
|
||||
$graph_type = "device_toner";
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
|
||||
$pagetitle[] = "Toner";
|
||||
|
||||
@@ -63,6 +63,7 @@ $i = "1";
|
||||
foreach (dbFetchRows("SELECT * FROM `vlans` WHERE `device_id` = ? ORDER BY 'vlan_vlan'", array($device['device_id'])) as $vlan)
|
||||
{
|
||||
include("includes/print-vlan.inc.php");
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ $i = "1";
|
||||
foreach (dbFetchRows("SELECT * FROM vminfo WHERE device_id = ? ORDER BY vmwVmDisplayName", array($device['device_id'])) as $vm)
|
||||
{
|
||||
include("includes/print-vm.inc.php");
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,6 +111,7 @@ if ($config['enable_syslog'])
|
||||
while ($entry = mysql_fetch_assoc($query))
|
||||
{
|
||||
$entry = array_merge($entry, device_by_id_cache($entry['device_id']));
|
||||
|
||||
include("includes/print-syslog.inc.php");
|
||||
}
|
||||
echo("</table>");
|
||||
|
||||
@@ -165,6 +165,7 @@ echo("<table cellspacing=0 cellpadding=2 width=100%>");
|
||||
while ($entry = mysql_fetch_array($query))
|
||||
{
|
||||
$entry = array_merge($entry, device_by_id_cache($entry['device_id']));
|
||||
|
||||
include("includes/print-syslog.inc.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ if (!$auth)
|
||||
toDateTextBox.val(dateText);
|
||||
}
|
||||
},
|
||||
onSelect: function (selectedDateTime){
|
||||
onSelect: function (selectedDateTime) {
|
||||
var toDateTextBox = $('#dtpickerto');
|
||||
var toValue = toDateTextBox.val();
|
||||
var start = $(this).datetimepicker('getDate');
|
||||
@@ -105,7 +105,7 @@ if (!$auth)
|
||||
startDateTextBox.val(dateText);
|
||||
}
|
||||
},
|
||||
onSelect: function (selectedDateTime){
|
||||
onSelect: function (selectedDateTime) {
|
||||
var fromDateTextBox = $('#dtpickerfrom');
|
||||
var fromValue = fromDateTextBox.val();
|
||||
var end = $(this).datetimepicker('getDate');
|
||||
@@ -116,7 +116,7 @@ if (!$auth)
|
||||
});
|
||||
});
|
||||
|
||||
function submitCustomRange(frmdata){
|
||||
function submitCustomRange(frmdata) {
|
||||
var reto = /to=([0-9])+/g;
|
||||
var refrom = /from=([0-9])+/g;
|
||||
var tsto = new Date(frmdata.dtpickerto.value.replace(' ','T'));
|
||||
@@ -216,7 +216,7 @@ if (!$auth)
|
||||
echo(generate_graph_tag($graph_array));
|
||||
echo("</div>");
|
||||
|
||||
if(isset($config['graph_descr'][$vars['type']]))
|
||||
if (isset($config['graph_descr'][$vars['type']]))
|
||||
{
|
||||
|
||||
print_optionbar_start();
|
||||
@@ -229,10 +229,11 @@ if (!$auth)
|
||||
print_optionbar_end();
|
||||
}
|
||||
|
||||
if($vars['showcommand'])
|
||||
if ($vars['showcommand'])
|
||||
{
|
||||
$_GET = $graph_array;
|
||||
$command_only = 1;
|
||||
|
||||
include("includes/graphs/graph.inc.php");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,9 @@ if ($if_list)
|
||||
echo("<tr bgcolor='$bg'><td>");
|
||||
$graph_type = "multiport_bits_separate";
|
||||
$port['interface_id'] = $if_list;
|
||||
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
|
||||
echo("</td></tr>");
|
||||
|
||||
foreach ($ports as $port)
|
||||
@@ -59,6 +61,7 @@ if ($if_list)
|
||||
if (file_exists($config['rrd_dir'] . "/" . $port['hostname'] . "/port-" . $port['ifIndex'] . ".rrd"))
|
||||
{
|
||||
$graph_type = "port_bits";
|
||||
|
||||
include("includes/print-interface-graphs.inc.php");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
|
||||
<table cellpadding=3 cellspacing=0 class="devicetable sortable" width=100%>
|
||||
<table cellpadding="3" cellspacing="0" class="devicetable sortable" width="100%">
|
||||
|
||||
<?php
|
||||
|
||||
echo("<tr class=tablehead><td></td>");
|
||||
echo('<tr class="tablehead"><td></td>');
|
||||
|
||||
$cols = array('device' => 'Device',
|
||||
'port' => 'Port',
|
||||
@@ -15,7 +15,8 @@ $cols = array('device' => 'Device',
|
||||
|
||||
foreach ($cols as $sort => $col)
|
||||
{
|
||||
if($vars['sort'] == $sort) {
|
||||
if ($vars['sort'] == $sort)
|
||||
{
|
||||
echo('<th>'.$col.' *</th>');
|
||||
} else {
|
||||
echo('<th><a href="'. generate_url($vars, array('sort' => $sort)).'">'.$col.'</a></th>');
|
||||
@@ -38,14 +39,12 @@ foreach ($ports as $port)
|
||||
|
||||
if (port_permitted($port['interface_id'], $port['device_id']))
|
||||
{
|
||||
|
||||
if (is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||
|
||||
$speed = humanspeed($port['ifSpeed']);
|
||||
$type = humanmedia($port['ifType']);
|
||||
$ifclass = ifclass($port['ifOperStatus'], $port['ifAdminStatus']);
|
||||
|
||||
|
||||
if ($port['in_errors'] > 0 || $port['out_errors'] > 0)
|
||||
{
|
||||
$error_img = generate_port_link($port,"<img src='images/16/chart_curve_error.png' alt='Interface Errors' border=0>",errors);
|
||||
@@ -70,11 +69,8 @@ foreach ($ports as $port)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
echo("<tr><td colspan=7>");
|
||||
echo('<tr><td colspan="7">');
|
||||
echo("<strong>Matched Ports: $ports_total ( <span class=green>Up $ports_up</span> | <span class=red>Down $ports_down</span> | Disabled $ports_disabled )</strong>");
|
||||
echo("</td></tr>");
|
||||
|
||||
echo('</table>');
|
||||
echo('</td></tr></table>');
|
||||
|
||||
?>
|
||||
|
||||
@@ -243,7 +243,9 @@ else
|
||||
$graph_array['width'] = "218";
|
||||
$graph_array['to'] = $now;
|
||||
echo('<tr bgcolor="'.$bg_colour.'"' . ($bg_image ? ' background="'.$bg_image.'"' : '') . '"><td colspan="9">');
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo("</td></tr>");
|
||||
}
|
||||
|
||||
|
||||
@@ -11,12 +11,15 @@
|
||||
|
||||
echo('<div style="background-color: '.$row_colour.';">');
|
||||
echo('<div style="padding:4px 0px 0px 8px;"><span class=graphhead>'.$type_text[$type].'</span>');
|
||||
|
||||
include("pages/routing/overview/".mres($type).".inc.php");
|
||||
|
||||
echo('</div>');
|
||||
echo('</div>');
|
||||
} else {
|
||||
$graph_title = $type_text[$type];
|
||||
$graph_type = "device_".$type;
|
||||
|
||||
include("includes/print-device-graph.php");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,9 @@ if($_GET['optb'] == "all" ) {
|
||||
$hostname = $device['hostname'];
|
||||
if ($x % 2) { $device_colour = $list_colour_a; } else { $device_colour = $list_colour_b; }
|
||||
echo("<table cellpadding=10 cellspacing=0 class=devicetable width=100%>");
|
||||
|
||||
include("includes/device-header.inc.php");
|
||||
|
||||
echo("</table>");
|
||||
unset($seperator);
|
||||
echo('<div style="margin: 0 0 0 60px;"><table cellspacing=0 cellpadding=7>');
|
||||
@@ -159,7 +161,9 @@ if($_GET['optb'] == "all" ) {
|
||||
} else {
|
||||
if ($i % 2 === 0) { $int_colour = $list_colour_b_a; } else { $int_colour = $list_colour_b_b; }
|
||||
}
|
||||
|
||||
include("includes/print-interface.inc.php");
|
||||
|
||||
$i++;
|
||||
}
|
||||
$x++;
|
||||
|
||||
@@ -51,6 +51,7 @@ if ($_SESSION['userlevel'] >= '5')
|
||||
foreach (dbFetchRows("SELECT * FROM `services` WHERE `device_id` = ?", array($host_data['device_id'])) as $service)
|
||||
{
|
||||
include("includes/print-service.inc.php");
|
||||
|
||||
# $samehost = 1;
|
||||
if ($_GET['opta'] == "details")
|
||||
{
|
||||
|
||||
@@ -93,6 +93,7 @@ echo("<table cellspacing=0 cellpadding=2 width=100%>");
|
||||
foreach (dbFetchRows($sql, $array) as $entry)
|
||||
{
|
||||
$entry = array_merge($entry, device_by_id_cache($entry['device_id']));
|
||||
|
||||
include("includes/print-syslog.inc.php");
|
||||
}
|
||||
echo("</table>");
|
||||
|
||||
Reference in New Issue
Block a user