mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
more db*
git-svn-id: http://www.observium.org/svn/observer/trunk@2312 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -2,6 +2,25 @@
|
||||
|
||||
## Common Functions
|
||||
|
||||
function delete_port($int_id)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$interface = dbFetchRow("SELECT * FROM `ports` AS P, `devices` AS D WHERE P.interface_id = ? AND D.device_id = P.device_id", array($int_id));
|
||||
|
||||
$interface_tables = array('adjacencies', 'ipaddr', 'ip6adjacencies', 'ip6addr', 'mac_accounting', 'bill_ports', 'pseudowires', 'ports');
|
||||
|
||||
foreach($interface_tables as $table) {
|
||||
dbDelete($table, "`interface_id` = ?", array($int_id));
|
||||
}
|
||||
|
||||
dbDelete('links', "`local_interface_id` = ?", array($int_id));
|
||||
dbDelete('links', "`remote_interface_id` = ?", array($int_id));
|
||||
dbDelete('bill_ports', "`port_id` = ?", array($int_id));
|
||||
|
||||
unlink(trim($config['rrd_dir'])."/".trim($interface['hostname'])."/".$interface['ifIndex'].".rrd");
|
||||
}
|
||||
|
||||
function sgn($int)
|
||||
{
|
||||
if ($int < 0)
|
||||
|
||||
Reference in New Issue
Block a user