mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
15
check-errors.php
Executable file
15
check-errors.php
Executable 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'] . "'");
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
Reference in New Issue
Block a user