mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
lots of updates!
git-svn-id: http://www.observium.org/svn/observer/trunk@330 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
|
||||
$peerlist[] = $device['device_id'] ." $peer_ip";
|
||||
|
||||
$astext = trim(str_replace("\"", "", shell_exec("/usr/bin/dig +short AS$peer_as.asn.cymru.com TXT | cut -d '|' -f 5")));
|
||||
$astext = trim(str_replace("\"", "", shell_exec("/usr/bin/dig +short AS$peer_as.asn.cymru.com TXT | cut -d '|' -f 5 | sed s/\\\"//g")));
|
||||
|
||||
#echo(str_pad($peer_ip, 32). str_pad($astext, 32) . " $peer_as ");
|
||||
|
||||
|
||||
@@ -264,9 +264,10 @@ function generateiflink($interface, $text=0,$type=bits)
|
||||
if(!$type) { $type = 'bits'; }
|
||||
$class = ifclass($interface['ifOperStatus'], $interface['ifAdminStatus']);
|
||||
$graph_url = "graph.php?if=" . $interface['interface_id'] . "&from=$day&to=$now&width=400&height=120&type=" . $type;
|
||||
$link = "<a class=$class href='?page=interface&id=" . $interface['interface_id'] . "' ";
|
||||
$link .= "onmouseover=\"return overlib('<div class=list-large>" . $interface['hostname'] . " - " . fixifName($interface['ifDescr']) . "</div><div>";
|
||||
$link .= $interface['ifAlias'] . "</div><img src=\'$graph_url\'>'".$config['overlib_defaults'].");\" onmouseout=\"return nd();\">$text</a>";
|
||||
$link = "<a class=$class href='?page=interface&id=" . $interface['interface_id'] . "' ";
|
||||
$link .= "onmouseover=\" return overlib('<img src=\'$graph_url\'>', CAPTION, '<span class=list-large>" . $interface['hostname'] . " - " . fixifName($interface['ifDescr']) . "</span>' ";
|
||||
$link .= $config['overlib_defaults'].");\" onmouseout=\"return nd();\" >$text</a>";
|
||||
|
||||
return $link;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ if(!$os) {
|
||||
if(strstr($sysDescr, "Cisco Internetwork Operating System Software")) { $os = "IOS"; }
|
||||
if(strstr($sysDescr, "IOS (tm)")) { $os = "IOS"; }
|
||||
if(strstr($sysDescr, "Cisco IOS Software")) { $os = "IOS"; }
|
||||
if(strstr($sysDescr, "IOS-XE")) { $os = "IOS XE"; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -16,24 +16,37 @@
|
||||
if(is_file($Ocpurrd) && !is_file($cpurrd)) { rename($Ocpurrd, $cpurrd); echo("Moving $Ocpurrd to $cpurrd"); }
|
||||
if(is_file($Omemrrd) && !is_file($memrrd)) { rename($Omemrrd, $memrrd); echo("Moving $Omemrrd to $memrrd"); }
|
||||
|
||||
$version = str_replace("Cisco IOS Software,", "", $sysDescr);
|
||||
$version = str_replace("IOS (tm) ", "", $version);
|
||||
$version = str_replace(",RELEASE SOFTWARE", "", $version);
|
||||
$version = str_replace(",MAINTENANCE INTERIM SOFTWARE", "", $version);
|
||||
$version = str_replace("Version ","", $version);
|
||||
$version = str_replace("Cisco Internetwork Operating System Software", "", $version);
|
||||
$version = trim($version);
|
||||
list($version) = explode("\n", $version);
|
||||
$version = preg_replace("/^[A-Za-z0-9\ \_]*\(([A-Za-z0-9\-\_]*)\), (.+), .*/", "\\1|\\2", $version);
|
||||
$version = str_replace("-M|", "|", $version);
|
||||
$version = str_replace("-", "|", $version);
|
||||
list($hardware, $features, $version) = explode("|", $version);
|
||||
$features = fixIOSFeatures($features);
|
||||
#$hardware = fixIOSHardware($hardware);
|
||||
if(strstr($ciscomodel, "OID")){ unset($ciscomodel); }
|
||||
if(!strstr($ciscomodel, " ") && strlen($ciscomodel) >= '3') {
|
||||
$hardware = $ciscomodel;
|
||||
}
|
||||
$version = str_replace("Cisco IOS Software,", "", $sysDescr);
|
||||
$version = str_replace("IOS (tm) ", "", $version);
|
||||
$version = str_replace(",RELEASE SOFTWARE", "", $version);
|
||||
$version = str_replace(",MAINTENANCE INTERIM SOFTWARE", "", $version);
|
||||
$version = str_replace("Version ","", $version);
|
||||
$version = str_replace("Cisco Internetwork Operating System Software", "", $version);
|
||||
$version = trim($version);
|
||||
list($version) = explode("\n", $version);
|
||||
$version = preg_replace("/^[A-Za-z0-9\ \_]*\(([A-Za-z0-9\-\_]*)\), (.+), .*/", "\\1|\\2", $version);
|
||||
$version = str_replace("-M|", "|", $version);
|
||||
$version = str_replace("-", "|", $version);
|
||||
list($hardware, $features, $version) = explode("|", $version);
|
||||
$features = fixIOSFeatures($features);
|
||||
#$hardware = fixIOSHardware($hardware);
|
||||
if(strstr($ciscomodel, "OID")){ unset($ciscomodel); }
|
||||
if(!strstr($ciscomodel, " ") && strlen($ciscomodel) >= '3') {
|
||||
$hardware = $ciscomodel;
|
||||
}
|
||||
|
||||
if($device['os'] == "IOS XE") {
|
||||
list(,$features,$version) = explode(",", $sysDescr);
|
||||
$version = str_replace(" Version ", "", $version);
|
||||
|
||||
$features = str_replace(" IOS-XE Software (", "", $features);
|
||||
$features = str_replace("-M", "", $features);
|
||||
$features = str_replace(")", "", $features);
|
||||
$features = str_replace("PPC_LINUX_IOSD-", "", $features);
|
||||
$features = fixIOSFeatures($features);
|
||||
|
||||
}
|
||||
|
||||
|
||||
list ($cpu5m, $cpu5s) = explode("\n", `snmpget -O qv -v2c -c $community $hostname 1.3.6.1.4.1.9.2.1.58.0 1.3.6.1.4.1.9.2.1.56.0`);
|
||||
$cpu5m = $cpu5m + 0;
|
||||
|
||||
Reference in New Issue
Block a user