mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
git-svn-id: http://www.observium.org/svn/observer/trunk@78 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
+4
-1
@@ -4,7 +4,9 @@
|
||||
include("config.php");
|
||||
include("includes/functions.php");
|
||||
|
||||
$interface_query = mysql_query("SELECT * FROM `interfaces`");
|
||||
if($argv[1]) { $where = "WHERE `interface_id` LIKE '%$argv[1]'"; }
|
||||
|
||||
$interface_query = mysql_query("SELECT * FROM `interfaces` $where");
|
||||
while ($interface = mysql_fetch_array($interface_query)) {
|
||||
|
||||
$device = mysql_fetch_array(mysql_query("SELECT * FROM `devices` WHERE device_id = '" . $interface['device_id'] . "'"));
|
||||
@@ -22,6 +24,7 @@ while ($interface = mysql_fetch_array($interface_query)) {
|
||||
$snmp_output = str_replace("\"", "", $snmp_output);
|
||||
|
||||
echo("Looking at " . $interface['ifDescr'] . " on " . $device['hostname'] . "\n");
|
||||
|
||||
list($ifName, $ifDescr, $ifAdminStatus, $ifOperStatus, $ifAlias, $ifSpeed, $ifDuplex, $ifType, $ifMtu, $ifPhysAddress, $ifHardType) = explode("\n", $snmp_output);
|
||||
$ifDescr = trim(str_replace("\"", "", $ifDescr));
|
||||
if ($ifDuplex == 3) { $ifDuplex = "half"; } elseif ($ifDuplex == 2) { $ifDuplex = "full"; } else { $ifDuplex = "unknown"; }
|
||||
|
||||
Reference in New Issue
Block a user