revert r1957 patch

git-svn-id: http://www.observium.org/svn/observer/trunk@1960 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-23 09:54:56 +00:00
parent 459af33c43
commit de7ff537cc
43 changed files with 3461 additions and 3452 deletions

View File

@@ -15,28 +15,28 @@ $interface_query = mysql_query("SELECT * FROM `ports` AS I, `devices` AS D WHERE
while ($interface = mysql_fetch_array($interface_query))
{
$errors = $interface['ifInErrors_delta'] + $interface['ifOutErrors_delta'];
if ($errors > '1')
{
$errored[] = $interface['hostname'] . " - " . $interface['ifDescr'] . " - " . $interface['ifAlias'] . " - " . $interface['ifInErrors_delta'] . " - " . $interface['ifOutErrors_delta'];
}
$i++;
$errors = $interface['ifInErrors_delta'] + $interface['ifOutErrors_delta'];
if ($errors > '1')
{
$errored[] = $interface['hostname'] . " - " . $interface['ifDescr'] . " - " . $interface['ifAlias'] . " - " . $interface['ifInErrors_delta'] . " - " . $interface['ifOutErrors_delta'];
}
$i++;
}
echo("Checked $i Interfaces\n");
if ($errored)
{ ## If there are errored ports
$i=0;
$msg = "Interfaces with errors : \n\n";
$i = 0;
$msg = "Interfaces with errors : \n\n";
foreach ($errored as $int)
{
$msg .= "$int\n"; ## Add a line to the report email warning about them
$i++;
}
## Send the alert email
notify($device, "Observium detected errors on $i interface" . ($i != 1 ? 's' : ''), $msg);
foreach ($errored as $int)
{
$msg .= "$int\n"; ## Add a line to the report email warning about them
$i++;
}
## Send the alert email
notify($device, "Observium detected errors on $i interface" . ($i != 1 ? 's' : ''), $msg);
}
?>