mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
updating
git-svn-id: http://www.observium.org/svn/observer/trunk@79 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@ -9,6 +9,9 @@
|
|||||||
$ifSpeed = humanspeed($interface['ifSpeed']);
|
$ifSpeed = humanspeed($interface['ifSpeed']);
|
||||||
$ifPhysAddress = $interface['ifPhysAddress'];
|
$ifPhysAddress = $interface['ifPhysAddress'];
|
||||||
$ifType = fixiftype($interface['ifType']);
|
$ifType = fixiftype($interface['ifType']);
|
||||||
|
$ifHardType = $interface['ifHardType'];
|
||||||
|
|
||||||
|
# echo($interface['ifHardType']);
|
||||||
|
|
||||||
if($ifAlias) {$ifAlias = $ifAlias . "</br>";}
|
if($ifAlias) {$ifAlias = $ifAlias . "</br>";}
|
||||||
if($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg="#ffffff"; }
|
if($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg="#ffffff"; }
|
||||||
@ -22,7 +25,7 @@
|
|||||||
</span><br /><span class=interface-desc>$ifAlias</span>");
|
</span><br /><span class=interface-desc>$ifAlias</span>");
|
||||||
unset ($break);
|
unset ($break);
|
||||||
if(!$dographs) {
|
if(!$dographs) {
|
||||||
$ipdata = mysql_query("SELECT * FROM `ipaddr` WHERE `interface_id` = '$interface[interface_id]'");
|
$ipdata = mysql_query("SELECT * FROM `ipaddr` WHERE `interface_id` = '" . $interface['interface_id'] . "'");
|
||||||
while($ip = mysql_fetch_Array($ipdata)) {
|
while($ip = mysql_fetch_Array($ipdata)) {
|
||||||
echo("$break <a class=interface-desc href=\"javascript:popUp('/netcmd.php?cmd=whois&query=$ip[addr]')\">$ip[addr]/$ip[cidr]</a>");
|
echo("$break <a class=interface-desc href=\"javascript:popUp('/netcmd.php?cmd=whois&query=$ip[addr]')\">$ip[addr]/$ip[cidr]</a>");
|
||||||
$break = " ";
|
$break = " ";
|
||||||
@ -30,20 +33,22 @@
|
|||||||
echo("</span>");
|
echo("</span>");
|
||||||
echo("</td><td width=70>");
|
echo("</td><td width=70>");
|
||||||
if($ifSpeed && $ifSpeed != "") { echo("<span class=box-desc>$ifSpeed</span>"); }
|
if($ifSpeed && $ifSpeed != "") { echo("<span class=box-desc>$ifSpeed</span>"); }
|
||||||
|
echo("<br />");
|
||||||
|
if($interface[ifDuplex] != unknown) { echo("<span class=box-desc>Duplex " . $interface['ifDuplex'] . "</span>"); } else { echo("-"); }
|
||||||
|
echo("</td><td width=150>");
|
||||||
|
if($ifType && $ifType != "") { echo("<span class=box-desc>" . $ifType . "</span>"); } else { echo("-"); }
|
||||||
|
echo("<br />");
|
||||||
|
if($ifHardType && $ifHardType != "") { echo("<span class=box-desc>" . $ifHardType . "</span>"); } else { echo("-"); }
|
||||||
echo("</td><td width=150>");
|
echo("</td><td width=150>");
|
||||||
if($ifType && $iftype != "") { echo("<span class=box-desc>" . $ifType . "</span>"); } else { echo("-"); }
|
|
||||||
echo("</td><td width=80>");
|
|
||||||
if($interface['ifPhysAddress'] && $interface['ifPhysAddress'] != "") { echo("<span class=box-desc>" . $interface['ifPhysAddress'] . "</span>"); } else { echo("-"); }
|
if($interface['ifPhysAddress'] && $interface['ifPhysAddress'] != "") { echo("<span class=box-desc>" . $interface['ifPhysAddress'] . "</span>"); } else { echo("-"); }
|
||||||
echo("</td><td width=80>");
|
echo("<br />");
|
||||||
if($interface['ifMtu'] && $interface['ifMtu'] != "") { echo("<span class=box-desc>MTU " . $interface['ifMtu'] . "</span>"); } else { echo("-"); }
|
if($interface['ifMtu'] && $interface['ifMtu'] != "") { echo("<span class=box-desc>MTU " . $interface['ifMtu'] . "</span>"); } else { echo("-"); }
|
||||||
|
|
||||||
# if($interface[ifDuplex] != unknown) { echo("<span class=box-desc>Duplex " . $interface['ifDuplex'] . "</span>"); } else { echo("-"); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo("</td>");
|
echo("</td>");
|
||||||
echo("<td valign=top class=interface-desc>");
|
echo("<td valign=top class=interface-desc>");
|
||||||
if ( strpos($ifDescr, "oopback") === false && !$dographs) {
|
if ( strpos($ifDescr, "oopback") === false && !$dographs) {
|
||||||
$link_query = mysql_query("select I.ifDescr, D.hostname, D.id, I.interface_id from links AS L, interfaces AS I, devices AS D WHERE L.src_if = '$if_id' AND L.dst_if = I.interface_id AND I.device_id = D.id");
|
$link_query = mysql_query("select * from links AS L, interfaces AS I, devices AS D WHERE L.src_if = '$if_id' AND L.dst_if = I.interface_id AND I.device_id = D.device_id");
|
||||||
while($link = mysql_fetch_array($link_query)) {
|
while($link = mysql_fetch_array($link_query)) {
|
||||||
echo("<img src='images/16/connect.png' align=absmiddle alt='Directly Connected' /> " . generateiflink($link) . " on " . generatedevicelink($link) . "</a><br />");
|
echo("<img src='images/16/connect.png' align=absmiddle alt='Directly Connected' /> " . generateiflink($link) . " on " . generatedevicelink($link) . "</a><br />");
|
||||||
$br = "<br />";
|
$br = "<br />";
|
||||||
|
@ -1,16 +1,14 @@
|
|||||||
<?
|
<?
|
||||||
|
|
||||||
$interface_query = mysql_query("select * from interfaces WHERE id = '$_GET[id]'");
|
$interface_query = mysql_query("select * from interfaces WHERE interface_id = '$_GET[id]'");
|
||||||
$interface = mysql_fetch_array($interface_query);
|
$interface = mysql_fetch_array($interface_query);
|
||||||
|
|
||||||
$device_query = mysql_query("select * from devices where id = '$interface[host]'");
|
$device_query = mysql_query("select * from devices where id = '$interface[host]'");
|
||||||
$device = mysql_fetch_array($device_query);
|
$device = mysql_fetch_array($device_query);
|
||||||
|
|
||||||
$hostname = $device['hostname'];
|
$hostname = $device['hostname'];
|
||||||
$hostid = $device['id'];
|
$hostid = $device['interface_id'];
|
||||||
$ifname = $interface['if'];
|
$ifname = $interface['ifDescr'];
|
||||||
$up = $interface['up'];
|
|
||||||
$up_admin = $interface['up_admin'];
|
|
||||||
$ifIndex = $interface['ifIndex'];
|
$ifIndex = $interface['ifIndex'];
|
||||||
$speed = humanspeed($interface['ifSpeed']);
|
$speed = humanspeed($interface['ifSpeed']);
|
||||||
|
|
||||||
@ -19,9 +17,9 @@ $interface = mysql_fetch_array($interface_query);
|
|||||||
if($interface['ifPhysAddress']) { $mac = "$interface[ifPhysAddress]"; }
|
if($interface['ifPhysAddress']) { $mac = "$interface[ifPhysAddress]"; }
|
||||||
|
|
||||||
$color = "black";
|
$color = "black";
|
||||||
if ($up_admin == "down") { $status = "<span class='grey'>Disabled</span>"; }
|
if ($interface['ifAdminStatus'] == "down") { $status = "<span class='grey'>Disabled</span>"; }
|
||||||
if ($up_admin == "up" && $up == "down") { $status = "<span class='red'>Enabled / Disconnected</span>"; }
|
if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "down") { $status = "<span class='red'>Enabled / Disconnected</span>"; }
|
||||||
if ($up_admin == "up" && $up == "up") { $status = "<span class='green'>Enabled / Connected</span>"; }
|
if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "up") { $status = "<span class='green'>Enabled / Connected</span>"; }
|
||||||
|
|
||||||
$i = 1;
|
$i = 1;
|
||||||
$inf = fixifName($ifname);
|
$inf = fixifName($ifname);
|
||||||
|
@ -300,9 +300,11 @@ function makeshortif($if) {
|
|||||||
$if = str_replace("pos","Pos", $if);
|
$if = str_replace("pos","Pos", $if);
|
||||||
$if = str_replace("port-channel","Po", $if);
|
$if = str_replace("port-channel","Po", $if);
|
||||||
$if = str_replace("atm","Atm", $if);
|
$if = str_replace("atm","Atm", $if);
|
||||||
|
$if = str_replace("null", "Null", $if);
|
||||||
$if = str_replace("loopback","Lo", $if);
|
$if = str_replace("loopback","Lo", $if);
|
||||||
$if = str_replace("dialer","Di", $if);
|
$if = str_replace("dialer","Di", $if);
|
||||||
$if = str_replace("vlan","Vlan", $if);
|
$if = str_replace("vlan","Vlan", $if);
|
||||||
|
$if = str_replace("tunnel","Tunnel", $if);
|
||||||
return $if;
|
return $if;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ while ($interface = mysql_fetch_array($interface_query)) {
|
|||||||
if ($update) {
|
if ($update) {
|
||||||
$update_query = "UPDATE `interfaces` SET ";
|
$update_query = "UPDATE `interfaces` SET ";
|
||||||
$update_query .= $update;
|
$update_query .= $update;
|
||||||
$update_query .= " WHERE `id` = '" . $interface['interface_id'] . "'";
|
$update_query .= " WHERE `interface_id` = '" . $interface['interface_id'] . "'";
|
||||||
echo("Updating : " . $device['hostname'] . " $ifDescr\nSQL :$update_query\n\n");
|
echo("Updating : " . $device['hostname'] . " $ifDescr\nSQL :$update_query\n\n");
|
||||||
$update_result = mysql_query($update_query);
|
$update_result = mysql_query($update_query);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user