From 88ec70ad14a3a8b8fe599c85f148d51df1b84490 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Mon, 8 Feb 2010 00:36:28 +0000 Subject: [PATCH] fixing graphing code and graphing page git-svn-id: http://www.observium.org/svn/observer/trunk@787 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/print-device-graph.php | 9 ++++ html/pages/device/graphs.inc.php | 6 +++ html/pages/device/graphs/cpu.inc.php | 8 ++-- html/pages/device/graphs/hrprocesses.inc.php | 6 +-- html/pages/device/graphs/hrstorage.inc.php | 6 +-- html/pages/device/graphs/hrusers.inc.php | 6 +-- html/pages/device/graphs/laload.inc.php | 9 ++-- html/pages/device/graphs/memory.inc.php | 6 +-- html/pages/device/graphs/netstats.inc.php | 47 ++++++++++--------- html/pages/device/graphs/os-bcm96348.inc.php | 24 +++++----- html/pages/device/graphs/os-fortigate.inc.php | 10 ++-- .../device/graphs/os-papouch-tme.inc.php | 3 +- .../device/graphs/os-powerconnect.inc.php | 14 ++---- html/pages/device/graphs/os-procurve.inc.php | 14 ++---- html/pages/device/graphs/os-screenos.inc.php | 9 ++-- html/pages/device/graphs/os-snom.inc.php | 2 +- html/pages/device/graphs/os-windows.inc.php | 5 -- html/pages/device/graphs/temperatures.inc.php | 2 +- html/pages/device/graphs/uptime.inc.php | 2 +- 19 files changed, 96 insertions(+), 92 deletions(-) diff --git a/html/includes/print-device-graph.php b/html/includes/print-device-graph.php index f6c2fb4218..4278eae372 100644 --- a/html/includes/print-device-graph.php +++ b/html/includes/print-device-graph.php @@ -1,5 +1,12 @@ "); + + echo('
'.$graph_title.'
'); + $daily_traffic = "graph.php?device=" . $device['device_id'] . "&type=$graph_type&from=$day&to=$now&width=215&height=100"; $daily_traffic .= $args; $daily_url = "graph.php?device=" . $device['device_id'] . "&type=$graph_type&from=$day&to=$now&width=400&height=150"; @@ -29,5 +36,7 @@ echo("', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"> "); + echo(""); + ?> diff --git a/html/pages/device/graphs.inc.php b/html/pages/device/graphs.inc.php index c3aaecc842..d3065f17e9 100644 --- a/html/pages/device/graphs.inc.php +++ b/html/pages/device/graphs.inc.php @@ -24,6 +24,9 @@ while ($device = mysql_fetch_array($device_query)) echo("No graph definitions found for OS " . $device['os'] . "!"); } + + +/** if ($memgraph) { echo(" "); } @@ -60,6 +63,9 @@ while ($device = mysql_fetch_array($device_query)) if ($uptimegraph) { echo(" "); } + +**/ + echo(""); } diff --git a/html/pages/device/graphs/cpu.inc.php b/html/pages/device/graphs/cpu.inc.php index e10347e588..74f840d25c 100644 --- a/html/pages/device/graphs/cpu.inc.php +++ b/html/pages/device/graphs/cpu.inc.php @@ -1,7 +1,5 @@ Processor Utilisation"); - $graph_type = "device_cpu"; include ("includes/print-device-graph.php"); - - + $graph_title = "Processor Utilisation"; + $graph_type = "device_cpu"; + include ("includes/print-device-graph.php"); ?> diff --git a/html/pages/device/graphs/hrprocesses.inc.php b/html/pages/device/graphs/hrprocesses.inc.php index c441e732e7..0176e3b2ae 100644 --- a/html/pages/device/graphs/hrprocesses.inc.php +++ b/html/pages/device/graphs/hrprocesses.inc.php @@ -1,5 +1,5 @@ Running Processes"); - $graph_type = "device_hrprocesses"; include ("includes/print-device-graph.php"); - echo("
"); + $graph_title = "Running Processes"; + $graph_type = "device_hrprocesses"; + include ("includes/print-device-graph.php"); ?> diff --git a/html/pages/device/graphs/hrstorage.inc.php b/html/pages/device/graphs/hrstorage.inc.php index 063d82071e..fc02427846 100644 --- a/html/pages/device/graphs/hrstorage.inc.php +++ b/html/pages/device/graphs/hrstorage.inc.php @@ -1,9 +1,9 @@ Storage"); - $graph_type = "device_hrstorage"; include ("includes/print-device-graph.php"); - echo("
"); + $graph_title = "Storage"; + $graph_type = "device_hrstorage"; + include ("includes/print-device-graph.php"); } ?> diff --git a/html/pages/device/graphs/hrusers.inc.php b/html/pages/device/graphs/hrusers.inc.php index 117a169b6b..be8e191840 100644 --- a/html/pages/device/graphs/hrusers.inc.php +++ b/html/pages/device/graphs/hrusers.inc.php @@ -1,5 +1,5 @@ Users Logged On"); -$graph_type = "device_hrusers"; include ("includes/print-device-graph.php"); -echo("
"); + $graph_title = "Users Logged On"; + $graph_type = "device_hrusers"; + include ("includes/print-device-graph.php"); ?> diff --git a/html/pages/device/graphs/laload.inc.php b/html/pages/device/graphs/laload.inc.php index 2c131010f7..ed1a4ab6c2 100644 --- a/html/pages/device/graphs/laload.inc.php +++ b/html/pages/device/graphs/laload.inc.php @@ -1,8 +1,5 @@ System Load"); - $graph_type = "device_load"; include ("includes/print-device-graph.php"); - echo("
"); - - + $graph_title = "System Load"; + $graph_type = "device_load"; + include ("includes/print-device-graph.php"); ?> diff --git a/html/pages/device/graphs/memory.inc.php b/html/pages/device/graphs/memory.inc.php index 5c4a082c71..67a2f7bd84 100644 --- a/html/pages/device/graphs/memory.inc.php +++ b/html/pages/device/graphs/memory.inc.php @@ -1,5 +1,5 @@ Memory Utilisation"); - $graph_type = "device_memory"; include ("includes/print-device-graph.php"); - echo("
"); + $graph_title = "Memory Utilisation"; + $graph_type = "device_memory"; + include ("includes/print-device-graph.php"); ?> diff --git a/html/pages/device/graphs/netstats.inc.php b/html/pages/device/graphs/netstats.inc.php index a367e84283..92e0d20add 100644 --- a/html/pages/device/graphs/netstats.inc.php +++ b/html/pages/device/graphs/netstats.inc.php @@ -1,28 +1,33 @@ IPv4/IPv6 Statistics"); - $graph_type = "device_ipSystemStats"; include ("includes/print-device-graph.php"); - echo("
"); + $graph_title = "IPv4/IPv6 Statistics"; + $graph_type = "device_ipSystemStats"; + include ("includes/print-device-graph.php"); } - echo("
IP Statistics
"); - $graph_type = "device_ip"; include ("includes/print-device-graph.php"); - echo("
"); - echo("
IP Fragmented Statistics
"); - $graph_type = "device_ip_fragmented"; include ("includes/print-device-graph.php"); - echo("
"); - echo("
TCP Statistics
"); - $graph_type = "device_tcp"; include ("includes/print-device-graph.php"); - echo("
"); - echo("
UDP Statistics
"); - $graph_type = "device_udp"; include ("includes/print-device-graph.php"); - echo("
"); - echo("
ICMP Statistics
"); - $graph_type = "device_icmp"; include ("includes/print-device-graph.php"); - echo("
"); - echo("
ICMP Informational Statistics
"); - $graph_type = "device_icmp_informational"; include ("includes/print-device-graph.php"); - echo("
"); + $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"); + + $graph_title = "TCP Statistics"; + $graph_type = "device_tcp"; + include ("includes/print-device-graph.php"); + + $graph_title = "UDP Statistics"; + $graph_type = "device_udp"; + include ("includes/print-device-graph.php"); + + $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"); ?> diff --git a/html/pages/device/graphs/os-bcm96348.inc.php b/html/pages/device/graphs/os-bcm96348.inc.php index 226bca1ffb..d5b05f80ed 100644 --- a/html/pages/device/graphs/os-bcm96348.inc.php +++ b/html/pages/device/graphs/os-bcm96348.inc.php @@ -1,14 +1,16 @@ ADSL Attainable Rate"); - $graph_type = "adsl_rate"; include ("includes/print-device-graph.php"); - echo("
"); - echo("
ADSL Signal-to-Noise Margin
"); - $graph_type = "adsl_snr"; include ("includes/print-device-graph.php"); - echo("
"); - echo("
ADSL Attenuation
"); - $graph_type = "adsl_atn"; include ("includes/print-device-graph.php"); - echo("
"); + $graph_title = "ADSL Attainable Rate"; + $graph_type = "adsl_rate"; + include ("includes/print-device-graph.php"); - include("graphs/netstats.inc.php"); - include("graphs/uptime.inc.php"); + $graph_title = "ADSL Signal to Noise Ratio"; + $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"); ?> diff --git a/html/pages/device/graphs/os-fortigate.inc.php b/html/pages/device/graphs/os-fortigate.inc.php index bbcc0de9eb..e926b015b7 100644 --- a/html/pages/device/graphs/os-fortigate.inc.php +++ b/html/pages/device/graphs/os-fortigate.inc.php @@ -1,11 +1,13 @@ Processor Utilisation"); + $graph_title = "Processor Utilisation"; $graph_type = "fortigate_cpu"; include ("includes/print-device-graph.php"); - echo("
Memory Usage
"); + + $graph_title = "Memory Utilisation"; $graph_type = "fortigate_memory"; include ("includes/print-device-graph.php"); - echo("
Firewall Sessions
"); + + $graph_title = "Firewall Sessions"; $graph_type = "fortigate_sessions"; include ("includes/print-device-graph.php"); include("graphs/netstats.inc.php"); include("graphs/uptime.inc.php"); -?> \ No newline at end of file +?> diff --git a/html/pages/device/graphs/os-papouch-tme.inc.php b/html/pages/device/graphs/os-papouch-tme.inc.php index c653ec8156..c07e7943b8 100644 --- a/html/pages/device/graphs/os-papouch-tme.inc.php +++ b/html/pages/device/graphs/os-papouch-tme.inc.php @@ -1,5 +1,4 @@ Device Uptime"); + $graph_title = "Device Uptime"; $graph_type = "device_uptime"; include ("includes/print-device-graph.php"); break; - echo("
"); ?> diff --git a/html/pages/device/graphs/os-powerconnect.inc.php b/html/pages/device/graphs/os-powerconnect.inc.php index 675f563a63..2d0ca5e274 100644 --- a/html/pages/device/graphs/os-powerconnect.inc.php +++ b/html/pages/device/graphs/os-powerconnect.inc.php @@ -1,13 +1,5 @@ Processor Utilisation"); - $graph_type = "device_cpu"; include ("includes/print-device-graph.php"); - echo("
"); - /* - echo("
Memory Usage
"); - $graph_type = "device_memory"; include ("includes/print-device-graph.php"); - echo("
"); - */ - echo("
Device Uptime
"); - $graph_type = "device_uptime"; include ("includes/print-device-graph.php"); break; - echo("
"); + include("cpu.inc.php"); + include("memory.inc.php"); + include("uptime.inc.php"); ?> diff --git a/html/pages/device/graphs/os-procurve.inc.php b/html/pages/device/graphs/os-procurve.inc.php index 2767069573..e9aaec5a5d 100644 --- a/html/pages/device/graphs/os-procurve.inc.php +++ b/html/pages/device/graphs/os-procurve.inc.php @@ -1,11 +1,7 @@ Processor Utilisation"); - $graph_type = "device_cpu"; include ("includes/print-device-graph.php"); - echo("
"); - echo("
Memory Usage
"); - $graph_type = "device_memory"; include ("includes/print-device-graph.php"); - echo("
"); - echo("
Device Uptime
"); - $graph_type = "device_uptime"; include ("includes/print-device-graph.php"); break; - echo("
"); + + include("cpu.inc.php"); + include("memory.inc.php"); + include("uptime.inc.php"); + ?> diff --git a/html/pages/device/graphs/os-screenos.inc.php b/html/pages/device/graphs/os-screenos.inc.php index 68b20fd646..9a6f2a1445 100644 --- a/html/pages/device/graphs/os-screenos.inc.php +++ b/html/pages/device/graphs/os-screenos.inc.php @@ -1,9 +1,12 @@ Processor Utilisation"); + + $graph_title = "Processor Utilisation"; $graph_type = "netscreen_cpu"; include ("includes/print-device-graph.php"); - echo("
Memory Usage
"); + + $graph_title = "Memory Usage"; $graph_type = "netscreen_memory"; include ("includes/print-device-graph.php"); - echo("
Firewall Sessions
"); + + $graph_title = "Firewall Sessions"; $graph_type = "netscreen_sessions"; include ("includes/print-device-graph.php"); diff --git a/html/pages/device/graphs/os-snom.inc.php b/html/pages/device/graphs/os-snom.inc.php index 224b02536e..cdb5530072 100644 --- a/html/pages/device/graphs/os-snom.inc.php +++ b/html/pages/device/graphs/os-snom.inc.php @@ -1,4 +1,4 @@ Calls"); + $graph_title = "Calls"; $graph_type = "snom_calls"; include ("includes/print-device-graph.php"); ?> diff --git a/html/pages/device/graphs/os-windows.inc.php b/html/pages/device/graphs/os-windows.inc.php index df29285a01..bcaeebac2f 100644 --- a/html/pages/device/graphs/os-windows.inc.php +++ b/html/pages/device/graphs/os-windows.inc.php @@ -10,9 +10,4 @@ include("hrusers.inc.php"); include("hrprocesses.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); - ?> diff --git a/html/pages/device/graphs/temperatures.inc.php b/html/pages/device/graphs/temperatures.inc.php index 9cd87a5fbb..2e8a94009e 100644 --- a/html/pages/device/graphs/temperatures.inc.php +++ b/html/pages/device/graphs/temperatures.inc.php @@ -1,6 +1,6 @@ Temperatures"); + $graph_title = "Temperatures"; $graph_type = "device_temperatures"; include ("includes/print-device-graph.php"); echo("
"); } diff --git a/html/pages/device/graphs/uptime.inc.php b/html/pages/device/graphs/uptime.inc.php index c13d5318c7..6b39186c00 100644 --- a/html/pages/device/graphs/uptime.inc.php +++ b/html/pages/device/graphs/uptime.inc.php @@ -1,5 +1,5 @@ Device Uptime"); + $graph_title = "Device Uptime"; $graph_type = "device_uptime"; include ("includes/print-device-graph.php"); echo("
"); ?>