fixed check-errors and some other little issues. added EtherLik-MIB. cleaned up mac-accounting

git-svn-id: http://www.observium.org/svn/observer/trunk@482 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-10-12 09:48:40 +00:00
parent 6fcbf53bc6
commit 7c0ddaeca5
7 changed files with 1180 additions and 24 deletions

View File

@ -8,13 +8,20 @@ include("includes/functions.php");
if($argv[1]) { $where = "AND `interface_id` = '$argv[1]'"; }
$i = '0';
$interface_query = mysql_query("SELECT * FROM `interfaces` AS I, `devices` AS D WHERE I.device_id = D.device_id $where");
while ($interface = mysql_fetch_array($interface_query)) {
$errors = interface_errors($interface);
$rrdfile = $config['rrd_dir'] . "/" . $interface['hostname'] . "/" . $interface['ifIndex'] . ".rrd";
$errors = interface_errors($rrdfile);
mysql_query("UPDATE `interfaces` SET in_errors = '" . $errors['in'] . "', out_errors = '" . $errors['out'] . "' WHERE interface_id = '" . $interface['interface_id'] . "'");
if($errors['in'] > '100' || $errors['out'] > '100') { $errored[] = $interface['hostname'] . " - " . $interface['ifDescr'] . " - " . $interface['ifAlias'] . " - " . $errors['in'] . " - " . $errors['out']; }
if($errors['in'] > '100' || $errors['out'] > '100') {
$errored[] = $interface['hostname'] . " - " . $interface['ifDescr'] . " - " . $interface['ifAlias'] . " - " . $errors['in'] . " - " . $errors['out'];
}
$i++;
}
echo("Checked $i Interfaces\n");
if($errored) { ## If there are errored interfaces
$i=0;
@ -22,11 +29,9 @@ if($errored) { ## If there are errored interfaces
foreach ($errored as $int) {
$msg .= "$int\n"; ## Add a line to the report email warning about them
$i++;
}
}
## Send the alert email
mail($config['email_default'], "Observer detected errors on $i interfaces", $msg, $config['email_headers']);
}
?>