Check for interface errors!

git-svn-id: http://www.observium.org/svn/observer/trunk@111 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2007-06-24 16:07:03 +00:00
parent e06a0bfcb8
commit 71894044e1

15
check-errors.php Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/php
<?php
include("config.php");
include("includes/functions.php");
if($argv[1]) { $where = "AND `interface_id` = '$argv[1]'"; }
$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);
mysql_query("UPDATE `interfaces` SET in_errors = '" . $errors['in'] . "', out_errors = '" . $errors['out'] . "' WHERE interface_id = '" . $interface['interface_id'] . "'");
}
?>