|
|
@@ -104,19 +104,16 @@ foreach ($ports as $row) {
|
|
|
print "<td class=\"$cl\" >" . get_qa($row['nagios']) . "</td>\n";
|
|
|
print "<td class=\"$cl\" >" . get_qa($row['skip']) . "</td>\n";
|
|
|
$vlan = $row['vlan'];
|
|
|
- $ifname= $row['ifName'];
|
|
|
+ $ifname= compact_port_name($row['ifName']);
|
|
|
global $torrus_url;
|
|
|
$f_cacti_url = get_cacti_graph($switch['ip'], $row['snmp_index']);
|
|
|
if (! isset($torrus_url) and (! isset($f_cacti_url))) { $snmp_url=$ifname; }
|
|
|
else {
|
|
|
if (isset($f_cacti_url)) { $snmp_url = "<a href=\"$f_cacti_url\">" . $ifname . "</a>"; }
|
|
|
if (isset($torrus_url)) {
|
|
|
- $normed_ifname = trim(str_replace("/", "_", $ifname));
|
|
|
- $normed_ifname = trim(str_replace(".", "_", $normed_ifname));
|
|
|
+ $normed_ifname = str_replace("/", "_", $ifname);
|
|
|
+ $normed_ifname = str_replace(".", "_", $normed_ifname);
|
|
|
$normed_ifname = trim(str_replace(" ", "_", $normed_ifname));
|
|
|
- $pattern = '/cisco/i';
|
|
|
- preg_match($pattern, $switch['device_model'], $matches);
|
|
|
- if (isset($matches[0])) { $normed_ifname = trim(str_replace("Gi", "GigabitEthernet", $normed_ifname)); }
|
|
|
$t_url = str_replace("HOST_IP", $switch['ip'], $torrus_url);
|
|
|
$t_url = str_replace("IF_NAME", $normed_ifname, $t_url);
|
|
|
$snmp_url = "<a href=\"$t_url\">" . $ifname . "</a>";
|