git-svn-id: http://www.observium.org/svn/observer/trunk@528 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-11-21 15:07:09 +00:00
parent 79bf6e81b5
commit 64368223a0
15 changed files with 783 additions and 856 deletions
+1
View File
@@ -34,5 +34,6 @@ if (!is_file($cpurrd)) {
shell_exec($config['rrdtool'] . " update $cpurrd N:$cpu_usage");
include("hr-mib.inc.php");
?>
+19 -13
View File
@@ -25,19 +25,25 @@
$ifmib_oids = array_merge($data_oids, $stat_oids);
if(count($ifmib_oids) > (count($ports)*2.5)) { /// If there are 2.5x more interfaces than OIDs, do per-OID
$sub_start = utime();
echo("Caching Ports: ");
foreach($ports as $port) { echo("$port "); $array = snmp_cache_port_oids($ifmib_oids, $port, $device, $array, "IF-MIB"); }
$end = utime(); $run = $end - $sub_start; $proctime = substr($run, 0, 5);
#echo("\n$proctime secs\n");
} else {
$sub_start = utime();
echo("Caching Oids: ");
foreach ($ifmib_oids as $oid) { echo("$oid "); $array = snmp_cache_oid($oid, $device, $array, "IF-MIB"); }
$end = utime(); $run = $end - $sub_start; $proctime = substr($run, 0, 5);
#echo("\n$proctime secs\n");
}
# if(count($ifmib_oids) > (count($ports)*2.5)) { /// If there are 2.5x more interfaces than OIDs, do per-OID
# $sub_start = utime();
# echo("Caching Ports: ");
# foreach($ports as $port) { echo("$port "); $array = snmp_cache_port_oids($ifmib_oids, $port, $device, $array, "IF-MIB"); }
# $end = utime(); $run = $end - $sub_start; $proctime = substr($run, 0, 5);
# #echo("\n$proctime secs\n");
# } else {
# $sub_start = utime();
# echo("Caching Oids: ");
# foreach ($ifmib_oids as $oid) { echo("$oid "); $array = snmp_cache_oid($oid, $device, $array, "IF-MIB"); }
# $end = utime(); $run = $end - $sub_start; $proctime = substr($run, 0, 5);
# #echo("\n$proctime secs\n");
# }
$ifmib_oids = array('ifentry', 'ifxentry');
echo("Caching Oids: ");
foreach ($ifmib_oids as $oid) { echo("$oid "); $array = snmp_cache_oid($oid, $device, $array, "IF-MIB");}
echo("\n");
#foreach ($etherlike_oids as $oid) { $array = snmp_cache_oid($oid, $device, $array, "EtherLike-MIB"); }
#foreach ($cisco_oids as $oid) { $array = snmp_cache_oid($oid, $device, $array, "OLD-CISCO-INTERFACES-MIB"); }