updates to unix cpu and devices without certain OIDs

git-svn-id: http://www.observium.org/svn/observer/trunk@518 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-11-12 14:53:09 +00:00
parent 45e760ae04
commit d8155aacff
3 changed files with 9 additions and 8 deletions

View File

@@ -30,10 +30,11 @@ $scale_max = "100";
$nototal = 1;
if ($rrd_list) {
include ("generic_multi_line.inc.php");
if ($not) {
} else {
include("common.inc.php");
$rrd_filename = $config['rrd_dir'] . "/" . $hostname . "/" . "ucd_cpu.rrd";
$rrd_options .= " DEF:user=$rrd_filename:user:AVERAGE";

View File

@@ -43,7 +43,7 @@ global $config;
$this_index = trim($this_index);
$this_oid = trim($this_oid);
$this_value = trim($this_value);
if(!strstr($this_value, "No Such Instance currently exists at this OID") && $this_index) {
if(!strstr($this_value, "at this OID") && $this_index) {
$array[] = $this_value;
}
}
@@ -62,7 +62,7 @@ function snmpwalk_cache_oid($oid, $device, $array, $mib = 0) {
list($oid,$value) = explode("=", $entry);
$oid = trim($oid); $value = trim($value);
list($oid, $index) = explode(".", $oid);
if (!strstr($this_value, "No Such Instance currently exists at this OID") && $oid && $index) {
if (!strstr($this_value, "at this OID") && $oid && $index) {
$array[$device_id][$index][$oid] = $value;
}
}
@@ -81,7 +81,7 @@ function snmpwalk_cache_twopart_oid($oid, $device, $array, $mib = 0) {
list($oid,$value) = explode("=", $entry);
$oid = trim($oid); $value = trim($value);
list($oid, $first, $second) = explode(".", $oid);
if (!strstr($this_value, "No Such Instance currently exists at this OID") && $oid && $first && $second) {
if (!strstr($this_value, "at this OID") && $oid && $first && $second) {
$array[$device_id][$first][$second][$oid] = $value;
}
}
@@ -124,7 +124,7 @@ function snmp_cache_oid($oid, $device, $array, $mib = 0) {
$this_index = trim($this_index);
$this_oid = trim($this_oid);
$this_value = trim($this_value);
if(!strstr($this_value, "No Such Instance currently exists at this OID") && $this_index) {
if(!strstr($this_value, "at this OID") && $this_index) {
$array[$device_id][$this_index][$this_oid] = $this_value;
}
$array[$device_id][$oid] = '1';
@@ -145,7 +145,7 @@ function snmp_cache_port_oids($oids, $port, $device, $array, $mib=0) {
$values = explode("\n", $data);
#echo("Caching: ifIndex $port\n");
foreach($oids as $oid){
if(!strstr($values[$x], "No Such Instance currently exists at this OID")) {
if(!strstr($values[$x], "at this OID")) {
$array[$device[device_id]][$port][$oid] = $values[$x];
}
$x++;

View File

@@ -77,7 +77,7 @@
$update .= ", `poll_period` = '".$polled_period."'";
/// Copy ifHC[In|Out]Octets values to non-HC if they exist
if(isset($this_port['ifHCInOctets']) && isset($this_port['ifHCOutOctets'])) {
if(is_numeric($this_port['ifHCInOctets']) && is_numeric($this_port['ifHCOutOctets'])) {
echo("HC ");
$this_port['ifInOctets'] = $this_port['ifHCInOctets'];
$this_port['ifOutOctets'] = $this_port['ifHCOutOctets'];