From ada14bd542db3e8bbf090a59d8a6210f1bd42098 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Sat, 24 Jul 2010 19:14:41 +0000 Subject: [PATCH] Major changes to graphing system organisation. Prevent sensors from being discovered in ENTITY-SENSOR-MIB if they've already been detected in CISCO-ENTITY-SENSOR-MIB (they share entPhysicalIndex). Fix ADSL poller. Make popup overlibs prettier as default. git-svn-id: http://www.observium.org/svn/observer/trunk@1470 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/.htaccess | 2 + html/graph.php | 82 +--------------- html/includes/functions.inc.php | 13 ++- .../graphs/XXX_device_memory_windows.inc.php | 2 +- .../graphs/altiga_ssl_sessions.inc.php | 33 +++++++ html/includes/graphs/atmvp/bits.inc.php | 0 .../cells.inc.php} | 0 .../errors.inc.php} | 0 .../packets.inc.php} | 0 html/includes/graphs/atmvp_bits.inc.php | 22 ----- .../graphs/{ => bgp}/cbgp_prefixes.inc.php | 0 .../updates.inc.php} | 0 html/includes/graphs/cempMemPool.inc.php | 35 ------- .../graphs/cisco_entity_sensor.inc.php | 2 +- html/includes/graphs/cmpMemPool.inc.php | 29 ------ .../bits.inc.php} | 2 +- .../bits.inc.php} | 2 +- .../cpu.inc.php} | 2 +- .../cpu_powerconnect.inc.php} | 3 +- .../cpu_procurve.inc.php} | 3 +- .../cpu_unix.inc.php} | 4 +- .../current.inc.php} | 0 html/includes/graphs/device/diskio.inc.php | 5 + .../diskio_bits.inc.php} | 2 +- .../diskio_ops.inc.php} | 2 +- .../fanspeeds.inc.php} | 0 .../frequencies.inc.php} | 0 .../hrprocesses.inc.php} | 0 .../hrusers.inc.php} | 0 .../humidity.inc.php} | 0 .../icmp.inc.php} | 0 .../icmp_informational.inc.php} | 2 +- .../{device_ip.inc.php => device/ip.inc.php} | 0 .../ipSystemStats.inc.php} | 0 .../ipSystemStats_v4.inc.php} | 0 .../ipSystemStats_v6.inc.php} | 0 .../ipSystemStats_v6_frag.inc.php} | 0 .../ip_fragmented.inc.php} | 0 .../laload.inc.php} | 0 .../memory.inc.php} | 0 .../memory_procurve.inc.php} | 0 .../memory_unix.inc.php} | 0 .../processors.inc.php} | 2 +- .../snmp_packets.inc.php} | 0 .../snmp_statistics.inc.php} | 0 .../storage.inc.php} | 0 .../tcp.inc.php} | 0 .../temperatures.inc.php} | 0 .../toner.inc.php} | 0 .../udp.inc.php} | 0 .../uptime.inc.php} | 0 .../voltages.inc.php} | 0 .../wificlients.inc.php} | 0 html/includes/graphs/device_diskio.inc.php | 5 - .../bits.inc.php} | 0 .../ops.inc.php} | 0 html/includes/graphs/generic_bits.inc.php | 2 +- html/includes/graphs/generic_duplex.inc.php | 2 +- .../graphs/generic_multi_bits.inc.php | 2 +- .../generic_multi_bits_separated.inc.php | 2 +- .../graphs/generic_multi_line.inc.php | 2 +- .../graphs/generic_multi_seperated.inc.php | 2 +- .../generic_multi_simplex_seperated.inc.php | 2 +- html/includes/graphs/generic_simplex.inc.php | 2 +- html/includes/graphs/graph.inc.php | 96 +++++++++++++++++++ .../usage.inc.php} | 0 .../graphs/multi_bits_separate.inc.php | 2 +- .../adsl_attainable.inc.php} | 2 +- .../adsl_attenuation.inc.php} | 2 +- .../adsl_power.inc.php} | 2 +- .../adsl_snr.inc.php} | 2 +- .../adsl_speed.inc.php} | 2 +- .../{port_bits.inc.php => port/bits.inc.php} | 0 .../errors.inc.php} | 0 .../etherlike.inc.php} | 2 +- .../graphs/{ => port}/fanspeed.inc.php | 0 .../graphs/{ => port}/mac_acc_bits.inc.php | 0 .../graphs/{ => port}/mac_acc_pkts.inc.php | 0 .../graphs/{ => port}/mac_acc_total.inc.php | 0 .../nupkts.inc.php} | 4 +- .../graphs/{ => port}/pagp_bits.inc.php | 2 +- .../upkts.inc.php} | 0 .../usage.inc.php} | 0 .../graphs/{ => sensor}/current.inc.php | 0 .../graphs/{ => sensor}/frequency.inc.php | 0 .../graphs/{ => sensor}/humidity.inc.php | 0 .../graphs/{ => sensor}/temperature.inc.php | 0 .../graphs/{ => sensor}/voltage.inc.php | 0 html/includes/graphs/service.inc.php | 2 +- .../usage.inc.php} | 0 html/includes/print-device-graph.php | 9 +- html/pages/device/health/current.inc.php | 2 +- html/pages/device/health/diskio.inc.php | 2 +- html/pages/device/health/fanspeeds.inc.php | 2 +- html/pages/device/health/frequencies.inc.php | 4 +- html/pages/device/health/humidity.inc.php | 2 +- html/pages/device/health/memory.inc.php | 22 +++-- html/pages/device/health/processors.inc.php | 22 +++-- html/pages/device/health/storage.inc.php | 6 +- html/pages/device/health/temperatures.inc.php | 4 +- html/pages/device/health/voltages.inc.php | 2 +- html/pages/device/overview/current.inc.php | 12 ++- html/pages/device/overview/fanspeeds.inc.php | 12 ++- .../pages/device/overview/frequencies.inc.php | 12 ++- html/pages/device/overview/humidity.inc.php | 12 ++- html/pages/device/overview/mempools.inc.php | 6 +- html/pages/device/overview/processors.inc.php | 6 +- html/pages/device/overview/storage.inc.php | 6 +- .../device/overview/temperatures.inc.php | 12 ++- html/pages/device/overview/voltages.inc.php | 12 ++- html/pages/health/current.inc.php | 30 +++--- html/pages/health/fanspeeds.inc.php | 30 +++--- html/pages/health/frequencies.inc.php | 30 +++--- html/pages/health/humidity.inc.php | 30 +++--- html/pages/health/memory.inc.php | 22 +++-- html/pages/health/processors.inc.php | 22 +++-- html/pages/health/storage.inc.php | 21 ++-- html/pages/health/temperatures.inc.php | 30 +++--- html/pages/health/voltages.inc.php | 30 +++--- includes/defaults.inc.php | 10 +- includes/discovery/storage-hrstorage.inc.php | 5 +- .../temperatures/cisco-entity-sensor.inc.php | 5 +- .../temperatures/cisco-envmon.inc.php | 4 +- .../temperatures/entity-sensor.inc.php | 9 +- includes/polling/port-adsl.inc.php | 2 +- 125 files changed, 432 insertions(+), 403 deletions(-) create mode 100644 html/includes/graphs/altiga_ssl_sessions.inc.php create mode 100644 html/includes/graphs/atmvp/bits.inc.php rename html/includes/graphs/{atmvp_cells.inc.php => atmvp/cells.inc.php} (100%) rename html/includes/graphs/{atmvp_errors.inc.php => atmvp/errors.inc.php} (100%) rename html/includes/graphs/{atmvp_packets.inc.php => atmvp/packets.inc.php} (100%) delete mode 100644 html/includes/graphs/atmvp_bits.inc.php rename html/includes/graphs/{ => bgp}/cbgp_prefixes.inc.php (100%) rename html/includes/graphs/{bgp_updates.inc.php => bgp/updates.inc.php} (100%) delete mode 100644 html/includes/graphs/cempMemPool.inc.php delete mode 100755 html/includes/graphs/cmpMemPool.inc.php rename html/includes/graphs/{customer_bits.inc.php => customer/bits.inc.php} (92%) rename html/includes/graphs/{device_bits.inc.php => device/bits.inc.php} (95%) rename html/includes/graphs/{device_cpu.inc.php => device/cpu.inc.php} (92%) rename html/includes/graphs/{device_cpu_powerconnect.inc.php => device/cpu_powerconnect.inc.php} (94%) rename html/includes/graphs/{device_cpu_procurve.inc.php => device/cpu_procurve.inc.php} (94%) rename html/includes/graphs/{device_cpu_unix.inc.php => device/cpu_unix.inc.php} (96%) rename html/includes/graphs/{device_current.inc.php => device/current.inc.php} (100%) create mode 100644 html/includes/graphs/device/diskio.inc.php rename html/includes/graphs/{device_diskio_bits.inc.php => device/diskio_bits.inc.php} (92%) rename html/includes/graphs/{device_diskio_ops.inc.php => device/diskio_ops.inc.php} (92%) rename html/includes/graphs/{device_fanspeeds.inc.php => device/fanspeeds.inc.php} (100%) rename html/includes/graphs/{device_frequencies.inc.php => device/frequencies.inc.php} (100%) rename html/includes/graphs/{device_hrprocesses.inc.php => device/hrprocesses.inc.php} (100%) rename html/includes/graphs/{device_hrusers.inc.php => device/hrusers.inc.php} (100%) rename html/includes/graphs/{device_humidity.inc.php => device/humidity.inc.php} (100%) rename html/includes/graphs/{device_icmp.inc.php => device/icmp.inc.php} (100%) rename html/includes/graphs/{device_icmp_informational.inc.php => device/icmp_informational.inc.php} (98%) rename html/includes/graphs/{device_ip.inc.php => device/ip.inc.php} (100%) rename html/includes/graphs/{device_ipSystemStats.inc.php => device/ipSystemStats.inc.php} (100%) rename html/includes/graphs/{device_ipSystemStats_v4.inc.php => device/ipSystemStats_v4.inc.php} (100%) rename html/includes/graphs/{device_ipSystemStats_v6.inc.php => device/ipSystemStats_v6.inc.php} (100%) rename html/includes/graphs/{device_ipSystemStats_v6_frag.inc.php => device/ipSystemStats_v6_frag.inc.php} (100%) rename html/includes/graphs/{device_ip_fragmented.inc.php => device/ip_fragmented.inc.php} (100%) rename html/includes/graphs/{device_laload.inc.php => device/laload.inc.php} (100%) rename html/includes/graphs/{device_memory.inc.php => device/memory.inc.php} (100%) rename html/includes/graphs/{device_memory_procurve.inc.php => device/memory_procurve.inc.php} (100%) rename html/includes/graphs/{device_memory_unix.inc.php => device/memory_unix.inc.php} (100%) rename html/includes/graphs/{device_processors.inc.php => device/processors.inc.php} (92%) rename html/includes/graphs/{device_snmp_packets.inc.php => device/snmp_packets.inc.php} (100%) rename html/includes/graphs/{device_snmp_statistics.inc.php => device/snmp_statistics.inc.php} (100%) rename html/includes/graphs/{device_storage.inc.php => device/storage.inc.php} (100%) rename html/includes/graphs/{device_tcp.inc.php => device/tcp.inc.php} (100%) rename html/includes/graphs/{device_temperatures.inc.php => device/temperatures.inc.php} (100%) rename html/includes/graphs/{device_toner.inc.php => device/toner.inc.php} (100%) rename html/includes/graphs/{device_udp.inc.php => device/udp.inc.php} (100%) rename html/includes/graphs/{device_uptime.inc.php => device/uptime.inc.php} (100%) rename html/includes/graphs/{device_voltages.inc.php => device/voltages.inc.php} (100%) rename html/includes/graphs/{device_wificlients.inc.php => device/wificlients.inc.php} (100%) delete mode 100644 html/includes/graphs/device_diskio.inc.php rename html/includes/graphs/{diskio_bits.inc.php => diskio/bits.inc.php} (100%) rename html/includes/graphs/{diskio_ops.inc.php => diskio/ops.inc.php} (100%) create mode 100644 html/includes/graphs/graph.inc.php rename html/includes/graphs/{mempool.inc.php => mempool/usage.inc.php} (100%) rename html/includes/graphs/{port_adsl_attainable.inc.php => port/adsl_attainable.inc.php} (94%) rename html/includes/graphs/{port_adsl_attenuation.inc.php => port/adsl_attenuation.inc.php} (94%) rename html/includes/graphs/{port_adsl_power.inc.php => port/adsl_power.inc.php} (94%) rename html/includes/graphs/{port_adsl_snr.inc.php => port/adsl_snr.inc.php} (94%) rename html/includes/graphs/{port_adsl_speed.inc.php => port/adsl_speed.inc.php} (94%) rename html/includes/graphs/{port_bits.inc.php => port/bits.inc.php} (100%) rename html/includes/graphs/{port_errors.inc.php => port/errors.inc.php} (100%) rename html/includes/graphs/{port_etherlike.inc.php => port/etherlike.inc.php} (94%) rename html/includes/graphs/{ => port}/fanspeed.inc.php (100%) rename html/includes/graphs/{ => port}/mac_acc_bits.inc.php (100%) rename html/includes/graphs/{ => port}/mac_acc_pkts.inc.php (100%) rename html/includes/graphs/{ => port}/mac_acc_total.inc.php (100%) rename html/includes/graphs/{port_nupkts.inc.php => port/nupkts.inc.php} (94%) rename html/includes/graphs/{ => port}/pagp_bits.inc.php (92%) rename html/includes/graphs/{port_upkts.inc.php => port/upkts.inc.php} (100%) rename html/includes/graphs/{processor.inc.php => processor/usage.inc.php} (100%) rename html/includes/graphs/{ => sensor}/current.inc.php (100%) rename html/includes/graphs/{ => sensor}/frequency.inc.php (100%) rename html/includes/graphs/{ => sensor}/humidity.inc.php (100%) rename html/includes/graphs/{ => sensor}/temperature.inc.php (100%) rename html/includes/graphs/{ => sensor}/voltage.inc.php (100%) rename html/includes/graphs/{storage.inc.php => storage/usage.inc.php} (100%) diff --git a/html/.htaccess b/html/.htaccess index 4cc1bdaf94..fb36aec524 100644 --- a/html/.htaccess +++ b/html/.htaccess @@ -43,6 +43,8 @@ RewriteRule ^device/([0-9]+) ?page=device&id=$1 RewriteRule ^([a-z|0-9\-]+)/$ ?page=$1 +RewriteRule ^([a-z|0-9]+)/(.+)/(.+)/(.+)/(.+)/(.+)/$ ?page=$1&opta=$2&optb=$3&optc=$4&optd=$5&opte=$6 +RewriteRule ^([a-z|0-9]+)/(.+)/(.+)/(.+)/(.+)/$ ?page=$1&opta=$2&optb=$3&optc=$4&optd=$5 RewriteRule ^([a-z|0-9]+)/(.+)/(.+)/(.+)/$ ?page=$1&opta=$2&optb=$3&optc=$4 RewriteRule ^([a-z|0-9]+)/(.+)/(.+)/$ ?page=$1&opta=$2&optb=$3 RewriteRule ^([a-z|0-9]+)/(.+)/$ ?page=$1&opta=$2 diff --git a/html/graph.php b/html/graph.php index d2e15ea0da..4f39e82e89 100644 --- a/html/graph.php +++ b/html/graph.php @@ -1,85 +1,5 @@ ".$rrd_cmd.""); } -# $thing = popen($config['rrdtool'] . " -",'w'); -# fputs($thing, "graph $graphfile $rrd_options"); -# pclose($thing); - if(is_file($graphfile)) { - header('Content-type: image/png'); - $fd = fopen($graphfile,'r');fpassthru($fd);fclose($fd); - unlink($graphfile); - } else { - header('Content-type: image/png'); - $string = "Graph Generation Error"; - $im = imagecreate($width, $height); - $orange = imagecolorallocate($im, 255, 255, 255); - $px = (imagesx($im) - 7.5 * strlen($string)) / 2; - imagestring($im, 3, $px, $height / 2 - 8, $string, imagecolorallocate($im, 128, 0, 0)); - imagepng($im); - imagedestroy($im); - } - } - - +include("includes/graphs/graph.inc.php"); ?> diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php index 7b88623f16..1578389d81 100644 --- a/html/includes/functions.inc.php +++ b/html/includes/functions.inc.php @@ -49,17 +49,20 @@ function generatedevicelink($device, $text=0, $start=0, $end=0) } $url = $config['base_url']."/device/" . $device['device_id'] . "/"; - $contents = "
".$device['hostname'] . " - $descr
"; + $contents = "
".$device['hostname']; + if($device['hardware']) { $contents .= " - ".$device['hardware']; } + $contents .= "
"; + $contents .= "
"; if($device['os']) { $contents .= $config['os'][$device['os']]['text']; } if($device['version']) { $contents .= " ".$device['version']; } if($device['features']) { $contents .= " (".$device['features'].")"; } - if($device['hardware']) { $contents .= " - ".$device['hardware']; } +# if($device['hardware']) { $contents .= " - ".$device['hardware']; } $contents .= "
"; - if (isset($device['location'])) { $contents .= "" . htmlentities($device['location'])."
"; } +# if (isset($device['location'])) { $contents .= "" . htmlentities($device['location'])."
"; } foreach ($graphs as $entry) { $graph = $entry['graph']; @@ -204,6 +207,8 @@ function generate_if_link($args, $text = NULL) $args = ifNameDescr($args); if(!$text) { $text = fixIfName($args['label']); } if(!$args['graph_type']) { $args['graph_type'] = 'port_bits'; } + + $class = ifclass($args['ifOperStatus'], $args['ifAdminStatus']); if(!isset($args['hostname'])) { $args = array_merge($args, device_by_id_cache($args['device_id'])); } @@ -238,7 +243,7 @@ function generate_if_link($args, $text = NULL) function generate_port_thumbnail($args) { if(!$args['bg']) { $args['bg'] = "FFFFF"; } - $args['content'] = ""; + $args['content'] = ""; $output = generate_if_link($args, $args['content']); echo $output; } diff --git a/html/includes/graphs/XXX_device_memory_windows.inc.php b/html/includes/graphs/XXX_device_memory_windows.inc.php index 8895344dee..d0650b5853 100644 --- a/html/includes/graphs/XXX_device_memory_windows.inc.php +++ b/html/includes/graphs/XXX_device_memory_windows.inc.php @@ -1,6 +1,6 @@ diff --git a/html/includes/graphs/atmvp/bits.inc.php b/html/includes/graphs/atmvp/bits.inc.php new file mode 100644 index 0000000000..e69de29bb2 diff --git a/html/includes/graphs/atmvp_cells.inc.php b/html/includes/graphs/atmvp/cells.inc.php similarity index 100% rename from html/includes/graphs/atmvp_cells.inc.php rename to html/includes/graphs/atmvp/cells.inc.php diff --git a/html/includes/graphs/atmvp_errors.inc.php b/html/includes/graphs/atmvp/errors.inc.php similarity index 100% rename from html/includes/graphs/atmvp_errors.inc.php rename to html/includes/graphs/atmvp/errors.inc.php diff --git a/html/includes/graphs/atmvp_packets.inc.php b/html/includes/graphs/atmvp/packets.inc.php similarity index 100% rename from html/includes/graphs/atmvp_packets.inc.php rename to html/includes/graphs/atmvp/packets.inc.php diff --git a/html/includes/graphs/atmvp_bits.inc.php b/html/includes/graphs/atmvp_bits.inc.php deleted file mode 100644 index 4000cccc4a..0000000000 --- a/html/includes/graphs/atmvp_bits.inc.php +++ /dev/null @@ -1,22 +0,0 @@ - diff --git a/html/includes/graphs/cbgp_prefixes.inc.php b/html/includes/graphs/bgp/cbgp_prefixes.inc.php similarity index 100% rename from html/includes/graphs/cbgp_prefixes.inc.php rename to html/includes/graphs/bgp/cbgp_prefixes.inc.php diff --git a/html/includes/graphs/bgp_updates.inc.php b/html/includes/graphs/bgp/updates.inc.php similarity index 100% rename from html/includes/graphs/bgp_updates.inc.php rename to html/includes/graphs/bgp/updates.inc.php diff --git a/html/includes/graphs/cempMemPool.inc.php b/html/includes/graphs/cempMemPool.inc.php deleted file mode 100644 index a610125f01..0000000000 --- a/html/includes/graphs/cempMemPool.inc.php +++ /dev/null @@ -1,35 +0,0 @@ - diff --git a/html/includes/graphs/cisco_entity_sensor.inc.php b/html/includes/graphs/cisco_entity_sensor.inc.php index 2dd83ba5d1..b1be699638 100644 --- a/html/includes/graphs/cisco_entity_sensor.inc.php +++ b/html/includes/graphs/cisco_entity_sensor.inc.php @@ -11,7 +11,7 @@ case 'amperes': break; } -include("common.inc.php"); +include("includes/graphs/common.inc.php"); $rrd_filename = $config['rrd_dir'] . "/" . $sensor['hostname'] . "/" . safename("ces-" . $sensor['entPhysicalIndex'] . ".rrd"); diff --git a/html/includes/graphs/cmpMemPool.inc.php b/html/includes/graphs/cmpMemPool.inc.php deleted file mode 100755 index 07b9e4d90d..0000000000 --- a/html/includes/graphs/cmpMemPool.inc.php +++ /dev/null @@ -1,29 +0,0 @@ - diff --git a/html/includes/graphs/customer_bits.inc.php b/html/includes/graphs/customer/bits.inc.php similarity index 92% rename from html/includes/graphs/customer_bits.inc.php rename to html/includes/graphs/customer/bits.inc.php index 1e34b17189..344d4fd916 100644 --- a/html/includes/graphs/customer_bits.inc.php +++ b/html/includes/graphs/customer/bits.inc.php @@ -17,6 +17,6 @@ $colour_line_out = "000099"; $colour_area_in = "CDEB8B"; $colour_area_out = "C3D9FF"; -include ("generic_multi_bits.inc.php"); +include ("includes/graphs/generic_multi_bits.inc.php"); ?> diff --git a/html/includes/graphs/device_bits.inc.php b/html/includes/graphs/device/bits.inc.php similarity index 95% rename from html/includes/graphs/device_bits.inc.php rename to html/includes/graphs/device/bits.inc.php index befffad48b..b47b73801f 100644 --- a/html/includes/graphs/device_bits.inc.php +++ b/html/includes/graphs/device/bits.inc.php @@ -36,6 +36,6 @@ $colour_line_out = "000099"; $colour_area_in = "CDEB8B"; $colour_area_out = "C3D9FF"; -include ("generic_multi_bits.inc.php"); +include ("includes/graphs/generic_multi_bits.inc.php"); ?> diff --git a/html/includes/graphs/device_cpu.inc.php b/html/includes/graphs/device/cpu.inc.php similarity index 92% rename from html/includes/graphs/device_cpu.inc.php rename to html/includes/graphs/device/cpu.inc.php index b9fb212b1a..021e558262 100644 --- a/html/includes/graphs/device_cpu.inc.php +++ b/html/includes/graphs/device/cpu.inc.php @@ -32,7 +32,7 @@ $scale_max = "100"; $nototal = 1; if ($rrd_list) { - include ("generic_multi_line.inc.php"); + include ("includes/graphs/generic_multi_line.inc.php"); } ?> diff --git a/html/includes/graphs/device_cpu_powerconnect.inc.php b/html/includes/graphs/device/cpu_powerconnect.inc.php similarity index 94% rename from html/includes/graphs/device_cpu_powerconnect.inc.php rename to html/includes/graphs/device/cpu_powerconnect.inc.php index 571a6a1705..db1a3bf7cb 100644 --- a/html/includes/graphs/device_cpu_powerconnect.inc.php +++ b/html/includes/graphs/device/cpu_powerconnect.inc.php @@ -13,7 +13,8 @@ $scale_max = "100"; $nototal = 1; -include("common.inc.php"); +include("includes/graphs/common.inc.php"); + $database = $config['rrd_dir'] . "/" . $device['hostname'] . "/powerconnect-cpu.rrd"; $rrd_options .= " DEF:load=$database:LOAD:AVERAGE"; diff --git a/html/includes/graphs/device_cpu_procurve.inc.php b/html/includes/graphs/device/cpu_procurve.inc.php similarity index 94% rename from html/includes/graphs/device_cpu_procurve.inc.php rename to html/includes/graphs/device/cpu_procurve.inc.php index cd95223a6a..a30f820376 100644 --- a/html/includes/graphs/device_cpu_procurve.inc.php +++ b/html/includes/graphs/device/cpu_procurve.inc.php @@ -13,7 +13,8 @@ $scale_max = "100"; $nototal = 1; -include("common.inc.php"); +include("includes/graphs/common.inc.php"); + $database = $config['rrd_dir'] . "/" . $device['hostname'] . "/procurve-cpu.rrd"; $rrd_options .= " DEF:load=$database:LOAD:AVERAGE"; diff --git a/html/includes/graphs/device_cpu_unix.inc.php b/html/includes/graphs/device/cpu_unix.inc.php similarity index 96% rename from html/includes/graphs/device_cpu_unix.inc.php rename to html/includes/graphs/device/cpu_unix.inc.php index 4ffc0fb01d..e9bf31442e 100644 --- a/html/includes/graphs/device_cpu_unix.inc.php +++ b/html/includes/graphs/device/cpu_unix.inc.php @@ -34,10 +34,10 @@ $nototal = 1; if ($rrd_list) { -include ("generic_multi_line.inc.php"); +include ("includes/graphs/generic_multi_line.inc.php"); } else { - include("common.inc.php"); + include("includes/graphs/common.inc.php"); $rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . "ucd_cpu.rrd"; $rrd_options .= " DEF:user=$rrd_filename:user:AVERAGE"; $rrd_options .= " DEF:nice=$rrd_filename:nice:AVERAGE"; diff --git a/html/includes/graphs/device_current.inc.php b/html/includes/graphs/device/current.inc.php similarity index 100% rename from html/includes/graphs/device_current.inc.php rename to html/includes/graphs/device/current.inc.php diff --git a/html/includes/graphs/device/diskio.inc.php b/html/includes/graphs/device/diskio.inc.php new file mode 100644 index 0000000000..8c195c1247 --- /dev/null +++ b/html/includes/graphs/device/diskio.inc.php @@ -0,0 +1,5 @@ + diff --git a/html/includes/graphs/device_diskio_bits.inc.php b/html/includes/graphs/device/diskio_bits.inc.php similarity index 92% rename from html/includes/graphs/device_diskio_bits.inc.php rename to html/includes/graphs/device/diskio_bits.inc.php index 306938c59c..05bdd2d5ba 100755 --- a/html/includes/graphs/device_diskio_bits.inc.php +++ b/html/includes/graphs/device/diskio_bits.inc.php @@ -30,6 +30,6 @@ $nototal = 1; $rra_in = "read"; $rra_out = "written"; -include ("generic_multi_bits_separated.inc.php"); +include ("includes/graphs/generic_multi_bits_separated.inc.php"); ?> diff --git a/html/includes/graphs/device_diskio_ops.inc.php b/html/includes/graphs/device/diskio_ops.inc.php similarity index 92% rename from html/includes/graphs/device_diskio_ops.inc.php rename to html/includes/graphs/device/diskio_ops.inc.php index 7829189bcc..59f91e6a52 100755 --- a/html/includes/graphs/device_diskio_ops.inc.php +++ b/html/includes/graphs/device/diskio_ops.inc.php @@ -30,6 +30,6 @@ $colours_out = 'blues'; $nototal = 1; -include ("generic_multi_seperated.inc.php"); +include ("includes/graphs/generic_multi_seperated.inc.php"); ?> diff --git a/html/includes/graphs/device_fanspeeds.inc.php b/html/includes/graphs/device/fanspeeds.inc.php similarity index 100% rename from html/includes/graphs/device_fanspeeds.inc.php rename to html/includes/graphs/device/fanspeeds.inc.php diff --git a/html/includes/graphs/device_frequencies.inc.php b/html/includes/graphs/device/frequencies.inc.php similarity index 100% rename from html/includes/graphs/device_frequencies.inc.php rename to html/includes/graphs/device/frequencies.inc.php diff --git a/html/includes/graphs/device_hrprocesses.inc.php b/html/includes/graphs/device/hrprocesses.inc.php similarity index 100% rename from html/includes/graphs/device_hrprocesses.inc.php rename to html/includes/graphs/device/hrprocesses.inc.php diff --git a/html/includes/graphs/device_hrusers.inc.php b/html/includes/graphs/device/hrusers.inc.php similarity index 100% rename from html/includes/graphs/device_hrusers.inc.php rename to html/includes/graphs/device/hrusers.inc.php diff --git a/html/includes/graphs/device_humidity.inc.php b/html/includes/graphs/device/humidity.inc.php similarity index 100% rename from html/includes/graphs/device_humidity.inc.php rename to html/includes/graphs/device/humidity.inc.php diff --git a/html/includes/graphs/device_icmp.inc.php b/html/includes/graphs/device/icmp.inc.php similarity index 100% rename from html/includes/graphs/device_icmp.inc.php rename to html/includes/graphs/device/icmp.inc.php diff --git a/html/includes/graphs/device_icmp_informational.inc.php b/html/includes/graphs/device/icmp_informational.inc.php similarity index 98% rename from html/includes/graphs/device_icmp_informational.inc.php rename to html/includes/graphs/device/icmp_informational.inc.php index 9322957d71..0d5a0b6d36 100644 --- a/html/includes/graphs/device_icmp_informational.inc.php +++ b/html/includes/graphs/device/icmp_informational.inc.php @@ -1,6 +1,6 @@ diff --git a/html/includes/graphs/device_snmp_packets.inc.php b/html/includes/graphs/device/snmp_packets.inc.php similarity index 100% rename from html/includes/graphs/device_snmp_packets.inc.php rename to html/includes/graphs/device/snmp_packets.inc.php diff --git a/html/includes/graphs/device_snmp_statistics.inc.php b/html/includes/graphs/device/snmp_statistics.inc.php similarity index 100% rename from html/includes/graphs/device_snmp_statistics.inc.php rename to html/includes/graphs/device/snmp_statistics.inc.php diff --git a/html/includes/graphs/device_storage.inc.php b/html/includes/graphs/device/storage.inc.php similarity index 100% rename from html/includes/graphs/device_storage.inc.php rename to html/includes/graphs/device/storage.inc.php diff --git a/html/includes/graphs/device_tcp.inc.php b/html/includes/graphs/device/tcp.inc.php similarity index 100% rename from html/includes/graphs/device_tcp.inc.php rename to html/includes/graphs/device/tcp.inc.php diff --git a/html/includes/graphs/device_temperatures.inc.php b/html/includes/graphs/device/temperatures.inc.php similarity index 100% rename from html/includes/graphs/device_temperatures.inc.php rename to html/includes/graphs/device/temperatures.inc.php diff --git a/html/includes/graphs/device_toner.inc.php b/html/includes/graphs/device/toner.inc.php similarity index 100% rename from html/includes/graphs/device_toner.inc.php rename to html/includes/graphs/device/toner.inc.php diff --git a/html/includes/graphs/device_udp.inc.php b/html/includes/graphs/device/udp.inc.php similarity index 100% rename from html/includes/graphs/device_udp.inc.php rename to html/includes/graphs/device/udp.inc.php diff --git a/html/includes/graphs/device_uptime.inc.php b/html/includes/graphs/device/uptime.inc.php similarity index 100% rename from html/includes/graphs/device_uptime.inc.php rename to html/includes/graphs/device/uptime.inc.php diff --git a/html/includes/graphs/device_voltages.inc.php b/html/includes/graphs/device/voltages.inc.php similarity index 100% rename from html/includes/graphs/device_voltages.inc.php rename to html/includes/graphs/device/voltages.inc.php diff --git a/html/includes/graphs/device_wificlients.inc.php b/html/includes/graphs/device/wificlients.inc.php similarity index 100% rename from html/includes/graphs/device_wificlients.inc.php rename to html/includes/graphs/device/wificlients.inc.php diff --git a/html/includes/graphs/device_diskio.inc.php b/html/includes/graphs/device_diskio.inc.php deleted file mode 100644 index 7fdad93071..0000000000 --- a/html/includes/graphs/device_diskio.inc.php +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/html/includes/graphs/diskio_bits.inc.php b/html/includes/graphs/diskio/bits.inc.php similarity index 100% rename from html/includes/graphs/diskio_bits.inc.php rename to html/includes/graphs/diskio/bits.inc.php diff --git a/html/includes/graphs/diskio_ops.inc.php b/html/includes/graphs/diskio/ops.inc.php similarity index 100% rename from html/includes/graphs/diskio_ops.inc.php rename to html/includes/graphs/diskio/ops.inc.php diff --git a/html/includes/graphs/generic_bits.inc.php b/html/includes/graphs/generic_bits.inc.php index 443e0b7600..12e283c8b9 100644 --- a/html/includes/graphs/generic_bits.inc.php +++ b/html/includes/graphs/generic_bits.inc.php @@ -3,7 +3,7 @@ /// Draw generic bits graph /// args: rra_in, rra_out, rrd_filename, bg, legend, from, to, width, height, inverse -include("common.inc.php"); +include("includes/graphs/common.inc.php"); if($inverse) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; } diff --git a/html/includes/graphs/generic_duplex.inc.php b/html/includes/graphs/generic_duplex.inc.php index f7ccab7aef..9d5ba89a8f 100644 --- a/html/includes/graphs/generic_duplex.inc.php +++ b/html/includes/graphs/generic_duplex.inc.php @@ -3,7 +3,7 @@ /// Draw generic bits graph /// args: rra_in, rra_out, rrd_filename, bg, legend, from, to, width, height, inverse, $percentile -include("common.inc.php"); +include("includes/graphs/common.inc.php"); $unit_text = str_pad(truncate($unit_text,10),10); diff --git a/html/includes/graphs/generic_multi_bits.inc.php b/html/includes/graphs/generic_multi_bits.inc.php index d19d58f9ad..1b050111dc 100644 --- a/html/includes/graphs/generic_multi_bits.inc.php +++ b/html/includes/graphs/generic_multi_bits.inc.php @@ -3,7 +3,7 @@ /// Draws aggregate bits graph from multiple RRDs /// Variables : colour_[line|area]_[in|out], rrd_filenames -include("common.inc.php"); +include("includes/graphs/common.inc.php"); $i=0; foreach($rrd_filenames as $rrd_filename) { diff --git a/html/includes/graphs/generic_multi_bits_separated.inc.php b/html/includes/graphs/generic_multi_bits_separated.inc.php index 7ded1e2fcc..a4718a3895 100644 --- a/html/includes/graphs/generic_multi_bits_separated.inc.php +++ b/html/includes/graphs/generic_multi_bits_separated.inc.php @@ -1,6 +1,6 @@ [A-Za-z0-9]+)_(?P.+)/', mres($_GET['type']), $graphtype); + + $type = $graphtype['type']; + $subtype = $graphtype['subtype']; + + if($debug) {print_r($graphtype);} + + $from = mres($_GET['from']); + $to = mres($_GET['to']); + $width = mres($_GET['width']); + $height = mres($_GET['height']); + $title = mres($_GET['title']); + $vertical = mres($_GET['vertical']); + $legend = mres($_GET['legend']); + $id = mres($_GET['id']); + + $graphfile = $config['temp_dir'] . "/" . strgen() . ".png"; + + $os = gethostosbyid($device_id); + if($config['os'][$os]['group']) {$os_group = $config['os'][$os]['group'];} + +# if(is_file($config['install_dir'] . "/html/includes/graphs/".$type."_".$os.".inc.php")) { +# /// Type + OS Specific +# include($config['install_dir'] . "/html/includes/graphs/".$type."_".$os.".inc.php"); +# }elseif($os_group && is_file($config['install_dir'] . "/html/includes/graphs/".$type."_".$os_group.".inc.php")) { +# /// Type + OS Group Specific +# include($config['install_dir'] . "/html/includes/graphs/".$type."_".$os_group.".inc.php"); +# } elseif(is_file($config['install_dir'] . "/html/includes/graphs/$type.inc.php")) { +# /// Type Specific +# include($config['install_dir'] . "/html/includes/graphs/$type.inc.php"); +# } + +if(is_file($config['install_dir'] . "/html/includes/graphs/$type/$subtype.inc.php")) { + include($config['install_dir'] . "/html/includes/graphs/$type/$subtype.inc.php"); +} + + + if($rrd_options) { + + if($config['rrdcached']) { $rrd_switches = " --daemon ".$config['rrdcached'] . " "; } + $rrd_cmd = $config['rrdtool'] . " graph $graphfile $rrd_options" . $rrd_switches; + $woo = shell_exec($rrd_cmd); + if($_GET['debug']) { echo("
".$rrd_cmd."
"); } +# $thing = popen($config['rrdtool'] . " -",'w'); +# fputs($thing, "graph $graphfile $rrd_options"); +# pclose($thing); + if(is_file($graphfile)) { + header('Content-type: image/png'); + $fd = fopen($graphfile,'r');fpassthru($fd);fclose($fd); + unlink($graphfile); + } else { + header('Content-type: image/png'); + $string = "Graph Generation Error"; + $im = imagecreate($width, $height); + $orange = imagecolorallocate($im, 255, 255, 255); + $px = (imagesx($im) - 7.5 * strlen($string)) / 2; + imagestring($im, 3, $px, $height / 2 - 8, $string, imagecolorallocate($im, 128, 0, 0)); + imagepng($im); + imagedestroy($im); + } + } + + + +?> diff --git a/html/includes/graphs/mempool.inc.php b/html/includes/graphs/mempool/usage.inc.php similarity index 100% rename from html/includes/graphs/mempool.inc.php rename to html/includes/graphs/mempool/usage.inc.php diff --git a/html/includes/graphs/multi_bits_separate.inc.php b/html/includes/graphs/multi_bits_separate.inc.php index dece7ada25..49025e7290 100644 --- a/html/includes/graphs/multi_bits_separate.inc.php +++ b/html/includes/graphs/multi_bits_separate.inc.php @@ -2,7 +2,7 @@ function graph_multi_bits ($args) { - include("common.inc.php"); + include("includes/graphs/common.inc.php"); $i = 1; $options .= " COMMENT:' In\: Current Maximum '"; if(!$args['nototal']) {$options .= " COMMENT:'Total '";} diff --git a/html/includes/graphs/port_adsl_attainable.inc.php b/html/includes/graphs/port/adsl_attainable.inc.php similarity index 94% rename from html/includes/graphs/port_adsl_attainable.inc.php rename to html/includes/graphs/port/adsl_attainable.inc.php index 204590e956..370b4fe77f 100644 --- a/html/includes/graphs/port_adsl_attainable.inc.php +++ b/html/includes/graphs/port/adsl_attainable.inc.php @@ -33,7 +33,7 @@ $scale_min = "0"; $nototal = 1; if ($rrd_list) { - include ("generic_multi_line.inc.php"); + include ("includes/graphs/generic_multi_line.inc.php"); } ?> diff --git a/html/includes/graphs/port_adsl_attenuation.inc.php b/html/includes/graphs/port/adsl_attenuation.inc.php similarity index 94% rename from html/includes/graphs/port_adsl_attenuation.inc.php rename to html/includes/graphs/port/adsl_attenuation.inc.php index 5fb91318da..359053442d 100644 --- a/html/includes/graphs/port_adsl_attenuation.inc.php +++ b/html/includes/graphs/port/adsl_attenuation.inc.php @@ -32,7 +32,7 @@ $scale_min = "0"; $nototal = 1; if ($rrd_list) { - include ("generic_multi_line.inc.php"); + include ("includes/graphs/generic_multi_line.inc.php"); } ?> diff --git a/html/includes/graphs/port_adsl_power.inc.php b/html/includes/graphs/port/adsl_power.inc.php similarity index 94% rename from html/includes/graphs/port_adsl_power.inc.php rename to html/includes/graphs/port/adsl_power.inc.php index a81bc22859..a714664114 100644 --- a/html/includes/graphs/port_adsl_power.inc.php +++ b/html/includes/graphs/port/adsl_power.inc.php @@ -32,7 +32,7 @@ $scale_min = "0"; $nototal = 1; if ($rrd_list) { - include ("generic_multi_line.inc.php"); + include ("includes/graphs/generic_multi_line.inc.php"); } ?> diff --git a/html/includes/graphs/port_adsl_snr.inc.php b/html/includes/graphs/port/adsl_snr.inc.php similarity index 94% rename from html/includes/graphs/port_adsl_snr.inc.php rename to html/includes/graphs/port/adsl_snr.inc.php index 6d7d0bb418..981dbf7cc8 100644 --- a/html/includes/graphs/port_adsl_snr.inc.php +++ b/html/includes/graphs/port/adsl_snr.inc.php @@ -32,7 +32,7 @@ $scale_min = "0"; $nototal = 1; if ($rrd_list) { - include ("generic_multi_line.inc.php"); + include ("includes/graphs/generic_multi_line.inc.php"); } ?> diff --git a/html/includes/graphs/port_adsl_speed.inc.php b/html/includes/graphs/port/adsl_speed.inc.php similarity index 94% rename from html/includes/graphs/port_adsl_speed.inc.php rename to html/includes/graphs/port/adsl_speed.inc.php index 2b18fa3d59..c0286fe69b 100644 --- a/html/includes/graphs/port_adsl_speed.inc.php +++ b/html/includes/graphs/port/adsl_speed.inc.php @@ -33,7 +33,7 @@ $scale_min = "0"; $nototal = 1; if ($rrd_list) { - include ("generic_multi_line.inc.php"); + include ("includes/graphs/generic_multi_line.inc.php"); } ?> diff --git a/html/includes/graphs/port_bits.inc.php b/html/includes/graphs/port/bits.inc.php similarity index 100% rename from html/includes/graphs/port_bits.inc.php rename to html/includes/graphs/port/bits.inc.php diff --git a/html/includes/graphs/port_errors.inc.php b/html/includes/graphs/port/errors.inc.php similarity index 100% rename from html/includes/graphs/port_errors.inc.php rename to html/includes/graphs/port/errors.inc.php diff --git a/html/includes/graphs/port_etherlike.inc.php b/html/includes/graphs/port/etherlike.inc.php similarity index 94% rename from html/includes/graphs/port_etherlike.inc.php rename to html/includes/graphs/port/etherlike.inc.php index 3ac1921010..5faed2325d 100644 --- a/html/includes/graphs/port_etherlike.inc.php +++ b/html/includes/graphs/port/etherlike.inc.php @@ -29,7 +29,7 @@ $colours = "mixed"; $nototal = 1; $unit_text = "Errors"; -include ("generic_multi_simplex_seperated.inc.php"); +include ("includes/graphs/generic_multi_simplex_seperated.inc.php"); diff --git a/html/includes/graphs/fanspeed.inc.php b/html/includes/graphs/port/fanspeed.inc.php similarity index 100% rename from html/includes/graphs/fanspeed.inc.php rename to html/includes/graphs/port/fanspeed.inc.php diff --git a/html/includes/graphs/mac_acc_bits.inc.php b/html/includes/graphs/port/mac_acc_bits.inc.php similarity index 100% rename from html/includes/graphs/mac_acc_bits.inc.php rename to html/includes/graphs/port/mac_acc_bits.inc.php diff --git a/html/includes/graphs/mac_acc_pkts.inc.php b/html/includes/graphs/port/mac_acc_pkts.inc.php similarity index 100% rename from html/includes/graphs/mac_acc_pkts.inc.php rename to html/includes/graphs/port/mac_acc_pkts.inc.php diff --git a/html/includes/graphs/mac_acc_total.inc.php b/html/includes/graphs/port/mac_acc_total.inc.php similarity index 100% rename from html/includes/graphs/mac_acc_total.inc.php rename to html/includes/graphs/port/mac_acc_total.inc.php diff --git a/html/includes/graphs/port_nupkts.inc.php b/html/includes/graphs/port/nupkts.inc.php similarity index 94% rename from html/includes/graphs/port_nupkts.inc.php rename to html/includes/graphs/port/nupkts.inc.php index 0dbf41d789..06ac45612e 100644 --- a/html/includes/graphs/port_nupkts.inc.php +++ b/html/includes/graphs/port/nupkts.inc.php @@ -38,7 +38,7 @@ if(is_file($config['rrd_dir'] . "/" . $port['hostname'] . "/ifx-" . safename($po $nototal = 1; - include ("generic_multi_seperated.inc.php"); + include ("includes/graphs/generic_multi_seperated.inc.php"); } elseif(is_file($config['rrd_dir'] . "/" . $port['hostname'] . "/" . safename($port['ifIndex'] . ".rrd"))) @@ -60,7 +60,7 @@ elseif(is_file($config['rrd_dir'] . "/" . $port['hostname'] . "/" . safename($po $graph_max = 1; - include("generic_duplex.inc.php"); + include("includes/graphs/generic_duplex.inc.php"); } diff --git a/html/includes/graphs/pagp_bits.inc.php b/html/includes/graphs/port/pagp_bits.inc.php similarity index 92% rename from html/includes/graphs/pagp_bits.inc.php rename to html/includes/graphs/port/pagp_bits.inc.php index 9ada1447f3..1840a1da79 100644 --- a/html/includes/graphs/pagp_bits.inc.php +++ b/html/includes/graphs/port/pagp_bits.inc.php @@ -25,7 +25,7 @@ $nototal = 1; $rra_in = "INOCTETS"; $rra_out = "OUTOCTETS"; -include ("generic_multi_bits_separated.inc.php"); +include ("includes/graphs/generic_multi_bits_separated.inc.php"); diff --git a/html/includes/graphs/port_upkts.inc.php b/html/includes/graphs/port/upkts.inc.php similarity index 100% rename from html/includes/graphs/port_upkts.inc.php rename to html/includes/graphs/port/upkts.inc.php diff --git a/html/includes/graphs/processor.inc.php b/html/includes/graphs/processor/usage.inc.php similarity index 100% rename from html/includes/graphs/processor.inc.php rename to html/includes/graphs/processor/usage.inc.php diff --git a/html/includes/graphs/current.inc.php b/html/includes/graphs/sensor/current.inc.php similarity index 100% rename from html/includes/graphs/current.inc.php rename to html/includes/graphs/sensor/current.inc.php diff --git a/html/includes/graphs/frequency.inc.php b/html/includes/graphs/sensor/frequency.inc.php similarity index 100% rename from html/includes/graphs/frequency.inc.php rename to html/includes/graphs/sensor/frequency.inc.php diff --git a/html/includes/graphs/humidity.inc.php b/html/includes/graphs/sensor/humidity.inc.php similarity index 100% rename from html/includes/graphs/humidity.inc.php rename to html/includes/graphs/sensor/humidity.inc.php diff --git a/html/includes/graphs/temperature.inc.php b/html/includes/graphs/sensor/temperature.inc.php similarity index 100% rename from html/includes/graphs/temperature.inc.php rename to html/includes/graphs/sensor/temperature.inc.php diff --git a/html/includes/graphs/voltage.inc.php b/html/includes/graphs/sensor/voltage.inc.php similarity index 100% rename from html/includes/graphs/voltage.inc.php rename to html/includes/graphs/sensor/voltage.inc.php diff --git a/html/includes/graphs/service.inc.php b/html/includes/graphs/service.inc.php index 1c0f86d3e2..7be4f37478 100755 --- a/html/includes/graphs/service.inc.php +++ b/html/includes/graphs/service.inc.php @@ -3,7 +3,7 @@ $scale_min = "0"; $scale_max = "1"; -include("common.inc.php"); +include("includes/graphs/common.inc.php"); $iter = "1"; diff --git a/html/includes/graphs/storage.inc.php b/html/includes/graphs/storage/usage.inc.php similarity index 100% rename from html/includes/graphs/storage.inc.php rename to html/includes/graphs/storage/usage.inc.php diff --git a/html/includes/print-device-graph.php b/html/includes/print-device-graph.php index 5a38d69cb3..f0675b9831 100644 --- a/html/includes/print-device-graph.php +++ b/html/includes/print-device-graph.php @@ -27,12 +27,17 @@ $yearly_url = "graph.php?device=" . $device['device_id'] . "&type=$graph_type&from=".$config['year']."&to=".$config['now']."&width=400&height=150"; $yearly_url .= $args; - echo("', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"> - "); + $graph_args = $device['device_id'] . "/" . $graph_type . "/"; + + echo("', LEFT".$config['overlib_defaults'].");\" + onmouseout=\"return nd();\"> "); + echo("', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"> "); + echo("', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"> "); + echo("', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"> "); diff --git a/html/pages/device/health/current.inc.php b/html/pages/device/health/current.inc.php index 8c71988b2e..12e8d61c2a 100644 --- a/html/pages/device/health/current.inc.php +++ b/html/pages/device/health/current.inc.php @@ -19,7 +19,7 @@ while($current = mysql_fetch_array($query)) { \n"); echo(""); - $graph_type = "current"; + $graph_type = "sensor_current"; // start current graphs diff --git a/html/pages/device/health/diskio.inc.php b/html/pages/device/health/diskio.inc.php index 43aeaed647..54588e6ba5 100644 --- a/html/pages/device/health/diskio.inc.php +++ b/html/pages/device/health/diskio.inc.php @@ -29,7 +29,7 @@ while($drive = mysql_fetch_array($query)) { $fs_url = "/device/".$device['device_id']."/health/diskio/"; $fs_popup = "onmouseover=\"return overlib('
".$device['hostname']." - ".$drive['diskio_descr']; - $fs_popup .= "
"; + $fs_popup .= ""; $fs_popup .= "', RIGHT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\""; if($perc > '90') { $left_background='c4323f'; $right_background='C96A73'; diff --git a/html/pages/device/health/fanspeeds.inc.php b/html/pages/device/health/fanspeeds.inc.php index b12175729b..916e8b3688 100644 --- a/html/pages/device/health/fanspeeds.inc.php +++ b/html/pages/device/health/fanspeeds.inc.php @@ -19,7 +19,7 @@ while($fan = mysql_fetch_array($query)) { \n"); echo(""); - $graph_type = "fanspeed"; + $graph_type = "sensor_fanspeed"; // start fanspeed graphs diff --git a/html/pages/device/health/frequencies.inc.php b/html/pages/device/health/frequencies.inc.php index b69f8dfa1f..eb44dbaee6 100644 --- a/html/pages/device/health/frequencies.inc.php +++ b/html/pages/device/health/frequencies.inc.php @@ -19,7 +19,7 @@ while($freq = mysql_fetch_array($query)) { \n"); echo(""); - $graph_type = "frequency"; + $graph_type = "sensor_frequency"; // start frequency graphs @@ -55,4 +55,4 @@ while($freq = mysql_fetch_array($query)) { echo(""); -?> \ No newline at end of file +?> diff --git a/html/pages/device/health/humidity.inc.php b/html/pages/device/health/humidity.inc.php index 9deb032495..dee94c931c 100644 --- a/html/pages/device/health/humidity.inc.php +++ b/html/pages/device/health/humidity.inc.php @@ -19,7 +19,7 @@ while($humidity = mysql_fetch_array($query)) { \n"); echo(""); - $graph_type = "humidity"; + $graph_type = "sensor_humidity"; // start humidity graphs diff --git a/html/pages/device/health/memory.inc.php b/html/pages/device/health/memory.inc.php index 79f3ad6e6b..a02cf06b7b 100644 --- a/html/pages/device/health/memory.inc.php +++ b/html/pages/device/health/memory.inc.php @@ -1,4 +1,6 @@ "); echo(""); @@ -12,10 +14,10 @@ $text_descr = rewrite_entity_descr($mempool['mempool_descr']); $mempool_url = "/device/".$device['device_id']."/health/memory/"; - $mini_url = $config['base_url'] . "/graph.php?id=".$mempool['mempool_id']."&type=mempool&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; + $mini_url = $config['base_url'] . "/graph.php?id=".$mempool['mempool_id']."&type=".$graph_type."&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; $mempool_popup = "onmouseover=\"return overlib('
".$device['hostname']." - ".$text_descr; - $mempool_popup .= "
"; + $mempool_popup .= ""; $mempool_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\""; $total = formatStorage($mempool['mempool_total']); @@ -41,17 +43,17 @@ echo("\n"); echo("
"); - $daily_graph = "graph.php?id=" . $mempool['mempool_id'] . "&type=mempool&from=$day&to=$now&width=211&height=100"; - $daily_url = "graph.php?id=" . $mempool['mempool_id'] . "&type=mempool&from=$day&to=$now&width=400&height=150"; + $daily_graph = "graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$day&to=$now&width=211&height=100"; + $daily_url = "graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$day&to=$now&width=400&height=150"; - $weekly_graph = "graph.php?id=" . $mempool['mempool_id'] . "&type=mempool&from=$week&to=$now&width=211&height=100"; - $weekly_url = "graph.php?id=" . $mempool['mempool_id'] . "&type=mempool&from=$week&to=$now&width=400&height=150"; + $weekly_graph = "graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$week&to=$now&width=211&height=100"; + $weekly_url = "graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$week&to=$now&width=400&height=150"; - $monthly_graph = "graph.php?id=" . $mempool['mempool_id'] . "&type=mempool&from=$month&to=$now&width=211&height=100"; - $monthly_url = "graph.php?id=" . $mempool['mempool_id'] . "&type=mempool&from=$month&to=$now&width=400&height=150"; + $monthly_graph = "graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$month&to=$now&width=211&height=100"; + $monthly_url = "graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=150"; - $yearly_graph = "graph.php?id=" . $mempool['mempool_id'] . "&type=mempool&from=$year&to=$now&width=211&height=100"; - $yearly_url = "graph.php?id=" . $mempool['mempool_id'] . "&type=mempool&from=$year&to=$now&width=400&height=150"; + $yearly_graph = "graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$year&to=$now&width=211&height=100"; + $yearly_url = "graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$year&to=$now&width=400&height=150"; echo("', LEFT);\" onmouseout=\"return nd();\"> "); diff --git a/html/pages/device/health/processors.inc.php b/html/pages/device/health/processors.inc.php index 70eba76b6f..80c6c5fc3f 100644 --- a/html/pages/device/health/processors.inc.php +++ b/html/pages/device/health/processors.inc.php @@ -1,5 +1,7 @@ "); echo(""); $i = '1'; @@ -8,14 +10,14 @@ $proc_url = $config['base_url']."/device/".$device['device_id']."/health/processors/"; - $mini_url = $config['base_url'] . "/graph.php?id=".$proc['processor_id']."&type=processor&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; + $mini_url = $config['base_url'] . "/graph.php?id=".$proc['processor_id']."&type=".$graph_type."&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; $text_descr = $proc['processor_descr']; $text_descr = rewrite_entity_descr($text_descr); $proc_popup = "onmouseover=\"return overlib('
".$device['hostname']." - ".$text_descr; - $proc_popup .= "
"; + $proc_popup .= ""; $proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\""; $perc = round($proc['processor_usage']); @@ -36,17 +38,17 @@ echo(""); - $graph_type = "storage"; - // start temperature graphs $daily_temp = "graph.php?id=" . $drive['storage_id'] . "&type=$graph_type&from=$day&to=$now&width=212&height=100"; diff --git a/html/pages/device/health/temperatures.inc.php b/html/pages/device/health/temperatures.inc.php index 9b6daa535c..f2473b1d40 100644 --- a/html/pages/device/health/temperatures.inc.php +++ b/html/pages/device/health/temperatures.inc.php @@ -19,7 +19,7 @@ while($temp = mysql_fetch_array($query)) { \n"); echo("
"); - $daily_graph = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$day&to=$now&width=211&height=100"; - $daily_url = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$day&to=$now&width=400&height=150"; + $daily_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=211&height=100"; + $daily_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=400&height=150"; - $weekly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$week&to=$now&width=211&height=100"; - $weekly_url = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$week&to=$now&width=400&height=150"; + $weekly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=211&height=100"; + $weekly_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=400&height=150"; - $monthly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$month&to=$now&width=211&height=100"; - $monthly_url = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$month&to=$now&width=400&height=150"; + $monthly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=211&height=100"; + $monthly_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=150"; - $yearly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$year&to=$now&width=211&height=100"; - $yearly_url = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$year&to=$now&width=400&height=150"; + $yearly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=211&height=100"; + $yearly_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=400&height=150"; echo("', LEFT);\" onmouseout=\"return nd();\"> "); diff --git a/html/pages/device/health/storage.inc.php b/html/pages/device/health/storage.inc.php index 6ecea3ac72..2159d49964 100644 --- a/html/pages/device/health/storage.inc.php +++ b/html/pages/device/health/storage.inc.php @@ -1,5 +1,7 @@ ".$device['hostname']." - ".$drive['storage_descr']; - $fs_popup .= ""; + $fs_popup .= ""; $fs_popup .= "', RIGHT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\""; if($perc > '90') { $left_background='c4323f'; $right_background='C96A73'; @@ -43,8 +45,6 @@ while($drive = mysql_fetch_array($query)) { " . $free . "
"); - $graph_type = "temperature"; + $graph_type = "sensor_temperature"; // start temperature graphs @@ -55,4 +55,4 @@ while($temp = mysql_fetch_array($query)) { echo("
"); -?> \ No newline at end of file +?> diff --git a/html/pages/device/health/voltages.inc.php b/html/pages/device/health/voltages.inc.php index cc838684ac..6739ad62f2 100644 --- a/html/pages/device/health/voltages.inc.php +++ b/html/pages/device/health/voltages.inc.php @@ -19,7 +19,7 @@ while($volt = mysql_fetch_array($query)) {
"); - $graph_type = "voltage"; + $graph_type = "sensor_voltage"; // start voltage graphs diff --git a/html/pages/device/overview/current.inc.php b/html/pages/device/overview/current.inc.php index ecec1a4c60..1eb729f0a6 100644 --- a/html/pages/device/overview/current.inc.php +++ b/html/pages/device/overview/current.inc.php @@ -1,5 +1,7 @@ "; + $current_day = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100"; + $current_week = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100"; + $current_month = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100"; + $current_year = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=300&height=100"; + $current_minigraph = ""; $current_link = ""; + $fan_day = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100"; + $fan_week = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100"; + $fan_month = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100"; + $fan_year = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=300&height=100"; + $fan_minigraph = ""; $fan_link = ""; + $freq_day = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100"; + $freq_week = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100"; + $freq_month = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100"; + $freq_year = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$year&to=$now&width=300&height=100"; + $freq_minigraph = ""; $freq_link = ""; + $humidity_day = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100"; + $humidity_week = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100"; + $humidity_month = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100"; + $humidity_year = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=300&height=100"; + $humidity_minigraph = ""; $humidity_link = ""); echo("

Memory Pools

"); @@ -13,10 +15,10 @@ if(mysql_result(mysql_query("SELECT count(*) from mempools WHERE device_id = '" $text_descr = rewrite_entity_descr($mempool['mempool_descr']); $mempool_url = "/device/".$device['device_id']."/health/memory/"; - $mini_url = $config['base_url'] . "/graph.php?id=".$mempool['mempool_id']."&type=mempool&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; + $mini_url = $config['base_url'] . "/graph.php?id=".$mempool['mempool_id']."&type=".$graph_type."&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; $mempool_popup = "onmouseover=\"return overlib('
".$device['hostname']." - ".$text_descr; - $mempool_popup .= "
"; + $mempool_popup .= ""; $mempool_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\""; $total = formatStorage($mempool['mempool_total']); diff --git a/html/pages/device/overview/processors.inc.php b/html/pages/device/overview/processors.inc.php index 1eeb301382..75c53d9e1f 100644 --- a/html/pages/device/overview/processors.inc.php +++ b/html/pages/device/overview/processors.inc.php @@ -1,5 +1,7 @@ "); @@ -13,10 +15,10 @@ if(mysql_result(mysql_query("SELECT count(*) from processors WHERE device_id = ' $proc_url = $config['base_url'] . "/device/".$device['device_id']."/health/processors/"; $proc_popup = "onmouseover=\"return overlib('
".$device['hostname']." - ".$proc['processor_descr']; - $proc_popup .= "
"; + $proc_popup .= ""; $proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\""; - $mini_url = $config['base_url'] . "/graph.php?id=".$proc['processor_id']."&type=processor&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; + $mini_url = $config['base_url'] . "/graph.php?id=".$proc['processor_id']."&type=".$graph_type."&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; ## REPLACE THIS SHITTY CODE. IT IS ALSO ELSEWHERE. diff --git a/html/pages/device/overview/storage.inc.php b/html/pages/device/overview/storage.inc.php index 275ab8e759..ad05a02a0f 100644 --- a/html/pages/device/overview/storage.inc.php +++ b/html/pages/device/overview/storage.inc.php @@ -1,5 +1,7 @@ "); echo("

Storage

"); @@ -38,10 +40,10 @@ if(mysql_result(mysql_query("SELECT count(storage_id) from storage WHERE device_ $fs_url = "/device/".$device['device_id']."/health/storage/"; $fs_popup = "onmouseover=\"return overlib('
".$device['hostname']." - ".$drive['storage_descr']; - $fs_popup .= "
"; + $fs_popup .= ""; $fs_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\""; - $mini_graph = $config['base_url'] . "/graph.php?id=".$drive['storage_id']."&type=storage&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; + $mini_graph = $config['base_url'] . "/graph.php?id=".$drive['storage_id']."&type=".$graph_type."&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; diff --git a/html/pages/device/overview/temperatures.inc.php b/html/pages/device/overview/temperatures.inc.php index 26a46f2056..a0df738480 100644 --- a/html/pages/device/overview/temperatures.inc.php +++ b/html/pages/device/overview/temperatures.inc.php @@ -1,5 +1,7 @@ "; + $temp_day = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100"; + $temp_week = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100"; + $temp_month = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100"; + $temp_year = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=300&height=100"; + $temp_minigraph = ""; $temp_link = "
"; + $volt_day = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100"; + $volt_week = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100"; + $volt_month = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100"; + $volt_year = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=300&height=100"; + $volt_minigraph = ""; $volt_link = "= '5') { $sql = "SELECT * FROM `current` AS S, `devices` AS D, devices_perms as P WHERE S.sensor_class='current' AND S.device_id = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, S.sensor_descr"; } +$graph_type = "sensor_current"; + $query = mysql_query($sql); echo(''); @@ -27,18 +29,18 @@ while($current = mysql_fetch_array($query)) { if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } - $weekly_current = "graph.php?id=" . $current['sensor_id'] . "&type=current&from=$week&to=$now&width=500&height=150"; + $weekly_current = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=500&height=150"; $current_popup = "', LEFT);\" onmouseout=\"return nd();\"> " . $current['sensor_descr'] . ""; if($current['sensor_current'] >= $current['sensor_limit']) { $alert = 'alert'; } else { $alert = ""; } - $current_day = "graph.php?id=" . $current['sensor_id'] . "&type=current&from=$day&to=$now&width=300&height=100"; - $current_week = "graph.php?id=" . $current['sensor_id'] . "&type=current&from=$week&to=$now&width=300&height=100"; - $current_month = "graph.php?id=" . $current['sensor_id'] . "&type=current&from=$month&to=$now&width=300&height=100"; - $current_year = "graph.php?id=" . $current['sensor_id'] . "&type=current&from=$year&to=$now&width=300&height=100"; + $current_day = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100"; + $current_week = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100"; + $current_month = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100"; + $current_year = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=300&height=100"; - $current_minigraph = "".$current['hostname']." - ".$current['sensor_descr']; $current_minigraph .= "
', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\" >"; @@ -57,17 +59,17 @@ while($current = mysql_fetch_array($query)) echo("
"); - $daily_graph = "graph.php?id=" . $current['sensor_id'] . "&type=current&from=$day&to=$now&width=211&height=100"; - $daily_url = "graph.php?id=" . $current['sensor_id'] . "&type=current&from=$day&to=$now&width=400&height=150"; + $daily_graph = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=211&height=100"; + $daily_url = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=400&height=150"; - $weekly_graph = "graph.php?id=" . $current['sensor_id'] . "&type=current&from=$week&to=$now&width=211&height=100"; - $weekly_url = "graph.php?id=" . $current['sensor_id'] . "&type=current&from=$week&to=$now&width=400&height=150"; + $weekly_graph = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=211&height=100"; + $weekly_url = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=400&height=150"; - $monthly_graph = "graph.php?id=" . $current['sensor_id'] . "&type=current&from=$month&to=$now&width=211&height=100"; - $monthly_url = "graph.php?id=" . $current['sensor_id'] . "&type=current&from=$month&to=$now&width=400&height=150"; + $monthly_graph = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=211&height=100"; + $monthly_url = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=150"; - $yearly_graph = "graph.php?id=" . $current['sensor_id'] . "&type=current&from=$year&to=$now&width=211&height=100"; - $yearly_url = "graph.php?id=" . $current['sensor_id'] . "&type=current&from=$year&to=$now&width=400&height=150"; + $yearly_graph = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=211&height=100"; + $yearly_url = "graph.php?id=" . $current['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=400&height=150"; echo("', LEFT);\" onmouseout=\"return nd();\"> "); diff --git a/html/pages/health/fanspeeds.inc.php b/html/pages/health/fanspeeds.inc.php index 72a38e96c4..df670d8635 100644 --- a/html/pages/health/fanspeeds.inc.php +++ b/html/pages/health/fanspeeds.inc.php @@ -6,6 +6,8 @@ if($_SESSION['userlevel'] >= '5') { $sql = "SELECT * FROM `sensors` AS S, `devices` AS D, devices_perms as P WHERE S.sensor_class='fanspeed' AND S.device_id = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, S.sensor_descr"; } +$graph_type = "sensor_fanspeed"; + $query = mysql_query($sql); echo(''); @@ -26,18 +28,18 @@ while($fan = mysql_fetch_array($query)) { if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } - $weekly_fan = "graph.php?id=" . $fan['sensor_id'] . "&type=fanspeed&from=$week&to=$now&width=500&height=150"; + $weekly_fan = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=500&height=150"; $fan_popup = "', LEFT);\" onmouseout=\"return nd();\"> " . $fan['sensor_descr'] . ""; if($fan['sensor_current'] <= $fan['sensor_limit']) { $alert = 'alert'; } else { $alert = ""; } - $fan_day = "graph.php?id=" . $fan['sensor_id'] . "&type=fanspeed&from=$day&to=$now&width=300&height=100"; - $fan_week = "graph.php?id=" . $fan['sensor_id'] . "&type=fanspeed&from=$week&to=$now&width=300&height=100"; - $fan_month = "graph.php?id=" . $fan['sensor_id'] . "&type=fanspeed&from=$month&to=$now&width=300&height=100"; - $fan_year = "graph.php?id=" . $fan['sensor_id'] . "&type=fanspeed&from=$year&to=$now&width=300&height=100"; + $fan_day = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100"; + $fan_week = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100"; + $fan_month = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100"; + $fan_year = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=300&height=100"; - $fan_minigraph = "".$fan['hostname']." - ".$fan['sensor_descr']; $fan_minigraph .= "
', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\" >"; @@ -55,17 +57,17 @@ while($fan = mysql_fetch_array($query)) echo("
"); - $daily_graph = "graph.php?id=" . $fan['sensor_id'] . "&type=fanspeed&from=$day&to=$now&width=211&height=100"; - $daily_url = "graph.php?id=" . $fan['sensor_id'] . "&type=fanspeed&from=$day&to=$now&width=400&height=150"; + $daily_graph = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=211&height=100"; + $daily_url = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=400&height=150"; - $weekly_graph = "graph.php?id=" . $fan['sensor_id'] . "&type=fanspeed&from=$week&to=$now&width=211&height=100"; - $weekly_url = "graph.php?id=" . $fan['sensor_id'] . "&type=fanspeed&from=$week&to=$now&width=400&height=150"; + $weekly_graph = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=211&height=100"; + $weekly_url = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=400&height=150"; - $monthly_graph = "graph.php?id=" . $fan['sensor_id'] . "&type=fanspeed&from=$month&to=$now&width=211&height=100"; - $monthly_url = "graph.php?id=" . $fan['sensor_id'] . "&type=fanspeed&from=$month&to=$now&width=400&height=150"; + $monthly_graph = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=211&height=100"; + $monthly_url = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=150"; - $yearly_graph = "graph.php?id=" . $fan['sensor_id'] . "&type=fanspeed&from=$year&to=$now&width=211&height=100"; - $yearly_url = "graph.php?id=" . $fan['sensor_id'] . "&type=fanspeed&from=$year&to=$now&width=400&height=150"; + $yearly_graph = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=211&height=100"; + $yearly_url = "graph.php?id=" . $fan['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=400&height=150"; echo("', LEFT);\" onmouseout=\"return nd();\"> "); diff --git a/html/pages/health/frequencies.inc.php b/html/pages/health/frequencies.inc.php index 0bc8b02e53..1a35129faf 100644 --- a/html/pages/health/frequencies.inc.php +++ b/html/pages/health/frequencies.inc.php @@ -6,6 +6,8 @@ if($_SESSION['userlevel'] >= '5') { $sql = "SELECT * FROM `frequency` AS V, `devices` AS D, devices_perms as P WHERE V.device_id = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, V.freq_descr"; } +$graph_type = "sensor_frequency"; + $query = mysql_query($sql); echo(''); @@ -26,18 +28,18 @@ while($freq = mysql_fetch_array($query)) { if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } - $weekly_freq = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$week&to=$now&width=500&height=150"; + $weekly_freq = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$week&to=$now&width=500&height=150"; $freq_popup = "', LEFT);\" onmouseout=\"return nd();\"> " . $freq['freq_descr'] . ""; if($freq['freq_current'] >= $freq['freq_limit']) { $alert = 'alert'; } else { $alert = ""; } - $freq_day = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$day&to=$now&width=300&height=100"; - $freq_week = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$week&to=$now&width=300&height=100"; - $freq_month = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$month&to=$now&width=300&height=100"; - $freq_year = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$year&to=$now&width=300&height=100"; + $freq_day = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100"; + $freq_week = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100"; + $freq_month = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100"; + $freq_year = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$year&to=$now&width=300&height=100"; - $freq_minigraph = "".$freq['hostname']." - ".$freq['freq_descr']; $freq_minigraph .= "
', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\" >"; @@ -55,17 +57,17 @@ while($freq = mysql_fetch_array($query)) echo("
"); - $daily_graph = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$day&to=$now&width=211&height=100"; - $daily_url = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$day&to=$now&width=400&height=150"; + $daily_graph = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$day&to=$now&width=211&height=100"; + $daily_url = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$day&to=$now&width=400&height=150"; - $weekly_graph = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$week&to=$now&width=211&height=100"; - $weekly_url = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$week&to=$now&width=400&height=150"; + $weekly_graph = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$week&to=$now&width=211&height=100"; + $weekly_url = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$week&to=$now&width=400&height=150"; - $monthly_graph = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$month&to=$now&width=211&height=100"; - $monthly_url = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$month&to=$now&width=400&height=150"; + $monthly_graph = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$month&to=$now&width=211&height=100"; + $monthly_url = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=150"; - $yearly_graph = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$year&to=$now&width=211&height=100"; - $yearly_url = "graph.php?id=" . $freq['freq_id'] . "&type=frequency&from=$year&to=$now&width=400&height=150"; + $yearly_graph = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$year&to=$now&width=211&height=100"; + $yearly_url = "graph.php?id=" . $freq['freq_id'] . "&type=".$graph_type."&from=$year&to=$now&width=400&height=150"; echo("', LEFT);\" onmouseout=\"return nd();\"> "); diff --git a/html/pages/health/humidity.inc.php b/html/pages/health/humidity.inc.php index 1a40758d97..7f377266aa 100644 --- a/html/pages/health/humidity.inc.php +++ b/html/pages/health/humidity.inc.php @@ -8,6 +8,8 @@ if($_SESSION['userlevel'] >= '5') { $query = mysql_query($sql); +$graph_type = "humidity"; + echo(''); echo(' @@ -26,7 +28,7 @@ while($humidity = mysql_fetch_array($query)) { if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } - $weekly_humidity = "graph.php?id=" . $humidity['sensor_id'] . "&type=humidity&from=$week&to=$now&width=500&height=150"; + $weekly_humidity = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=500&height=150"; $humidity_popup = "', LEFT);\" onmouseout=\"return nd();\"> " . $humidity['sensor_descr'] . ""; @@ -37,12 +39,12 @@ while($humidity = mysql_fetch_array($query)) if($humidity['sensor_current'] >= $humidity['sensor_limit']) { $alert = 'alert'; } else { $alert = ""; } - $humidity_day = "graph.php?id=" . $humidity['sensor_id'] . "&type=humidity&from=$day&to=$now&width=300&height=100"; - $humidity_week = "graph.php?id=" . $humidity['sensor_id'] . "&type=humidity&from=$week&to=$now&width=300&height=100"; - $humidity_month = "graph.php?id=" . $humidity['sensor_id'] . "&type=humidity&from=$month&to=$now&width=300&height=100"; - $humidity_year = "graph.php?id=" . $humidity['sensor_id'] . "&type=humidity&from=$year&to=$now&width=300&height=100"; + $humidity_day = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100"; + $humidity_week = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100"; + $humidity_month = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100"; + $humidity_year = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=300&height=100"; - $humidity_minigraph = "".$humidity['hostname']." - ".$humidity['sensor_descr']; $humidity_minigraph .= "
', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\" >"; @@ -60,17 +62,17 @@ while($humidity = mysql_fetch_array($query)) echo("
"); - $daily_graph = "graph.php?id=" . $humidity['sensor_id'] . "&type=humidity&from=$day&to=$now&width=211&height=100"; - $daily_url = "graph.php?id=" . $humidity['sensor_id'] . "&type=humidity&from=$day&to=$now&width=400&height=150"; + $daily_graph = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=211&height=100"; + $daily_url = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=400&height=150"; - $weekly_graph = "graph.php?id=" . $humidity['sensor_id'] . "&type=humidity&from=$week&to=$now&width=211&height=100"; - $weekly_url = "graph.php?id=" . $humidity['sensor_id'] . "&type=humidity&from=$week&to=$now&width=400&height=150"; + $weekly_graph = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=211&height=100"; + $weekly_url = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=400&height=150"; - $monthly_graph = "graph.php?id=" . $humidity['sensor_id'] . "&type=humidity&from=$month&to=$now&width=211&height=100"; - $monthly_url = "graph.php?id=" . $humidity['sensor_id'] . "&type=humidity&from=$month&to=$now&width=400&height=150"; + $monthly_graph = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=211&height=100"; + $monthly_url = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=150"; - $yearly_graph = "graph.php?id=" . $humidity['sensor_id'] . "&type=humidity&from=$year&to=$now&width=211&height=100"; - $yearly_url = "graph.php?id=" . $humidity['sensor_id'] . "&type=humidity&from=$year&to=$now&width=400&height=150"; + $yearly_graph = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=211&height=100"; + $yearly_url = "graph.php?id=" . $humidity['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=400&height=150"; echo("', LEFT);\" onmouseout=\"return nd();\"> "); diff --git a/html/pages/health/memory.inc.php b/html/pages/health/memory.inc.php index 68ea228ae3..dbe6a4726b 100644 --- a/html/pages/health/memory.inc.php +++ b/html/pages/health/memory.inc.php @@ -1,4 +1,6 @@ "); echo(""); @@ -13,10 +15,10 @@ $text_descr = $mempool['mempool_descr']; $mempool_url = "/device/".$device['device_id']."/health/memory/"; - $mini_url = $config['base_url'] . "/graph.php?id=".$mempool['mempool_id']."&type=mempool&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; + $mini_url = $config['base_url'] . "/graph.php?id=".$mempool['mempool_id']."&type=".$graph_type."&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; $mempool_popup = "onmouseover=\"return overlib('
".$device['hostname']." - ".$text_descr; - $mempool_popup .= "
"; + $mempool_popup .= ""; $mempool_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\""; $total = formatStorage($mempool['mempool_total']); @@ -44,17 +46,17 @@ echo("
"); - $daily_graph = "graph.php?id=" . $mempool['mempool_id'] . "&type=mempool&from=$day&to=$now&width=211&height=100"; - $daily_url = "graph.php?id=" . $mempool['mempool_id'] . "&type=mempool&from=$day&to=$now&width=400&height=150"; + $daily_graph = "graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$day&to=$now&width=211&height=100"; + $daily_url = "graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$day&to=$now&width=400&height=150"; - $weekly_graph = "graph.php?id=" . $mempool['mempool_id'] . "&type=mempool&from=$week&to=$now&width=211&height=100"; - $weekly_url = "graph.php?id=" . $mempool['mempool_id'] . "&type=mempool&from=$week&to=$now&width=400&height=150"; + $weekly_graph = "graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$week&to=$now&width=211&height=100"; + $weekly_url = "graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$week&to=$now&width=400&height=150"; - $monthly_graph = "graph.php?id=" . $mempool['mempool_id'] . "&type=mempool&from=$month&to=$now&width=211&height=100"; - $monthly_url = "graph.php?id=" . $mempool['mempool_id'] . "&type=mempool&from=$month&to=$now&width=400&height=150"; + $monthly_graph = "graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$month&to=$now&width=211&height=100"; + $monthly_url = "graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=150"; - $yearly_graph = "graph.php?id=" . $mempool['mempool_id'] . "&type=mempool&from=$year&to=$now&width=211&height=100"; - $yearly_url = "graph.php?id=" . $mempool['mempool_id'] . "&type=mempool&from=$year&to=$now&width=400&height=150"; + $yearly_graph = "graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$year&to=$now&width=211&height=100"; + $yearly_url = "graph.php?id=" . $mempool['mempool_id'] . "&type=".$graph_type."&from=$year&to=$now&width=400&height=150"; echo("', LEFT);\" onmouseout=\"return nd();\"> "); diff --git a/html/pages/health/processors.inc.php b/html/pages/health/processors.inc.php index b38243ccfc..970e2c9b05 100644 --- a/html/pages/health/processors.inc.php +++ b/html/pages/health/processors.inc.php @@ -1,5 +1,7 @@ "); echo(" "); $i = '1'; @@ -21,10 +23,10 @@ $proc_url = "?page=device/".$device['device_id']."/health/processors/"; - $mini_url = $config['base_url'] . "/graph.php?id=".$proc['processor_id']."&type=processor&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; + $mini_url = $config['base_url'] . "/graph.php?id=".$proc['processor_id']."&type=".$graph_type."&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; $proc_popup = "onmouseover=\"return overlib('
".$device['hostname']." - ".$text_descr; - $proc_popup .= "
"; + $proc_popup .= ""; $proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\""; $perc = round($proc['processor_usage']); @@ -47,17 +49,17 @@ echo('
'); - $daily_graph = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$day&to=$now&width=211&height=100"; - $daily_url = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$day&to=$now&width=400&height=150"; + $daily_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=211&height=100"; + $daily_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=400&height=150"; - $weekly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$week&to=$now&width=211&height=100"; - $weekly_url = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$week&to=$now&width=400&height=150"; + $weekly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=211&height=100"; + $weekly_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=400&height=150"; - $monthly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$month&to=$now&width=211&height=100"; - $monthly_url = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$month&to=$now&width=400&height=150"; + $monthly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=211&height=100"; + $monthly_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=150"; - $yearly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$year&to=$now&width=211&height=100"; - $yearly_url = "graph.php?id=" . $proc['processor_id'] . "&type=processor&from=$year&to=$now&width=400&height=150"; + $yearly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=211&height=100"; + $yearly_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=400&height=150"; echo(" ', LEFT);\" onmouseout=\"return nd();\"> "); diff --git a/html/pages/health/storage.inc.php b/html/pages/health/storage.inc.php index f2166d13a9..06ca1dce6d 100644 --- a/html/pages/health/storage.inc.php +++ b/html/pages/health/storage.inc.php @@ -1,5 +1,6 @@ ', LEFT);\" onmouseout=\"return nd();\""; - $mini_graph = $config['base_url'] . "/graph.php?id=".$drive['storage_id']."&type=storage&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; + $mini_graph = $config['base_url'] . "/graph.php?id=".$drive['storage_id']."&type=".$graph_type."&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4"; if($perc > '90') { $left_background='c4323f'; $right_background='C96A73'; } elseif($perc > '75') { $left_background='bf5d5b'; $right_background='d39392'; @@ -72,17 +73,17 @@ while($drive = mysql_fetch_array($query)) { echo("
"); - $daily_graph = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$day&to=$now&width=211&height=100"; - $daily_url = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$day&to=$now&width=400&height=150"; + $daily_graph = "graph.php?id=" . $drive['storage_id'] . "&type=".$graph_type."&from=$day&to=$now&width=211&height=100"; + $daily_url = "graph.php?id=" . $drive['storage_id'] . "&type=".$graph_type."&from=$day&to=$now&width=400&height=150"; - $weekly_graph = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$week&to=$now&width=211&height=100"; - $weekly_url = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$week&to=$now&width=400&height=150"; + $weekly_graph = "graph.php?id=" . $drive['storage_id'] . "&type=".$graph_type."&from=$week&to=$now&width=211&height=100"; + $weekly_url = "graph.php?id=" . $drive['storage_id'] . "&type=".$graph_type."&from=$week&to=$now&width=400&height=150"; - $monthly_graph = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$month&to=$now&width=211&height=100"; - $monthly_url = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$month&to=$now&width=400&height=150"; + $monthly_graph = "graph.php?id=" . $drive['storage_id'] . "&type=".$graph_type."&from=$month&to=$now&width=211&height=100"; + $monthly_url = "graph.php?id=" . $drive['storage_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=150"; - $yearly_graph = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$year&to=$now&width=211&height=100"; - $yearly_url = "graph.php?id=" . $drive['storage_id'] . "&type=storage&from=$year&to=$now&width=400&height=150"; + $yearly_graph = "graph.php?id=" . $drive['storage_id'] . "&type=".$graph_type."&from=$year&to=$now&width=211&height=100"; + $yearly_url = "graph.php?id=" . $drive['storage_id'] . "&type=".$graph_type."&from=$year&to=$now&width=400&height=150"; echo("', LEFT);\" onmouseout=\"return nd();\"> "); diff --git a/html/pages/health/temperatures.inc.php b/html/pages/health/temperatures.inc.php index 6b0c13ddb9..809cb01d98 100644 --- a/html/pages/health/temperatures.inc.php +++ b/html/pages/health/temperatures.inc.php @@ -6,6 +6,8 @@ if($_SESSION['userlevel'] >= '5') { $sql = "SELECT * FROM `sensors` AS S, `devices` AS D, devices_perms as P WHERE S.sensor_class='temperature' AND S.device_id = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, S.sensor_index, S.sensor_descr"; } +$graph_type = "sensor_temperature"; + $query = mysql_query($sql); echo(''); @@ -26,7 +28,7 @@ while($temp = mysql_fetch_array($query)) { if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } - $weekly_temp = "graph.php?id=" . $temp['sensor_id'] . "&type=temperature&from=$week&to=$now&width=500&height=150"; + $weekly_temp = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=500&height=150"; $temp_popup = "', LEFT);\" onmouseout=\"return nd();\"> " . $temp['sensor_descr'] . ""; @@ -37,12 +39,12 @@ while($temp = mysql_fetch_array($query)) if($temp['sensor_current'] >= $temp['sensor_limit']) { $alert = 'alert'; } else { $alert = ""; } - $temp_day = "graph.php?id=" . $temp['sensor_id'] . "&type=temperature&from=$day&to=$now&width=300&height=100"; - $temp_week = "graph.php?id=" . $temp['sensor_id'] . "&type=temperature&from=$week&to=$now&width=300&height=100"; - $temp_month = "graph.php?id=" . $temp['sensor_id'] . "&type=temperature&from=$month&to=$now&width=300&height=100"; - $temp_year = "graph.php?id=" . $temp['sensor_id'] . "&type=temperature&from=$year&to=$now&width=300&height=100"; + $temp_day = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100"; + $temp_week = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100"; + $temp_month = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100"; + $temp_year = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=300&height=100"; - $temp_minigraph = "".$temp['hostname']." - ".$temp['sensor_descr']; $temp_minigraph .= "
', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\" >"; @@ -60,17 +62,17 @@ while($temp = mysql_fetch_array($query)) echo("
"); - $daily_graph = "graph.php?id=" . $temp['sensor_id'] . "&type=temperature&from=$day&to=$now&width=211&height=100"; - $daily_url = "graph.php?id=" . $temp['sensor_id'] . "&type=temperature&from=$day&to=$now&width=400&height=150"; + $daily_graph = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=211&height=100"; + $daily_url = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=400&height=150"; - $weekly_graph = "graph.php?id=" . $temp['sensor_id'] . "&type=temperature&from=$week&to=$now&width=211&height=100"; - $weekly_url = "graph.php?id=" . $temp['sensor_id'] . "&type=temperature&from=$week&to=$now&width=400&height=150"; + $weekly_graph = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=211&height=100"; + $weekly_url = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=400&height=150"; - $monthly_graph = "graph.php?id=" . $temp['sensor_id'] . "&type=temperature&from=$month&to=$now&width=211&height=100"; - $monthly_url = "graph.php?id=" . $temp['sensor_id'] . "&type=temperature&from=$month&to=$now&width=400&height=150"; + $monthly_graph = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=211&height=100"; + $monthly_url = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=150"; - $yearly_graph = "graph.php?id=" . $temp['sensor_id'] . "&type=temperature&from=$year&to=$now&width=211&height=100"; - $yearly_url = "graph.php?id=" . $temp['sensor_id'] . "&type=temperature&from=$year&to=$now&width=400&height=150"; + $yearly_graph = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=211&height=100"; + $yearly_url = "graph.php?id=" . $temp['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=400&height=150"; echo("', LEFT);\" onmouseout=\"return nd();\"> "); diff --git a/html/pages/health/voltages.inc.php b/html/pages/health/voltages.inc.php index d58941c20b..d0060c945a 100644 --- a/html/pages/health/voltages.inc.php +++ b/html/pages/health/voltages.inc.php @@ -6,6 +6,8 @@ if($_SESSION['userlevel'] >= '5') { $sql = "SELECT * FROM `sensors` AS S, `devices` AS D, devices_perms as P WHERE S.sensor_class='voltage' AND S.device_id = D.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' ORDER BY D.hostname, S.sensor_descr"; } +$graph_type = "sensor_voltage"; + $query = mysql_query($sql); echo(''); @@ -26,18 +28,18 @@ while($volt = mysql_fetch_array($query)) { if(is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } - $weekly_volt = "graph.php?id=" . $volt['sensor_id'] . "&type=voltage&from=$week&to=$now&width=500&height=150"; + $weekly_volt = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=500&height=150"; $volt_popup = "', LEFT);\" onmouseout=\"return nd();\"> " . $volt['sensor_descr'] . ""; if($volt['sensor_current'] >= $volt['sensor_limit']) { $alert = 'alert'; } else { $alert = ""; } - $volt_day = "graph.php?id=" . $volt['sensor_id'] . "&type=voltage&from=$day&to=$now&width=300&height=100"; - $volt_week = "graph.php?id=" . $volt['sensor_id'] . "&type=voltage&from=$week&to=$now&width=300&height=100"; - $volt_month = "graph.php?id=" . $volt['sensor_id'] . "&type=voltage&from=$month&to=$now&width=300&height=100"; - $volt_year = "graph.php?id=" . $volt['sensor_id'] . "&type=voltage&from=$year&to=$now&width=300&height=100"; + $volt_day = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100"; + $volt_week = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100"; + $volt_month = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100"; + $volt_year = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=300&height=100"; - $volt_minigraph = "".$volt['hostname']." - ".$volt['sensor_descr']; $volt_minigraph .= "
', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\" >"; @@ -55,17 +57,17 @@ while($volt = mysql_fetch_array($query)) echo("
"); - $daily_graph = "graph.php?id=" . $volt['sensor_id'] . "&type=voltage&from=$day&to=$now&width=211&height=100"; - $daily_url = "graph.php?id=" . $volt['sensor_id'] . "&type=voltage&from=$day&to=$now&width=400&height=150"; + $daily_graph = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=211&height=100"; + $daily_url = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=400&height=150"; - $weekly_graph = "graph.php?id=" . $volt['sensor_id'] . "&type=voltage&from=$week&to=$now&width=211&height=100"; - $weekly_url = "graph.php?id=" . $volt['sensor_id'] . "&type=voltage&from=$week&to=$now&width=400&height=150"; + $weekly_graph = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=211&height=100"; + $weekly_url = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=400&height=150"; - $monthly_graph = "graph.php?id=" . $volt['sensor_id'] . "&type=voltage&from=$month&to=$now&width=211&height=100"; - $monthly_url = "graph.php?id=" . $volt['sensor_id'] . "&type=voltage&from=$month&to=$now&width=400&height=150"; + $monthly_graph = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=211&height=100"; + $monthly_url = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=400&height=150"; - $yearly_graph = "graph.php?id=" . $volt['sensor_id'] . "&type=voltage&from=$year&to=$now&width=211&height=100"; - $yearly_url = "graph.php?id=" . $volt['sensor_id'] . "&type=voltage&from=$year&to=$now&width=400&height=150"; + $yearly_graph = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=211&height=100"; + $yearly_url = "graph.php?id=" . $volt['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=400&height=150"; echo("', LEFT);\" onmouseout=\"return nd();\"> "); diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index 722edd0b81..7132aef59f 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -180,12 +180,16 @@ $config['limit']['temp'] = "60"; ### Filesystems $config['ignore_mount'] = array("/kern", "/mnt/cdrom", "/proc", "/dev"); + $config['ignore_mount_string'] = array("packages", "devfs", "procfs", "UMA", "MALLOC"); -$config['ignore_mount_regexp'] = array(); + +$config['ignore_mount_regexp'] = array("/on: \/packages/", "/on: \/dev/", "/on: \/proc/", "/on: \/junos^/", ## JunOS Drives + "/on: \/junos\/dev/", "/on: \/jail\/dev/", "/^(dev|proc)fs/", "/^\/dev\/md0/", ## JunOS Drives + "/^\/var\/dhcpd\/dev,/", "/UMA/" ## BSD Drives + ); + $config['ignore_mount_removable'] = 1; # Ignore removable disk storage $config['ignore_mount_network'] = 1; # Ignore network mounted storage -$config['ignore_junos_os_drives'] = array("/on: \/packages/", "/on: \/dev/", "/on: \/proc/", "/on: \/junos^/", "/on: \/junos\/dev/", "/on: \/jail\/dev/", "/^(dev|proc)fs/", "/^\/dev\/md0/"); # Ignore JunOS partitions who are always 100% -$config['ignore_bsd_os_drives'] = array("/^\/dev,/", "/^\/var\/dhcpd\/dev,/", "/UMA/"); # Ignore BSD partitions who are always 100% ### Poller/Discovery diff --git a/includes/discovery/storage-hrstorage.inc.php b/includes/discovery/storage-hrstorage.inc.php index 6605f55025..b2ed9c3341 100755 --- a/includes/discovery/storage-hrstorage.inc.php +++ b/includes/discovery/storage-hrstorage.inc.php @@ -7,8 +7,9 @@ if(is_array($storage_array)) { foreach($storage_array[$device[device_id]] as $index => $storage) { foreach($config['ignore_mount'] as $bi) { if($bi == $descr) { $deny = 1; if ($debug) echo("$bi == $descr \n"); } } - foreach($config['ignore_mount_string'] as $bi) { if(strpos($descr, $bi) !== FALSE) { $deny = 1; if ($debug) echo("$descr, $bi \n"); } } - foreach($config['ignore_mount_regexp'] as $bi) { if(preg_match($bi, $descr)) { $deny = 1; if ($debug) echo("$bi, $descr \n"); } } + foreach($config['ignore_mount_string'] as $bi) { if(strpos($descr, $bi)) { $deny = 1; if ($debug) echo("$descr, $bi \n"); } } + foreach($config['ignore_mount_regexp'] as $bi) { if(preg_match($bi, $descr) !== FALSE) { $deny = 1; if ($debug) echo("$bi, $descr \n"); } } + $fstype = $storage['hrStorageType']; $descr = $storage['hrStorageDescr']; $size = $storage['hrStorageSize'] * $storage['hrStorageAllocationUnits']; diff --git a/includes/discovery/temperatures/cisco-entity-sensor.inc.php b/includes/discovery/temperatures/cisco-entity-sensor.inc.php index 68fa6a0df8..7197a2c85f 100644 --- a/includes/discovery/temperatures/cisco-entity-sensor.inc.php +++ b/includes/discovery/temperatures/cisco-entity-sensor.inc.php @@ -1,6 +1,8 @@