mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
change interfaces table to ports (to match GUI conventions)
git-svn-id: http://www.observium.org/svn/observer/trunk@889 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$interface = mysql_fetch_array(mysql_query("SELECT * FROM `interfaces` WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '".$entry[2]."'"));
|
||||
$interface = mysql_fetch_array(mysql_query("SELECT * FROM `ports` WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '".$entry[2]."'"));
|
||||
|
||||
if(!$interface) {exit;}
|
||||
|
||||
@@ -14,7 +14,7 @@ if(!$interface) {exit;}
|
||||
#}
|
||||
if($ifOperStatus != $interface['ifOperStatus']) {
|
||||
log_event("Interface went Down : " . $interface['ifDescr'] . " (TRAP)", $device, "interface", $interface['interface_id']);
|
||||
mysql_query("UPDATE `interfaces` SET ifOperStatus = 'down' WHERE `interface_id` = '".$interface['interface_id']."'");
|
||||
mysql_query("UPDATE `ports` SET ifOperStatus = 'down' WHERE `interface_id` = '".$interface['interface_id']."'");
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$interface = mysql_fetch_array(mysql_query("SELECT * FROM `interfaces` WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '".$entry[2]."'"));
|
||||
$interface = mysql_fetch_array(mysql_query("SELECT * FROM `ports` WHERE `device_id` = '".$device['device_id']."' AND `ifIndex` = '".$entry[2]."'"));
|
||||
|
||||
if(!$interface) {exit;}
|
||||
|
||||
@@ -11,11 +11,11 @@ if(!$interface) {exit;}
|
||||
|
||||
if($ifAdminStatus != $interface['ifAdminStatus']) {
|
||||
log_event("Interface Enabled : " . $interface['ifDescr'] . " (TRAP)", $device, "interface", $interface['interface_id']);
|
||||
mysql_query("UPDATE `interfaces` SET ifAdminStatus = 'up' WHERE `interface_id` = '".$interface['interface_id']."'");
|
||||
mysql_query("UPDATE `ports` SET ifAdminStatus = 'up' WHERE `interface_id` = '".$interface['interface_id']."'");
|
||||
}
|
||||
if($ifOperStatus != $interface['ifOperStatus']) {
|
||||
log_event("Interface went Up : " . $interface['ifDescr'] . " (TRAP)", $device, "interface", $interface['interface_id']);
|
||||
mysql_query("UPDATE `interfaces` SET ifOperStatus = 'up' WHERE `interface_id` = '".$interface['interface_id']."'");
|
||||
mysql_query("UPDATE `ports` SET ifOperStatus = 'up' WHERE `interface_id` = '".$interface['interface_id']."'");
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user