mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fixing graphing code and graphing page
git-svn-id: http://www.observium.org/svn/observer/trunk@787 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@ -1,5 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
$g_i++;
|
||||||
|
if(!is_integer($g_i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
|
||||||
|
|
||||||
|
echo("<div style='background-color: $row_colour;'>");
|
||||||
|
|
||||||
|
echo('<div style="padding:4px 0px 0px 8px;" class=graphhead>'.$graph_title.'</div>');
|
||||||
|
|
||||||
$daily_traffic = "graph.php?device=" . $device['device_id'] . "&type=$graph_type&from=$day&to=$now&width=215&height=100";
|
$daily_traffic = "graph.php?device=" . $device['device_id'] . "&type=$graph_type&from=$day&to=$now&width=215&height=100";
|
||||||
$daily_traffic .= $args;
|
$daily_traffic .= $args;
|
||||||
$daily_url = "graph.php?device=" . $device['device_id'] . "&type=$graph_type&from=$day&to=$now&width=400&height=150";
|
$daily_url = "graph.php?device=" . $device['device_id'] . "&type=$graph_type&from=$day&to=$now&width=400&height=150";
|
||||||
@ -29,5 +36,7 @@
|
|||||||
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
echo("<a onmouseover=\"return overlib('<img src=\'$yearly_url\'>', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">
|
||||||
<img src='$yearly_traffic' border=0></a>");
|
<img src='$yearly_traffic' border=0></a>");
|
||||||
|
|
||||||
|
echo("</div>");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
@ -24,6 +24,9 @@ while ($device = mysql_fetch_array($device_query))
|
|||||||
echo("No graph definitions found for OS " . $device['os'] . "!");
|
echo("No graph definitions found for OS " . $device['os'] . "!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
if ($memgraph) {
|
if ($memgraph) {
|
||||||
echo("<img src=\"$memgraph\"> <img src=\"$memgraphm\">");
|
echo("<img src=\"$memgraph\"> <img src=\"$memgraphm\">");
|
||||||
}
|
}
|
||||||
@ -60,6 +63,9 @@ while ($device = mysql_fetch_array($device_query))
|
|||||||
if ($uptimegraph) {
|
if ($uptimegraph) {
|
||||||
echo("<img src=\"$uptimegraph\"> <img src=\"$uptimegraphm\">");
|
echo("<img src=\"$uptimegraph\"> <img src=\"$uptimegraphm\">");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
echo("</div>");
|
echo("</div>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
$graph_title = "Processor Utilisation";
|
||||||
echo("<div class=graphhead>Processor Utilisation</div>");
|
$graph_type = "device_cpu";
|
||||||
$graph_type = "device_cpu"; include ("includes/print-device-graph.php");
|
include ("includes/print-device-graph.php");
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
echo("<div class=graphhead>Running Processes</div>");
|
$graph_title = "Running Processes";
|
||||||
$graph_type = "device_hrprocesses"; include ("includes/print-device-graph.php");
|
$graph_type = "device_hrprocesses";
|
||||||
echo("<br />");
|
include ("includes/print-device-graph.php");
|
||||||
?>
|
?>
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(mysql_result(mysql_query("SELECT count(storage_id) FROM storage WHERE host_id = '" . $device['device_id'] . "'"),0)) {
|
if(mysql_result(mysql_query("SELECT count(storage_id) FROM storage WHERE host_id = '" . $device['device_id'] . "'"),0)) {
|
||||||
echo("<div class=graphhead>Storage</div>");
|
$graph_title = "Storage";
|
||||||
$graph_type = "device_hrstorage"; include ("includes/print-device-graph.php");
|
$graph_type = "device_hrstorage";
|
||||||
echo("<br />");
|
include ("includes/print-device-graph.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
echo("<div class=graphhead>Users Logged On</div>");
|
$graph_title = "Users Logged On";
|
||||||
$graph_type = "device_hrusers"; include ("includes/print-device-graph.php");
|
$graph_type = "device_hrusers";
|
||||||
echo("<br />");
|
include ("includes/print-device-graph.php");
|
||||||
?>
|
?>
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
$graph_title = "System Load";
|
||||||
echo("<div class=graphhead>System Load</div>");
|
$graph_type = "device_load";
|
||||||
$graph_type = "device_load"; include ("includes/print-device-graph.php");
|
include ("includes/print-device-graph.php");
|
||||||
echo("<br />");
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
echo("<div class=graphhead>Memory Utilisation</div>");
|
$graph_title = "Memory Utilisation";
|
||||||
$graph_type = "device_memory"; include ("includes/print-device-graph.php");
|
$graph_type = "device_memory";
|
||||||
echo("<br />");
|
include ("includes/print-device-graph.php");
|
||||||
?>
|
?>
|
||||||
|
@ -1,28 +1,33 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ipSystemStats-ipv6.rrd")) {
|
if(is_file($config['rrd_dir'] . "/" . $device['hostname'] ."/ipSystemStats-ipv6.rrd")) {
|
||||||
echo("<div class=graphhead>IPv4/IPv6 Statistics</div>");
|
$graph_title = "IPv4/IPv6 Statistics";
|
||||||
$graph_type = "device_ipSystemStats"; include ("includes/print-device-graph.php");
|
$graph_type = "device_ipSystemStats";
|
||||||
echo("<br />");
|
include ("includes/print-device-graph.php");
|
||||||
}
|
}
|
||||||
|
|
||||||
echo("<div class=graphhead>IP Statistics</div>");
|
$graph_title = "IP Statistics";
|
||||||
$graph_type = "device_ip"; include ("includes/print-device-graph.php");
|
$graph_type = "device_ip";
|
||||||
echo("<br />");
|
include ("includes/print-device-graph.php");
|
||||||
echo("<div class=graphhead>IP Fragmented Statistics</div>");
|
|
||||||
$graph_type = "device_ip_fragmented"; include ("includes/print-device-graph.php");
|
$graph_title = "IP Fragmented Statistics";
|
||||||
echo("<br />");
|
$graph_type = "device_ip_fragmented";
|
||||||
echo("<div class=graphhead>TCP Statistics</div>");
|
include ("includes/print-device-graph.php");
|
||||||
$graph_type = "device_tcp"; include ("includes/print-device-graph.php");
|
|
||||||
echo("<br />");
|
$graph_title = "TCP Statistics";
|
||||||
echo("<div class=graphhead>UDP Statistics</div>");
|
$graph_type = "device_tcp";
|
||||||
$graph_type = "device_udp"; include ("includes/print-device-graph.php");
|
include ("includes/print-device-graph.php");
|
||||||
echo("<br />");
|
|
||||||
echo("<div class=graphhead>ICMP Statistics</div>");
|
$graph_title = "UDP Statistics";
|
||||||
$graph_type = "device_icmp"; include ("includes/print-device-graph.php");
|
$graph_type = "device_udp";
|
||||||
echo("<br />");
|
include ("includes/print-device-graph.php");
|
||||||
echo("<div class=graphhead>ICMP Informational Statistics</div>");
|
|
||||||
$graph_type = "device_icmp_informational"; include ("includes/print-device-graph.php");
|
$graph_title = "ICMP Statistics";
|
||||||
echo("<br />");
|
$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");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
echo("<div class=graphhead>ADSL Attainable Rate</div>");
|
$graph_title = "ADSL Attainable Rate";
|
||||||
$graph_type = "adsl_rate"; include ("includes/print-device-graph.php");
|
$graph_type = "adsl_rate";
|
||||||
echo("<br />");
|
include ("includes/print-device-graph.php");
|
||||||
echo("<div class=graphhead>ADSL Signal-to-Noise Margin</div>");
|
|
||||||
$graph_type = "adsl_snr"; include ("includes/print-device-graph.php");
|
|
||||||
echo("<br />");
|
|
||||||
echo("<div class=graphhead>ADSL Attenuation</div>");
|
|
||||||
$graph_type = "adsl_atn"; include ("includes/print-device-graph.php");
|
|
||||||
echo("<br />");
|
|
||||||
|
|
||||||
include("graphs/netstats.inc.php");
|
$graph_title = "ADSL Signal to Noise Ratio";
|
||||||
include("graphs/uptime.inc.php");
|
$graph_type = "adsl_snr";
|
||||||
|
include ("includes/print-device-graph.php");
|
||||||
|
|
||||||
|
$graph_title = "ADSL Attenuation";
|
||||||
|
$graph_type = "adsl_atn";
|
||||||
|
include ("includes/print-device-graph.php");
|
||||||
|
|
||||||
|
include("graphs/netstats.inc.php");
|
||||||
|
include("graphs/uptime.inc.php");
|
||||||
?>
|
?>
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
echo("<div class=graphhead>Processor Utilisation</div>");
|
$graph_title = "Processor Utilisation";
|
||||||
$graph_type = "fortigate_cpu"; include ("includes/print-device-graph.php");
|
$graph_type = "fortigate_cpu"; include ("includes/print-device-graph.php");
|
||||||
echo("<div class=graphhead>Memory Usage</div>");
|
|
||||||
|
$graph_title = "Memory Utilisation";
|
||||||
$graph_type = "fortigate_memory"; include ("includes/print-device-graph.php");
|
$graph_type = "fortigate_memory"; include ("includes/print-device-graph.php");
|
||||||
echo("<div class=graphhead>Firewall Sessions</div>");
|
|
||||||
|
$graph_title = "Firewall Sessions";
|
||||||
$graph_type = "fortigate_sessions"; include ("includes/print-device-graph.php");
|
$graph_type = "fortigate_sessions"; include ("includes/print-device-graph.php");
|
||||||
|
|
||||||
include("graphs/netstats.inc.php");
|
include("graphs/netstats.inc.php");
|
||||||
include("graphs/uptime.inc.php");
|
include("graphs/uptime.inc.php");
|
||||||
?>
|
?>
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
echo("<div class=graphhead>Device Uptime</div>");
|
$graph_title = "Device Uptime";
|
||||||
$graph_type = "device_uptime"; include ("includes/print-device-graph.php"); break;
|
$graph_type = "device_uptime"; include ("includes/print-device-graph.php"); break;
|
||||||
echo("<br />");
|
|
||||||
?>
|
?>
|
||||||
|
@ -1,13 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
echo("<div class=graphhead>Processor Utilisation</div>");
|
include("cpu.inc.php");
|
||||||
$graph_type = "device_cpu"; include ("includes/print-device-graph.php");
|
include("memory.inc.php");
|
||||||
echo("<br />");
|
include("uptime.inc.php");
|
||||||
/*
|
|
||||||
echo("<div class=graphhead>Memory Usage</div>");
|
|
||||||
$graph_type = "device_memory"; include ("includes/print-device-graph.php");
|
|
||||||
echo("<br />");
|
|
||||||
*/
|
|
||||||
echo("<div class=graphhead>Device Uptime</div>");
|
|
||||||
$graph_type = "device_uptime"; include ("includes/print-device-graph.php"); break;
|
|
||||||
echo("<br />");
|
|
||||||
?>
|
?>
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
echo("<div class=graphhead>Processor Utilisation</div>");
|
|
||||||
$graph_type = "device_cpu"; include ("includes/print-device-graph.php");
|
include("cpu.inc.php");
|
||||||
echo("<br />");
|
include("memory.inc.php");
|
||||||
echo("<div class=graphhead>Memory Usage</div>");
|
include("uptime.inc.php");
|
||||||
$graph_type = "device_memory"; include ("includes/print-device-graph.php");
|
|
||||||
echo("<br />");
|
|
||||||
echo("<div class=graphhead>Device Uptime</div>");
|
|
||||||
$graph_type = "device_uptime"; include ("includes/print-device-graph.php"); break;
|
|
||||||
echo("<br />");
|
|
||||||
?>
|
?>
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
echo("<div class=graphhead>Processor Utilisation</div>");
|
|
||||||
|
$graph_title = "Processor Utilisation";
|
||||||
$graph_type = "netscreen_cpu"; include ("includes/print-device-graph.php");
|
$graph_type = "netscreen_cpu"; include ("includes/print-device-graph.php");
|
||||||
echo("<div class=graphhead>Memory Usage</div>");
|
|
||||||
|
$graph_title = "Memory Usage</div>";
|
||||||
$graph_type = "netscreen_memory"; include ("includes/print-device-graph.php");
|
$graph_type = "netscreen_memory"; include ("includes/print-device-graph.php");
|
||||||
echo("<div class=graphhead>Firewall Sessions</div>");
|
|
||||||
|
$graph_title = "Firewall Sessions";
|
||||||
$graph_type = "netscreen_sessions"; include ("includes/print-device-graph.php");
|
$graph_type = "netscreen_sessions"; include ("includes/print-device-graph.php");
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
echo("<div class=graphhead>Calls</div>");
|
$graph_title = "Calls";
|
||||||
$graph_type = "snom_calls"; include ("includes/print-device-graph.php");
|
$graph_type = "snom_calls"; include ("includes/print-device-graph.php");
|
||||||
?>
|
?>
|
||||||
|
@ -10,9 +10,4 @@ include("hrusers.inc.php");
|
|||||||
include("hrprocesses.inc.php");
|
include("hrprocesses.inc.php");
|
||||||
include("uptime.inc.php");
|
include("uptime.inc.php");
|
||||||
|
|
||||||
# $usersgraph = usersgraphWin ($device[hostname] . "-sys.rrd", $device[hostname] . "-users.png", $day, $now, 335, 100);
|
|
||||||
# $usersgraphm = usersgraphWin ($device[hostname] . "-sys.rrd", $device[hostname] . "-users-m.png", $month, $now, 335, 100);
|
|
||||||
# $procsgraph = procsgraphWin ($device[hostname] . "-sys.rrd", $device[hostname] . "-procs.png", $day, $now, 335, 100);
|
|
||||||
# $procsgraphm = procsgraphWin ($device[hostname] . "-sys.rrd", $device[hostname] . "-procs-m.png", $month, $now, 335, 100);
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
if(mysql_result(mysql_query("SELECT count(*) FROM temperature WHERE temp_host = '" . $device['device_id'] . "'"),0)) {
|
if(mysql_result(mysql_query("SELECT count(*) FROM temperature WHERE temp_host = '" . $device['device_id'] . "'"),0)) {
|
||||||
echo("<div class=graphhead>Temperatures</div>");
|
$graph_title = "Temperatures";
|
||||||
$graph_type = "device_temperatures"; include ("includes/print-device-graph.php");
|
$graph_type = "device_temperatures"; include ("includes/print-device-graph.php");
|
||||||
echo("<br />");
|
echo("<br />");
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
echo("<div class=graphhead>Device Uptime</div>");
|
$graph_title = "Device Uptime";
|
||||||
$graph_type = "device_uptime"; include ("includes/print-device-graph.php");
|
$graph_type = "device_uptime"; include ("includes/print-device-graph.php");
|
||||||
echo("<br />");
|
echo("<br />");
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user