diff --git a/cleanup.php b/cleanup.php
index 53c4223dda..854e08799d 100755
--- a/cleanup.php
+++ b/cleanup.php
@@ -66,7 +66,7 @@ while ($link = mysql_fetch_array($link_query)) {
echo(mysql_result(mysql_query("SELECT COUNT(id) FROM `links`"), 0) . " links at end\n");
echo(mysql_result(mysql_query("SELECT COUNT(adj_id) FROM `adjacencies`"), 0) . " adjacencies at start\n");
-$link_query = mysql_query("SELECT * FROM `adjacencies` AS A, `interfaces` AS I, `devices` AS D, networks AS N WHERE I.interface_id = A.interface_id AND D.id = I.device_id AND N.id = A.network_id;");
+$link_query = mysql_query("SELECT * FROM `adjacencies` AS A, `interfaces` AS I, `devices` AS D, networks AS N WHERE I.interface_id = A.interface_id AND D.device_id = I.device_id AND N.id = A.network_id;");
while ($link = mysql_fetch_array($link_query)) {
$id = $link['adj_id'];
$netid = $link['network_id'];
diff --git a/config.php.default b/config.php.default
index a62ff9d287..3516ad318e 100755
--- a/config.php.default
+++ b/config.php.default
@@ -6,8 +6,9 @@ $db_user = "observer";
$db_pass = "";
$db_name = "observer";
-### Installation Location
-$installdir = "/var/sites/network.vostron.net/";
+### Installation Locations
+$installdir = "/var/sites/observer/";
+$rrd_dir = $installdir . "rrd/";
### Default community
$community = "public";
@@ -40,6 +41,8 @@ $show_if_transit = 0;
$show_if_peering = 0;
$show_locations = 1;
+$enable_syslog = 0;
+
### Interface name strings to ignore
$bif = array("null", "virtual-", "unrouted", "eobc", "mpls", "sl0", "lp0", "faith0",
"-atm layer", "-atm subif", "-shdsl", "-adsl",
diff --git a/cron-hourly.sh b/cron-hourly.sh
index f456156a80..7acf99dc2c 100755
--- a/cron-hourly.sh
+++ b/cron-hourly.sh
@@ -10,3 +10,4 @@
./discover-cisco-temp.php &
./discover-vlans.php &
./update-interface.php &
+./check-errors.php &
diff --git a/html/images/16/arrow_out.png b/html/images/16/arrow_out.png
index 2e9bc42bec..d2688a799d 100755
Binary files a/html/images/16/arrow_out.png and b/html/images/16/arrow_out.png differ
diff --git a/html/includes/authenticate.inc b/html/includes/authenticate.inc
index 02db0f8182..168a50c5c0 100644
--- a/html/includes/authenticate.inc
+++ b/html/includes/authenticate.inc
@@ -22,12 +22,13 @@ if($_GET['logout']) {
$encrypted=$_COOKIE['encrypted'];
}
- $sql = "select username, level from users where username='$_SESSION[username]' and password='$encrypted'";
+ $sql = "select username, level, user_id from users where username='$_SESSION[username]' and password='$encrypted'";
$row = mysql_fetch_row(mysql_query($sql));
if ( $_SESSION['username'] != "" && $row[0] == $_SESSION['username'] ) {
$_SESSION['userlevel'] = $row[1];
$_SESSION['authenticated'] = true;
+ $_SESSION['user_id'] = $row[2];
setcookie("username", $username);
setcookie("encrypted", $encrypted);
}
diff --git a/html/includes/print-event-short.inc b/html/includes/print-event-short.inc
index fc22c782e2..fe47bbe259 100644
--- a/html/includes/print-event-short.inc
+++ b/html/includes/print-event-short.inc
@@ -17,10 +17,10 @@ if($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; }
$entry[humandate]
| ");
- $if['id'] = $entry[interface];
- $if['if'] = makeshortif($interface);
+ $if['interface_id'] = $entry[interface];
+ $if['ifDescr'] = makeshortif($interface);
echo("
- " . generateiflink($if) . "
+ " . generateiflink($if) . "
|
" .
truncate($entry[message], 45)
diff --git a/html/includes/print-interface-graphs.php b/html/includes/print-interface-graphs.php
index ab752c1166..5df5829afc 100644
--- a/html/includes/print-interface-graphs.php
+++ b/html/includes/print-interface-graphs.php
@@ -1,24 +1,26 @@
', LEFT);\" onmouseout=\"return nd();\">
+ $yearly_traffic = "graph.php?if=" . $interface['interface_id'] . "&type=$graph_type&from=$year&to=$now&width=217&height=100";
+ $yearly_url = "graph.php?if=" . $interface['interface_id'] . "&type=$graph_type&from=$year&to=$now&width=500&height=150";
+
+ echo("', LEFT, BORDER, 0);\" onmouseout=\"return nd();\">
");
- echo("', LEFT);\" onmouseout=\"return nd();\">
+ echo("', LEFT, BORDER, 0);\" onmouseout=\"return nd();\">
");
- echo("', LEFT);\" onmouseout=\"return nd();\">
+ echo("', LEFT, BORDER, 0, WIDTH, 350);\" onmouseout=\"return nd();\">
");
- echo("', LEFT);\" onmouseout=\"return nd();\">
+ echo("', LEFT, BORDER, 0, WIDTH, 350);\" onmouseout=\"return nd();\">
");
?>
diff --git a/html/includes/print-interface.inc b/html/includes/print-interface.inc
index 3192adad01..13dac6284a 100644
--- a/html/includes/print-interface.inc
+++ b/html/includes/print-interface.inc
@@ -2,6 +2,11 @@
# This file prints a table row for each interface
+ $interface['device_id'] = $device['device_id'];
+ $interface['hostname'] = $device['hostname'];
+
+ if(!$_GET['type']) { $_GET['type'] = "bits"; }
+
$if_id = $interface['interface_id'];
$ifDescr = fixifName($interface['ifDescr']);
$ifIndex = $interface['ifIndex'];
@@ -10,18 +15,22 @@
$ifPhysAddress = $interface['ifPhysAddress'];
$ifType = fixiftype($interface['ifType']);
$ifHardType = $interface['ifHardType'];
-
-# echo($interface['ifHardType']);
-
+# $errors = interface_errors($interface);
+# $rates = interface_rates($interface);
+
if($ifAlias) {$ifAlias = $ifAlias . "";}
if($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg="#ffffff"; }
+ if($interface['in_errors'] > 0 || $interface['out_errors'] > 0) {
+ $error_img = generateiflink($interface," ",errors);
+ } else { $error_img = ""; }
+
$graph_url = "graph.php?if=$if_id&from=$twoday&to=$now&width=400&height=120&type=bits";
echo(" |
- " . generateiflink($interface, "$i. $ifDescr") . "
+ " . generateiflink($interface, "$i. $ifDescr") . " $error_img
$ifAlias");
unset ($break);
if(!$dographs) {
@@ -31,6 +40,16 @@
$break = " ";
}
echo("");
+ echo(" | ");
+ if($interface['ifOperStatus'] == "up") {
+
+ $in_perc = round($interface['in_rate']/$interface['ifSpeed']*100);
+ $out_perc = round($interface['in_rate']/$interface['ifSpeed']*100);
+
+ echo(" " . formatRates($interface['in_rate']) . " ");
+ echo(" " . formatRates($interface['out_rate']) . "");
+
+ }
echo(" | ");
if($ifSpeed && $ifSpeed != "") { echo("$ifSpeed"); }
echo(" ");
@@ -84,7 +103,7 @@ echo(" | ");
$this_ifname = fixifName($new['ifDescr']);
$wq = mysql_query("select count(*) FROM links WHERE dst_if = '$this_ifid' AND src_if = $if_id;");
if (@mysql_result($wq, 0) == '0' && $this_hostname != $hostname) {
- $graph_url = "graph.php?if=$this_ifid&from=$twoday&to=$now&width=400&height=120&type=bits";
+ $graph_url = "graph.php?if=$this_ifid&from=$twoday&to=$now&width=400&height=120&type=bits'";
echo("$br
" . generateiflink($new) . " on " . generatedevicelink($new));
$br = "
";
}
@@ -97,15 +116,44 @@ echo("");
// If we're showing graphs, generate the graph and print the img tags
if($dographs && is_file("rrd/" . $hostname . ".". $ifIndex . ".rrd")) {
- $daily_traffic = "graph.php?if=$if_id&type=bits&from=$day&to=$now&width=210&height=100";
- $weekly_traffic = "graph.php?if=$if_id&type=bits&from=$week&to=$now&width=210&height=100";
- $monthly_traffic = "graph.php?if=$if_id&type=bits&from=$month&to=$now&width=210&height=100";
- $yearly_traffic = "graph.php?if=$if_id&type=bits&from=$year&to=$now&width=210&height=100";
+
+ $type = $_GET['type'];
- echo("
");
- echo(" ");
- echo(" ");
- echo(" |
");
+# echo("");
+# include("includes/print-interface-graphs.php");
+# echo(" |
");
+
+ $daily_traffic = "graph.php?if=$if_id&type=" . $_GET['type'] . "&from=$day&to=$now&width=210&height=100";
+ $daily_url = "graph.php?if=$if_id&type=" . $_GET['type'] . "&from=$day&to=$now&width=500&height=150";
+
+ $weekly_traffic = "graph.php?if=$if_id&type=" . $_GET['type'] . "&from=$week&to=$now&width=210&height=100";
+ $weekly_url = "graph.php?if=$if_id&type=" . $_GET['type'] . "&from=$week&to=$now&width=500&height=150";
+
+ $monthly_traffic = "graph.php?if=$if_id&type=" . $_GET['type'] . "&from=$month&to=$now&width=210&height=100";
+ $monthly_url = "graph.php?if=$if_id&type=" . $_GET['type'] . "&from=$month&to=$now&width=500&height=150";
+
+ $yearly_traffic = "graph.php?if=$if_id&type=" . $_GET['type'] . "&from=$year&to=$now&width=210&height=100";
+ $yearly_url = "graph.php?if=$if_id&type=" . $_GET['type'] . "&from=$year&to=$now&width=500&height=150";
+
+ echo("");
+
+ echo("', LEFT, BORDER, 0);\"
+ onmouseout=\"return nd();\"> ");
+ echo("', LEFT, BORDER, 0);\"
+ onmouseout=\"return nd();\"> ");
+ echo("', LEFT, WIDTH, 350, BORDER, 0);\"
+ onmouseout=\"return nd();\"> ");
+ echo("', LEFT, WIDTH, 350, BORDER, 0);\"
+ onmouseout=\"return nd();\"> ");
+
+
+
+ echo(" |
");
+
+# echo("");
+# echo(" ");
+# echo(" ");
+# echo(" |
");
}
diff --git a/html/includes/print-menubar.php b/html/includes/print-menubar.php
index 7e887dc580..14b1f75fef 100644
--- a/html/includes/print-menubar.php
+++ b/html/includes/print-menubar.php
@@ -19,6 +19,7 @@
unset($this_alert);
}
+
?>