diff --git a/attic/cisco-entity-sensors.inc.php b/attic/cisco-entity-sensors.inc.php
new file mode 100755
index 000000000..fb62bc06b
--- /dev/null
+++ b/attic/cisco-entity-sensors.inc.php
@@ -0,0 +1,51 @@
+
\ No newline at end of file
diff --git a/attic/temperatures.inc.php b/attic/temperatures.inc.php
new file mode 100755
index 000000000..7244ddac1
--- /dev/null
+++ b/attic/temperatures.inc.php
@@ -0,0 +1,66 @@
+= $sensor['sensor_limit'])
+ {
+ $msg = "Temp Alarm: " . $device['hostname'] . " " . $sensor['sensor_descr'] . " is " . $sensor_value . " (Limit " . $sensor['sensor_limit'];
+ $msg .= ") at " . date($config['timestamp_format']);
+ notify($device, "Temp Alarm: " . $device['hostname'] . " " . $sensor['sensor_descr'], $msg);
+ echo("Alerting for " . $device['hostname'] . " " . $sensor['sensor_descr'] . "\n");
+ log_event('Temperature ' . $sensor['sensor_descr'] . " over threshold: " . $sensor_value . " " . html_entity_decode('°') . "$unit (>= " . $sensor['sensor_limit'] . " " . html_entity_decode('°') . "$unit)", $device, $class, $sensor['sensor_id']);
+ }
+
+ mysql_query("UPDATE sensors SET sensor_current = '$sensor_value' WHERE sensor_class='$class' AND sensor_id = '" . $sensor['sensor_id'] . "'");
+}
+
+?>
diff --git a/attic/voltages.inc.php b/attic/voltages.inc.php
new file mode 100755
index 000000000..709636fec
--- /dev/null
+++ b/attic/voltages.inc.php
@@ -0,0 +1,54 @@
+ $sensor['sensor_limit_low'] && $sensor_value <= $sensor['sensor_limit_low'])
+ {
+ $msg = $class_text . " Alarm: " . $device['hostname'] . " " . $sensor['sensor_descr'] . " is " . $sensor_value . "$unit (Limit " . $sensor['sensor_limit'];
+ $msg .= "$unit) at " . date($config['timestamp_format']);
+ notify($device, $class_text" Alarm: " . $device['hostname'] . " " . $sensor['sensor_descr'], $msg);
+ echo("Alerting for " . $device['hostname'] . " " . $sensor['sensor_descr'] . "\n");
+ log_event($class_text.' '.$sensor['sensor_descr'] . " under threshold: " . $sensor_value . " $unit (< " . $sensor['sensor_limit_low'] . " $unit)", $device, $class, $sensor['sensor_id']);
+ }
+ else if ($sensor['sensor_limit'] != "" && $sensor['sensor_current'] < $sensor['sensor_limit'] && $sensor_value >= $sensor['sensor_limit'])
+ {
+ $msg = $class_text." Alarm: " . $device['hostname'] . " " . $sensor['sensor_descr'] . " is " . $sensor_value . "$unit (Limit " . $sensor['sensor_limit'];
+ $msg .= "$unit) at " . date($config['timestamp_format']);
+ notify($device, $class_text." Alarm: " . $device['hostname'] . " " . $sensor['sensor_descr'], $msg);
+ echo("Alerting for " . $device['hostname'] . " " . $sensor['sensor_descr'] . "\n");
+ log_event($class_text." ". $sensor['sensor_descr'] . " above threshold: " . $sensor_value . " $unit (> " . $sensor['sensor_limit'] . " $unit)", $device, $class, $sensor['sensor_id']);
+ }
+ dbUpdate(array('sensor_current' => $sensor_value), 'sensors', '`sensor_id` = ', array($sensor['sensor_id']));
+}
+
+?>
diff --git a/database-update.sql b/database-update.sql
index 42c8261db..59e82c630 100644
--- a/database-update.sql
+++ b/database-update.sql
@@ -1 +1,4 @@
ALTER TABLE users ADD can_modify_passwd TINYINT NOT NULL DEFAULT 1;
+ALTER TABLE `observer_dev`.`storage` ADD UNIQUE `index_unique` ( `device_id` , `storage_mib` , `storage_index` );
+ALTER TABLE `bgpPeers_cbgp` ADD `AcceptedPrefixes` INT NOT NULL ,ADD `DeniedPrefixes` INT NOT NULL ,ADD `PrefixAdminLimit` INT NOT NULL ,ADD `PrefixThreshold` INT NOT NULL ,ADD `PrefixClearThreshold` INT NOT NULL ,ADD `AdvertisedPrefixes` INT NOT NULL ,ADD `SuppressedPrefixes` INT NOT NULL ,ADD `WithdrawnPrefixes` INT NOT NULL;
+ALTER TABLE `observer_dev`.`bgpPeers_cbgp` ADD UNIQUE `unique_index` ( `device_id` , `bgpPeerIdentifier` , `afi` , `safi` );
diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php
index 7dec3cfa5..c959d8e31 100644
--- a/html/includes/functions.inc.php
+++ b/html/includes/functions.inc.php
@@ -13,12 +13,18 @@ function get_percentage_colours($percentage)
}
+function generate_device_url($device, $linksuffix="")
+{
+ return "device/" . $device['device_id'] . "/" . $linksuffix;
+}
+
function generate_device_link($device, $text=0, $linksuffix="", $start=0, $end=0)
{
- global $twoday, $day, $now, $config;
+ global $config;
+
+ if (!$start) { $start = $config['time']['day']; }
+ if (!$end) { $end = $config['time']['now']; }
- if (!$start) { $start = $day; }
- if (!$end) { $end = $now; }
$class = devclass($device);
if (!$text) { $text = $device['hostname']; }
@@ -35,7 +41,7 @@ function generate_device_link($device, $text=0, $linksuffix="", $start=0, $end=0
$graphs = $config['os']['default']['over'];
}
- $url = "device/" . $device['device_id'] . "/" . $linksuffix;
+ $url = generate_device_url($device, $linksuffix);
$contents = "
".$device['hostname'];
if ($device['hardware']) { $contents .= " - ".$device['hardware']; }
$contents .= "
";
@@ -55,7 +61,7 @@ function generate_device_link($device, $text=0, $linksuffix="", $start=0, $end=0
$contents .= '';
$contents .= '
'.$graphhead.'';
$contents .= "

';
- $contents .= "

';
+ $contents .= "

';
$contents .= '
';
}
@@ -95,13 +101,13 @@ function generate_graph_popup($graph_array)
$graph_array['legend'] = "yes";
$graph_array['height'] = "100";
$graph_array['width'] = "340";
- $graph_array['from'] = $config['day'];
+ $graph_array['from'] = $config['time']['day'];
$content .= generate_graph_tag($graph_array);
- $graph_array['from'] = $config['week'];
+ $graph_array['from'] = $config['time']['week'];
$content .= generate_graph_tag($graph_array);
- $graph_array['from'] = $config['month'];
+ $graph_array['from'] = $config['time']['month'];
$content .= generate_graph_tag($graph_array);
- $graph_array['from'] = $config['year'];
+ $graph_array['from'] = $config['time']['year'];
$content .= generate_graph_tag($graph_array);
$content .= "";
@@ -236,7 +242,7 @@ function print_percentage_bar($width, $height, $percent, $left_text, $left_colou
function generate_port_link($args, $text = NULL, $type = NULL)
{
- global $twoday, $now, $config, $day, $month;
+ global $config;
$args = ifNameDescr($args);
if (!$text) { $text = fixIfName($args['label']); }
@@ -253,19 +259,19 @@ function generate_port_link($args, $text = NULL, $type = NULL)
$graph_array['legend'] = "yes";
$graph_array['height'] = "100";
$graph_array['width'] = "340";
- $graph_array['to'] = $config['now'];
- $graph_array['from'] = $config['day'];
+ $graph_array['to'] = $config['time']['now'];
+ $graph_array['from'] = $config['time']['day'];
$graph_array['id'] = $args['interface_id'];
$content .= generate_graph_tag($graph_array);
- $graph_array['from'] = $config['week'];
+ $graph_array['from'] = $config['time']['week'];
$content .= generate_graph_tag($graph_array);
- $graph_array['from'] = $config['month'];
+ $graph_array['from'] = $config['time']['month'];
$content .= generate_graph_tag($graph_array);
- $graph_array['from'] = $config['year'];
+ $graph_array['from'] = $config['time']['year'];
$content .= generate_graph_tag($graph_array);
$content .= "";
- $url = "device/".$args['device_id']."/port/" . $args['interface_id'] . "/";
+ $url = generate_port_url($args);
if (port_permitted($args['interface_id'])) {
return overlib_link($url, $text, $content, $class);
@@ -274,6 +280,10 @@ function generate_port_link($args, $text = NULL, $type = NULL)
}
}
+function generate_port_url($args) {
+ return $url = "device/".$args['device_id']."/port/" . $args['interface_id'] . "/";
+}
+
function generate_port_thumbnail($args)
{
if (!$args['bg']) { $args['bg'] = "FFFFF"; }
diff --git a/html/includes/print-interface-adsl.inc.php b/html/includes/print-interface-adsl.inc.php
index 456990f3a..2aef4ef5f 100644
--- a/html/includes/print-interface-adsl.inc.php
+++ b/html/includes/print-interface-adsl.inc.php
@@ -35,7 +35,7 @@ if ($port_details)
echo("$break ".$ip['ipv4_address']."/".$ip['ipv4_prefixlen']."");
$break = ",";
}
- foreach (dbFetchRows("SELECT * FROM `ipv6_addresses` WHERE `interface_id` = ?", array($interface['interface_id']) as $ip6);
+ foreach (dbFetchRows("SELECT * FROM `ipv6_addresses` WHERE `interface_id` = ?", array($interface['interface_id'])) as $ip6);
{
echo("$break ".Net_IPv6::compress($ip6['ipv6_address'])."/".$ip6['ipv6_prefixlen']."");
$break = ",";
@@ -44,48 +44,48 @@ if ($port_details)
echo("");
-$width="120"; $height="40"; $from = $day;
+$width="120"; $height="40"; $from = $config['time']['day'];
echo("");
echo(formatRates($interface['ifInOctets_rate'] * 8)." ".formatRates($interface['ifOutOctets_rate'] * 8));
echo(" ");
$interface['graph_type'] = "port_bits";
-echo(generate_port_link($interface, " ", $interface['graph_type']));
echo(" | ");
echo("".formatRates($interface['adslAturChanCurrTxRate']) . "/". formatRates($interface['adslAtucChanCurrTxRate']));
echo(" ");
$interface['graph_type'] = "port_adsl_speed";
-echo(generate_port_link($interface, " ", $interface['graph_type']));
echo(" | ");
echo("".formatRates($interface['adslAturCurrAttainableRate']) . "/". formatRates($interface['adslAtucCurrAttainableRate']));
echo(" ");
$interface['graph_type'] = "port_adsl_attainable";
-echo(generate_port_link($interface, " ", $interface['graph_type']));
echo(" | ");
echo("".$interface['adslAturCurrAtn'] . "dB/". $interface['adslAtucCurrAtn'] . "dB");
echo(" ");
$interface['graph_type'] = "port_adsl_attenuation";
-echo(generate_port_link($interface, " ", $interface['graph_type']));
echo(" | ");
echo("".$interface['adslAturCurrSnrMgn'] . "dB/". $interface['adslAtucCurrSnrMgn'] . "dB");
echo(" ");
$interface['graph_type'] = "port_adsl_snr";
-echo(generate_port_link($interface, " ", $interface['graph_type']));
echo(" | ");
echo("".$interface['adslAturCurrOutputPwr'] . "dBm/". $interface['adslAtucCurrOutputPwr'] . "dBm");
echo(" ");
$interface['graph_type'] = "port_adsl_power";
-echo(generate_port_link($interface, " ", $interface['graph_type']));
# if ($interface[ifDuplex] != unknown) { echo("Duplex " . $interface['ifDuplex'] . ""); } else { echo("-"); }
@@ -103,41 +103,4 @@ str_replace("#","", $row_colour)."'>", $interface['graph_type']));
echo(" | ");
-if ($graph_type == "etherlike")
-{
- $graph_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/etherlike-". safename($interface['ifIndex']) . ".rrd";
-} else {
- $graph_file = $config['rrd_dir'] . "/" . $device['hostname'] . "/". safename($interface['ifIndex']) . ".rrd";
-}
-
-if ($graph_type && is_file($graph_file))
-{
- $type = $graph_type;
-
- $daily_traffic = "graph.php?port=$if_id&type=" . $graph_type . "&from=$from&to=$now&width=210&height=100";
- $daily_url = "graph.php?port=$if_id&type=" . $graph_type . "&from=$from&to=$now&width=500&height=150";
-
- $weekly_traffic = "graph.php?port=$if_id&type=" . $graph_type . "&from=$week&to=$now&width=210&height=100";
- $weekly_url = "graph.php?port=$if_id&type=" . $graph_type . "&from=$week&to=$now&width=500&height=150";
-
- $monthly_traffic = "graph.php?port=$if_id&type=" . $graph_type . "&from=$month&to=$now&width=210&height=100";
- $monthly_url = "graph.php?port=$if_id&type=" . $graph_type . "&from=$month&to=$now&width=500&height=150";
-
- $yearly_traffic = "graph.php?port=$if_id&type=" . $graph_type . "&from=$year&to=$now&width=210&height=100";
- $yearly_url = "graph.php?port=$if_id&type=" . $graph_type . "&from=$year&to=$now&width=500&height=150";
-
- echo("");
-
- echo("', LEFT".$config['overlib_defaults'].");\"
- onmouseout=\"return nd();\"> ");
- echo("', LEFT".$config['overlib_defaults'].");\"
- onmouseout=\"return nd();\"> ");
- echo("', LEFT, WIDTH, 350".$config['overlib_defaults'].");\"
- onmouseout=\"return nd();\"> ");
- echo("', LEFT, WIDTH, 350".$config['overlib_defaults'].");\"
- onmouseout=\"return nd();\"> ");
-
- echo(" |
");
-}
-
?>
diff --git a/html/includes/print-interface-graphs.inc.php b/html/includes/print-interface-graphs.inc.php
index 1482f3340..b90e03101 100644
--- a/html/includes/print-interface-graphs.inc.php
+++ b/html/includes/print-interface-graphs.inc.php
@@ -4,10 +4,10 @@ global $config;
$graph_array['height'] = "100";
$graph_array['width'] = "215";
-$graph_array['to'] = $now;
+$graph_array['to'] = $config['time']['now'];
$graph_array['id'] = $interface['interface_id'];
$graph_array['type'] = $graph_type;
include("includes/print-quadgraphs.inc.php");
-?>
\ No newline at end of file
+?>
diff --git a/html/includes/print-interface.inc.php b/html/includes/print-interface.inc.php
index 78660fa8c..7d530de01 100644
--- a/html/includes/print-interface.inc.php
+++ b/html/includes/print-interface.inc.php
@@ -59,11 +59,11 @@ echo("");
if ($port_details)
{
$interface['graph_type'] = "port_bits";
- echo(generate_port_link($interface, " "));
+ echo(generate_port_link($interface, " "));
$interface['graph_type'] = "port_upkts";
- echo(generate_port_link($interface, " "));
+ echo(generate_port_link($interface, " "));
$interface['graph_type'] = "port_errors";
- echo(generate_port_link($interface, " "));
+ echo(generate_port_link($interface, " "));
}
echo(" | ");
@@ -259,31 +259,10 @@ if ($graph_type && is_file($graph_file))
{
$type = $graph_type;
- $daily_traffic = "graph.php?id=$if_id&type=" . $graph_type . "&from=$day&to=$now&width=210&height=100";
- $daily_url = "graph.php?id=$if_id&type=" . $graph_type . "&from=$day&to=$now&width=500&height=150";
-
- $weekly_traffic = "graph.php?id=$if_id&type=" . $graph_type . "&from=$week&to=$now&width=210&height=100";
- $weekly_url = "graph.php?id=$if_id&type=" . $graph_type . "&from=$week&to=$now&width=500&height=150";
-
- $monthly_traffic = "graph.php?id=$if_id&type=" . $graph_type . "&from=$month&to=$now&width=210&height=100";
- $monthly_url = "graph.php?id=$if_id&type=" . $graph_type . "&from=$month&to=$now&width=500&height=150";
-
- $yearly_traffic = "graph.php?id=$if_id&type=" . $graph_type . "&from=$year&to=$now&width=210&height=100";
- $yearly_url = "graph.php?id=$if_id&type=" . $graph_type . "&from=$year&to=$now&width=500&height=150";
-
- echo(" | | ");
+ echo(" |
");
include("includes/print-interface-graphs.inc.php");
-# echo("', LEFT".$config['overlib_defaults'].");\"
-# onmouseout=\"return nd();\"> ");
-# echo("', LEFT".$config['overlib_defaults'].");\"
-# onmouseout=\"return nd();\"> ");
-# echo("', LEFT, WIDTH, 350".$config['overlib_defaults'].");\"
-# onmouseout=\"return nd();\"> ");
-# echo("', LEFT, WIDTH, 350".$config['overlib_defaults'].");\"
-# onmouseout=\"return nd();\"> ");
-
echo(" |
");
}
diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php
index 33af9d873..82f3e5989 100644
--- a/html/includes/print-menubar.php
+++ b/html/includes/print-menubar.php
@@ -1,7 +1,7 @@
".$device['hostname']." - ".$service['service_type'];
-$popup .= "
";
+$popup .= "
";
$popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
echo("
@@ -59,4 +59,4 @@ echo("
$i++;
-?>
\ No newline at end of file
+?>
diff --git a/html/index.php b/html/index.php
index d0d7445e8..eabc78826 100755
--- a/html/index.php
+++ b/html/index.php
@@ -26,7 +26,9 @@ include("../includes/functions.php");
include("includes/functions.inc.php");
$start = utime();
+
$now = time();
+$fourhour = time() - (4 * 60 * 60);
$day = time() - (24 * 60 * 60);
$twoday = time() - (2 * 24 * 60 * 60);
$week = time() - (7 * 24 * 60 * 60);
diff --git a/html/pages/customers.inc.php b/html/pages/customers.inc.php
index ff597ade8..a3f63f3f6 100644
--- a/html/pages/customers.inc.php
+++ b/html/pages/customers.inc.php
@@ -56,12 +56,17 @@ foreach (dbFetchRows("SELECT * FROM `ports` WHERE `port_descr_type` = 'cust' GRO
unset($customer_name);
}
- echo(" |
-
-
-
-
- |
");
+ echo(" | ");
+
+ $graph_array['type'] = "customer_bits";
+ $graph_array['height'] = "100";
+ $graph_array['width'] = "220";
+ $graph_array['to'] = $config['time']['now'];
+ $graph_array['id'] = $customer['port_descr_descr'];
+
+ include("includes/print-quadgraphs.inc.php");
+
+ echo(" |
");
}
echo("");
diff --git a/html/pages/device/collectd.inc.php b/html/pages/device/collectd.inc.php
index 196d06cff..83979ade5 100644
--- a/html/pages/device/collectd.inc.php
+++ b/html/pages/device/collectd.inc.php
@@ -89,24 +89,24 @@ print_optionbar_end();
}
echo("");
- $daily_traffic = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$day&to=$now&width=215&height=100";
+ $daily_traffic = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=215&height=100";
$daily_traffic .= $args;
- $daily_url = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$day&to=$now&width=400&height=150";
+ $daily_url = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=400&height=150";
$daily_url .= $args;
- $weekly_traffic = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$week&to=$now&width=215&height=100";
+ $weekly_traffic = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=215&height=100";
$weekly_traffic .= $args;
- $weekly_url = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$week&to=$now&width=400&height=150";
+ $weekly_url = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=400&height=150";
$weekly_url .= $args;
- $monthly_traffic = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$month&to=$now&width=215&height=100";
+ $monthly_traffic = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=215&height=100";
$monthly_traffic .= $args;
- $monthly_url = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$month&to=$now&width=400&height=150";
+ $monthly_url = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=400&height=150";
$monthly_url .= $args;
- $yearly_traffic = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$year&to=$now&width=215&height=100";
+ $yearly_traffic = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=215&height=100";
$yearly_traffic .= $args;
- $yearly_url = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=$year&to=$now&width=400&height=150";
+ $yearly_url = "collectd-graph.php?host=" . $device['hostname'] . "&plugin=".$_GET['opta']."&type=".$_GET['opta']."&plugin_instance=".$instance."&type=".$type."&type_instance=".$tinst."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=400&height=150";
$yearly_url .= $args;
diff --git a/html/pages/device/health/diskio.inc.php b/html/pages/device/health/diskio.inc.php
index 3e8ddfced..d58fcabbf 100644
--- a/html/pages/device/health/diskio.inc.php
+++ b/html/pages/device/health/diskio.inc.php
@@ -17,11 +17,17 @@ foreach (dbFetchRows("SELECT * FROM `ucd_diskio` WHERE device_id = ? ORDER BY di
$fs_url = "device/".$device['device_id']."/health/diskio/";
- $fs_popup = "onmouseover=\"return overlib('".$device['hostname']." - ".$drive['diskio_descr'];
- $fs_popup .= "
";
- $fs_popup .= "', RIGHT, FGCOLOR, '#e5e5e5');\" onmouseout=\"return nd();\"";
+ $graph_array_zoom['id'] = $drive['diskio_id'];
+ $graph_array_zoom['type'] = "diskio_ops";
+ $graph_array_zoom['width'] = "400";
+ $graph_array_zoom['height'] = "125";
+ $graph_array_zoom['from'] = $config['time']['twoday'];
+ $graph_array_zoom['to'] = $config['time']['now'];
+
- echo("| " . $drive['diskio_descr'] . " |
");
+ echo("| ");
+ echo(overlib_link($fs_url, $drive['diskio_descr'], generate_graph_tag($graph_array_zoom), NULL));
+ echo(" |
");
$types = array("diskio_bits", "diskio_ops");
@@ -29,6 +35,7 @@ foreach (dbFetchRows("SELECT * FROM `ucd_diskio` WHERE device_id = ? ORDER BY di
{
echo('| ');
+ $graph_array = array();
$graph_array['id'] = $drive['diskio_id'];
$graph_array['type'] = $graph_type;
diff --git a/html/pages/device/hrdevice.inc.php b/html/pages/device/hrdevice.inc.php
index e5a63dab0..a668e0bdf 100644
--- a/html/pages/device/hrdevice.inc.php
+++ b/html/pages/device/hrdevice.inc.php
@@ -44,7 +44,7 @@ foreach (dbFetchRows("SELECT * FROM `hrDevice` WHERE `device_id` = ? ORDER BY `h
$graph_array_zoom = $graph_array; $graph_array_zoom['height'] = "150"; $graph_array_zoom['width'] = "400";
# FIXME click on graph should also link to port, but can't use generate_port_link here...
- $mini_graph = overlib_link("#", generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
+ $mini_graph = overlib_link(generate_port_url($interface), generate_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
echo(" | $mini_graph | ");
} else {
diff --git a/html/pages/device/overview/generic/sensor.inc.php b/html/pages/device/overview/generic/sensor.inc.php
index c6d54c6b9..8d2573e14 100644
--- a/html/pages/device/overview/generic/sensor.inc.php
+++ b/html/pages/device/overview/generic/sensor.inc.php
@@ -12,17 +12,19 @@ if (count($sensors))
{
if (is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
+ ### FIXME - make this "four graphs in popup" a function/include and "small graph" a function.
+
$graph_colour = str_replace("#", "", $row_colour);
- $sensor_day = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$day&to=$now&width=300&height=100";
- $sensor_week = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$week&to=$now&width=300&height=100";
- $sensor_month = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$month&to=$now&width=300&height=100";
- $sensor_year = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=$year&to=$now&width=300&height=100";
- $sensor_minigraph = "
";
+ $sensor_day = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=210&height=100";
+ $sensor_week = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['time']['week']."&to=".$config['time']['now']."&width=210&height=100";
+ $sensor_month = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['time']['month']."&to=".$config['time']['now']."&width=210&height=100";
+ $sensor_year = "graph.php?id=" . $sensor['sensor_id'] . "&type=".$graph_type."&from=".$config['time']['year']."&to=".$config['time']['now']."&width=210&height=100";
+ $sensor_minigraph = "
";
$sensor_link = "";
+ $sensor_link .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\" >";
$sensor_link_c = $sensor_link . " $sensor['sensor_limit'] ? "style='color: red'" : '') . '>' . $sensor['sensor_current'] . $sensor_unit . "";
$sensor_link_b = $sensor_link . $sensor_minigraph . "";
diff --git a/html/pages/device/overview/ports.inc.php b/html/pages/device/overview/ports.inc.php
index 7a711f7e7..227aeea22 100644
--- a/html/pages/device/overview/ports.inc.php
+++ b/html/pages/device/overview/ports.inc.php
@@ -17,13 +17,13 @@ if ($ports['total'])
$content .= "";
$graph_array['legend'] = "yes";
$graph_array['width'] = "340";
- $graph_array['from'] = $day;
+ $graph_array['from'] = $config['time']['day'];
$content .= generate_graph_tag($graph_array);
- $graph_array['from'] = $week;
+ $graph_array['from'] = $config['time']['week'];
$content .= generate_graph_tag($graph_array);
- $graph_array['from'] = $month;
+ $graph_array['from'] = $config['time']['month'];
$content .= generate_graph_tag($graph_array);
- $graph_array['from'] = $year;
+ $graph_array['from'] = $config['time']['year'];
$content .= generate_graph_tag($graph_array);
$content .= "
";
diff --git a/html/pages/graphs.inc.php b/html/pages/graphs.inc.php
index f4d689da0..8616c9921 100644
--- a/html/pages/graphs.inc.php
+++ b/html/pages/graphs.inc.php
@@ -2,8 +2,8 @@
$id = $_GET['opta'];
$graph_type = $_GET['optb'];
-if (is_numeric($_GET['optc'])) { $from = $_GET['optc']; } else { $from = $day; }
-if (is_numeric($_GET['optd'])) { $to = $_GET['optd']; } else { $to = $now; }
+if (is_numeric($_GET['optc'])) { $from = $_GET['optc']; } else { $from = $config['time']['day']; }
+if (is_numeric($_GET['optd'])) { $to = $_GET['optd']; } else { $to = $config['time']['now']; }
preg_match('/^(?P[A-Za-z0-9]+)_(?P.+)/', mres($graph_type), $graphtype);
@@ -28,13 +28,15 @@ if (!$auth)
if (isset($config['graph_types'][$type][$subtype]['descr'])) { $title .= " :: ".$config['graph_types'][$type][$subtype]['descr']; } else { $title .= " :: ".$graph_type; }
$graph_array['height'] = "60";
- $graph_array['width'] = "150";
+ $graph_array['width'] = "125";
$graph_array['legend'] = "no";
$graph_array['to'] = $now;
$graph_array['id'] = $id;
$graph_array['type'] = $graph_type;
- $graph_array['from'] = $day;
- $graph_array_zoom = $graph_array; $graph_array_zoom['height'] = "150"; $graph_array_zoom['width'] = "400";
+
+ $graph_array_zoom = $graph_array;
+ $graph_array_zoom['height'] = "150";
+ $graph_array_zoom['width'] = "400";
print_optionbar_start();
echo($title);
@@ -44,55 +46,64 @@ if (!$auth)
echo("");
- echo("
+ $graph_array['from'] = $config['time']['sixhour'];
+ echo("
");
+
+ $graph_array['from'] = $config['time']['day'];
+ echo("
");
- $graph_array['from'] = $twoday;
- echo("
+ $graph_array['from'] = $config['time']['twoday'];
+ echo("
");
- $graph_array['from'] = $week;
- echo("
+ $graph_array['from'] = $config['time']['week'];
+ echo("
");
- $graph_array['from'] = $config['twoweek'];
- echo("
+ $graph_array['from'] = $config['time']['twoweek'];
+ echo("
");
- $graph_array['from'] = $month;
- echo("
+ $graph_array['from'] = $config['time']['month'];
+ echo("
");
- $graph_array['from'] = $config['twomonth'];
- echo("