|
@@ -103,13 +103,6 @@ print_editdevice_submenu($page_url, $id, $device['device_type'], $user_info['log
|
|
|
$vlan_list = get_switch_vlans($device['vendor_id'],$device['ip'], $device['community'], $device['snmp_version']);
|
|
$vlan_list = get_switch_vlans($device['vendor_id'],$device['ip'], $device['community'], $device['snmp_version']);
|
|
|
//if port number 1 not exists - try detect by snmp interface index
|
|
//if port number 1 not exists - try detect by snmp interface index
|
|
|
if (isset($vlan_list['1'])) { $vlan_at_port_by_snmp = 0; }
|
|
if (isset($vlan_list['1'])) { $vlan_at_port_by_snmp = 0; }
|
|
|
- $ifmib_list = get_snmp_interfaces($device['ip'], $device['community'], $device['snmp_version']);
|
|
|
|
|
- $ports_state_detail = get_ports_state_detail($device['ip'], $device['community'], $device['snmp_version']);
|
|
|
|
|
- $ports_poe_state = get_ports_poe_state($device['vendor_id'], $device['ip'], $device['community'], $device['snmp_version']);
|
|
|
|
|
- if (!empty($ports_poe_state)) {
|
|
|
|
|
- $ports_poe_detail = get_ports_poe_detail($device['vendor_id'], $device['ip'], $device['community'], $device['snmp_version']);
|
|
|
|
|
- if (isset($ports_poe_state['1'])) { $port_poe_by_snmp=0; }
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
$snmp_ok = 0;
|
|
$snmp_ok = 0;
|
|
@@ -163,20 +156,16 @@ print_editdevice_submenu($page_url, $id, $device['device_type'], $user_info['log
|
|
|
$row['port_name'] = $row['port'];
|
|
$row['port_name'] = $row['port'];
|
|
|
$new_info['port_name'] = $row['port'];
|
|
$new_info['port_name'] = $row['port'];
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
if ($snmp_ok) {
|
|
if ($snmp_ok) {
|
|
|
- if (!empty($ports_state_detail)) {
|
|
|
|
|
- if ($ports_state_detail[$row['snmp_index']]['status'] == 1) {
|
|
|
|
|
- $cl = "up";
|
|
|
|
|
- }
|
|
|
|
|
- if ($ports_state_detail[$row['snmp_index']]['status'] >= 2) {
|
|
|
|
|
- if ($ports_state_detail[$row['snmp_index']]['admin_status'] >= 2) {
|
|
|
|
|
- $cl = "shutdown";
|
|
|
|
|
- } else {
|
|
|
|
|
- $cl = "down";
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $port_state_detail = get_port_state_detail($row['snmp_index'], $device['ip'], $device['community'], $device['snmp_version']);
|
|
|
|
|
+ list($poper, $padmin, $pspeed, $perrors) = explode(';', $port_state_detail);
|
|
|
|
|
+ if ($poper == 1) { $cl = "up"; }
|
|
|
|
|
+ if ($poper >= 2) {
|
|
|
|
|
+ if ($padmin >= 2) { $cl = "shutdown"; } else { $cl = "down"; }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
print "<td class='" . $cl . "' style='padding:0'><input type=checkbox name=d_port_index[] value=" . $row['snmp_index'] . " ></td>\n";
|
|
print "<td class='" . $cl . "' style='padding:0'><input type=checkbox name=d_port_index[] value=" . $row['snmp_index'] . " ></td>\n";
|
|
|
print "<td class='" . $cl . "'><a href=\"editport.php?id=" . $row['id'] . "\">" . $row['port'] . "</a></td>\n";
|
|
print "<td class='" . $cl . "'><a href=\"editport.php?id=" . $row['id'] . "\">" . $row['port'] . "</a></td>\n";
|
|
|
print "<td class='" . $cl . "' >" . $row['port_name'] . "</td>\n";
|
|
print "<td class='" . $cl . "' >" . $row['port_name'] . "</td>\n";
|
|
@@ -200,20 +189,18 @@ print_editdevice_submenu($page_url, $id, $device['device_type'], $user_info['log
|
|
|
//sfp information
|
|
//sfp information
|
|
|
$sfp_status = get_sfp_status($device['vendor_id'], $row['snmp_index'], $device['ip'], $device['community'], $device['snmp_version'], $modules_oids);
|
|
$sfp_status = get_sfp_status($device['vendor_id'], $row['snmp_index'], $device['ip'], $device['community'], $device['snmp_version'], $modules_oids);
|
|
|
|
|
|
|
|
|
|
+ //interface name
|
|
|
|
|
+ $ifname = get_snmp_ifname($device['ip'], $device['community'], $device['snmp_version'], $row['snmp_index']);
|
|
|
|
|
+
|
|
|
//poe information
|
|
//poe information
|
|
|
- if (isset($ports_poe_state)) {
|
|
|
|
|
- if ($port_poe_by_snmp) {
|
|
|
|
|
- $poe_status = $ports_poe_state[$row['snmp_index']];
|
|
|
|
|
- } else {
|
|
|
|
|
- $poe_status = $ports_poe_state[$row['port']];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $poe_status = get_port_poe_state($device['vendor_id'], $row['port'], $row['snmp_index'], $device['ip'], $device['community'], $device['snmp_version']);
|
|
|
|
|
+ if (isset($poe_status)) {
|
|
|
if ($poe_status == 1) {
|
|
if ($poe_status == 1) {
|
|
|
- if ($port_poe_by_snmp) { $port_poe_detail = $ports_poe_detail[$row['snmp_index']]; } else { $port_poe_detail = $ports_poe_detail[$row['port']]; }
|
|
|
|
|
- if (empty($port_poe_detail) or $port_poe_detail['power'] == 0) {
|
|
|
|
|
|
|
+ $port_poe_detail = get_port_poe_detail($device['vendor_id'], $row['port'], $row['snmp_index'], $device['ip'], $device['community'], $device['snmp_version']);
|
|
|
|
|
+ if (empty($port_poe_detail)) {
|
|
|
$poe_info = 'POE:on';
|
|
$poe_info = 'POE:on';
|
|
|
} else {
|
|
} else {
|
|
|
- $poe_info = $port_poe_detail['volt_display'].';'.$port_poe_detail['current_display'].';'.$port_poe_detail['power_display'].';'.$port_poe_detail['class_display'];
|
|
|
|
|
- $poe_info = preg_replace('/\;\;/',';',$poe_info);
|
|
|
|
|
|
|
+ $poe_info = $port_poe_detail;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if ($poe_status == 2) {
|
|
if ($poe_status == 2) {
|
|
@@ -301,42 +288,40 @@ print_editdevice_submenu($page_url, $id, $device['device_type'], $user_info['log
|
|
|
$speed = "0";
|
|
$speed = "0";
|
|
|
$cl_speed = $cl;
|
|
$cl_speed = $cl;
|
|
|
|
|
|
|
|
- if (empty($ports_state_detail[$row['snmp_index']]['speed'])) { $ports_state_detail[$row['snmp_index']]['speed'] = 0; }
|
|
|
|
|
-
|
|
|
|
|
- if ($ports_state_detail[$row['snmp_index']]['speed'] == 0) {
|
|
|
|
|
|
|
+ if ($pspeed == 0) {
|
|
|
$speed = "";
|
|
$speed = "";
|
|
|
}
|
|
}
|
|
|
- if ($ports_state_detail[$row['snmp_index']]['speed'] == 10000000) {
|
|
|
|
|
|
|
+ if ($pspeed == 10000000) {
|
|
|
$speed = "10M";
|
|
$speed = "10M";
|
|
|
$cl_speed = "speed10M";
|
|
$cl_speed = "speed10M";
|
|
|
}
|
|
}
|
|
|
- if ($ports_state_detail[$row['snmp_index']]['speed'] == 100000000) {
|
|
|
|
|
|
|
+ if ($pspeed == 100000000) {
|
|
|
$speed = "100M";
|
|
$speed = "100M";
|
|
|
$cl_speed = "speed100M";
|
|
$cl_speed = "speed100M";
|
|
|
}
|
|
}
|
|
|
- if ($ports_state_detail[$row['snmp_index']]['speed'] == 1000000000) {
|
|
|
|
|
|
|
+ if ($pspeed == 1000000000) {
|
|
|
$speed = "1G";
|
|
$speed = "1G";
|
|
|
$cl_speed = "speed1G";
|
|
$cl_speed = "speed1G";
|
|
|
}
|
|
}
|
|
|
- if ($ports_state_detail[$row['snmp_index']]['speed'] == 10000000000) {
|
|
|
|
|
|
|
+ if ($pspeed == 10000000000) {
|
|
|
$speed = "10G";
|
|
$speed = "10G";
|
|
|
$cl_speed = "speed10G";
|
|
$cl_speed = "speed10G";
|
|
|
}
|
|
}
|
|
|
- if ($ports_state_detail[$row['snmp_index']]['speed'] == 4294967295) {
|
|
|
|
|
|
|
+ if ($pspeed == 4294967295) {
|
|
|
$speed = "10G";
|
|
$speed = "10G";
|
|
|
$cl_speed = "speed10G";
|
|
$cl_speed = "speed10G";
|
|
|
}
|
|
}
|
|
|
- if ($ports_state_detail[$row['snmp_index']]['speed'] == 10) {
|
|
|
|
|
|
|
+ if ($pspeed == 10) {
|
|
|
$speed = "10G";
|
|
$speed = "10G";
|
|
|
$cl_speed = "speed10G";
|
|
$cl_speed = "speed10G";
|
|
|
}
|
|
}
|
|
|
print "<td class=\"$cl_speed\">" . $speed . "</td>\n";
|
|
print "<td class=\"$cl_speed\">" . $speed . "</td>\n";
|
|
|
-
|
|
|
|
|
$cl_error = $cl;
|
|
$cl_error = $cl;
|
|
|
- if ($ports_state_detail[$row['snmp_index']]['errors'] > 0) {
|
|
|
|
|
|
|
+ if ($perrors > 0) {
|
|
|
$cl_error = "crc";
|
|
$cl_error = "crc";
|
|
|
}
|
|
}
|
|
|
- print "<td class=\"$cl_error\">" . $ports_state_detail[$row['snmp_index']]['errors'] . "</td>\n";
|
|
|
|
|
|
|
+
|
|
|
|
|
+ print "<td class=\"$cl_error\">" . $perrors . "</td>\n";
|
|
|
print "<td class='" . $cl . "' ><button name=\"write\" class=\"j-submit-report\" onclick=\"window.open('portmactable.php?id=" . $row['id'] . "')\">" . $row['last_mac_count'] . "</button></td>\n";
|
|
print "<td class='" . $cl . "' ><button name=\"write\" class=\"j-submit-report\" onclick=\"window.open('portmactable.php?id=" . $row['id'] . "')\">" . $row['last_mac_count'] . "</button></td>\n";
|
|
|
print "<td class='" . $cl . "'>" . $sfp_status . " " . $poe_info . "</td>\n";
|
|
print "<td class='" . $cl . "'>" . $sfp_status . " " . $poe_info . "</td>\n";
|
|
|
if (isset($poe_status) and !$row['skip'] and !$device['is_router']) {
|
|
if (isset($poe_status) and !$row['skip'] and !$device['is_router']) {
|