show errored ports! (thanks geo)

git-svn-id: http://www.observium.org/svn/observer/trunk@268 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2008-11-03 15:12:09 +00:00
parent e146a966b1
commit e2f12ae6c7
2 changed files with 9 additions and 0 deletions

View File

@ -114,6 +114,11 @@ if($config['show_locations']) { echo("<li><a class='menu2four' href='locations/'
<?php
$errored = mysql_result(mysql_query("SELECT COUNT(*) FROM interfaces WHERE (in_errors > '0' OR out_errors > '0')"),0);
if($errored) {
echo("<li><a href='interfaces/errors/'><img src='images/16/chart_curve_error.png' border=0 align=absmiddle> Errored Ports ($errored)</a></li>");
}
if($_SESSION['userlevel'] >= '5') {
echo("<li><hr width=140 /></li>");
if($config['int_customers']) { echo("<li><a href='customers/'><img src='images/16/group_link.png' border=0 align=absmiddle> Customers</a></li>"); $ifbreak = 1;}

View File

@ -7,14 +7,18 @@
#}
if($_GET['type'] == "down") {
$where = "AND I.ifAdminStatus = 'up' AND I.ifOperStatus = 'down'";
} elseif ($_GET['type'] == "admindown") {
$where = "AND I.ifAdminStatus = 'down'";
} elseif ($_GET['type'] == "errors") {
$where = "AND ( I.`out_errors` > '0' OR I.`in_errors` > '0' )";
}
$sql = "SELECT * FROM `interfaces` AS I, `devices` AS D WHERE I.device_id = D.device_id $where ORDER BY D.hostname, I.ifDescr";
$query = mysql_query($sql);
echo("<table cellspacing=0 cellpadding=2 width=100%>");