cpu polling support for Juniper JunOS. tested on m7i only

git-svn-id: http://www.observium.org/svn/observer/trunk@910 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-02-21 05:08:58 +00:00
parent 3af0ee222a
commit 8fc2f2e756
4 changed files with 27 additions and 0 deletions
+3
View File
@@ -60,6 +60,9 @@ $config['bad_if'] = array("voip-null", "virtual-", "unrouted", "eobc", "mpls", "
$config['bad_if_regexp'] = array("/serial[0-9]:/");
$config['processor_filter'][] = "An electronic chip that makes the computer work.";
# Sensors
$config['allow_entity_sensor']['amperes'] = 1;
+1
View File
@@ -4,6 +4,7 @@ echo("Processors : ");
include("processors-ios.inc.php");
include("processors-junose.inc.php");
include("processors-junos.inc.php");
include("processors-hrdevice.inc.php");
include("processors-ironware.inc.php");
+21
View File
@@ -96,6 +96,27 @@ function snmpwalk_cache_oid($poll_oid, $device, $array, $mib = NULL, $mibdir = N
return $array;
}
function snmpwalk_cache_multi_oid($device, $oid, $array, $mib = NULL, $mibdir = NULL) {
$data = snmp_walk($device, $oid, "-OQUs", $mib, $mibdir);
foreach(explode("\n", $data) as $entry) {
list($oid,$value) = explode("=", $entry);
$oid = trim($oid); $value = trim($value);
$oid_parts = explode(".", $oid);
$oid = $oid_parts['0'];
$index = $oid_parts['1'];
if(isset($oid_parts['2'])) { $index .= ".".$oid_parts['2']; }
if(isset($oid_parts['3'])) { $index .= ".".$oid_parts['3']; }
if(isset($oid_parts['4'])) { $index .= ".".$oid_parts['4']; }
if(isset($oid_parts['5'])) { $index .= ".".$oid_parts['5']; }
if(isset($oid_parts['6'])) { $index .= ".".$oid_parts['6']; }
if (!strstr($value, "at this OID") && isset($oid) && isset($index)) {
$array[$device[device_id]][$index][$oid] = $value;
}
}
return $array;
}
function snmpwalk_cache_double_oid($device, $oid, $array, $mib = NULL, $mibdir = NULL) {
$data = snmp_walk($device, $oid, "-OQUs", $mib, $mibdir);
foreach(explode("\n", $data) as $entry) {
+2
View File
@@ -44,6 +44,8 @@ $devices_polled = 0;
echo("includes/discovery/".$type.".php \n");
$debug = 1;
$device_query = mysql_query("SELECT * FROM `devices` WHERE status = '1' $where ORDER BY device_id ASC");
while ($device = mysql_fetch_array($device_query)) {