mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: Improve sensors polling for performance increase (#4725)
refactor: Improve sensors polling for performance increase
This commit is contained in:
committed by
Søren Rosiak
parent
781c07c658
commit
6c324cd03e
@@ -11,6 +11,7 @@ if ($_POST['editing']) {
|
||||
$poller_group = isset($_POST['poller_group']) ? mres($_POST['poller_group']) : 0;
|
||||
$port_assoc_mode = mres($_POST['port_assoc_mode']);
|
||||
$max_repeaters = mres($_POST['max_repeaters']);
|
||||
$max_oid = mres($_POST['max_oid']);
|
||||
$v3 = array(
|
||||
'authlevel' => mres($_POST['authlevel']),
|
||||
'authname' => mres($_POST['authname']),
|
||||
@@ -49,6 +50,7 @@ if ($_POST['editing']) {
|
||||
$rows_updated = dbUpdate($update, 'devices', '`device_id` = ?', array($device['device_id']));
|
||||
|
||||
$max_repeaters_set = false;
|
||||
$max_oid_set = false;
|
||||
|
||||
if (is_numeric($max_repeaters) && $max_repeaters != 0) {
|
||||
set_dev_attrib($device, 'snmp_max_repeaters', $max_repeaters);
|
||||
@@ -58,12 +60,25 @@ if ($_POST['editing']) {
|
||||
$max_repeaters_set = true;
|
||||
}
|
||||
|
||||
if (is_numeric($max_oid) && $max_oid != 0) {
|
||||
set_dev_attrib($device, 'snmp_max_oid', $max_oid);
|
||||
$max_oid_set = true;
|
||||
} else {
|
||||
del_dev_attrib($device, 'snmp_max_oid');
|
||||
$max_oid_set = true;
|
||||
}
|
||||
|
||||
if ($rows_updated > 0) {
|
||||
$update_message = $rows_updated.' Device record updated.';
|
||||
$updated = 1;
|
||||
} elseif ($rows_updated = '-1') {
|
||||
if ($max_repeaters_set === true) {
|
||||
$update_message = 'SNMP Max repeaters updated, no other changes made';
|
||||
if ($max_repeaters_set === true || $max_repeaters_set === true) {
|
||||
if ($max_repeaters_set === true) {
|
||||
$update_message = 'SNMP Max repeaters updated, no other changes made';
|
||||
}
|
||||
if ($max_oid_set === true) {
|
||||
$update_message .= '<br />SNMP Max OID updated, no other changes made';
|
||||
}
|
||||
} else {
|
||||
$update_message = 'Device record unchanged. No update necessary.';
|
||||
}
|
||||
@@ -89,6 +104,7 @@ if ($updated && $update_message) {
|
||||
}
|
||||
|
||||
$max_repeaters = get_dev_attrib($device, 'snmp_max_repeaters');
|
||||
$max_oid = get_dev_attrib($device, 'snmp_max_oid');
|
||||
|
||||
echo "
|
||||
<form id='edit' name='edit' method='post' action='' role='form' class='form-horizontal'>
|
||||
@@ -155,6 +171,12 @@ echo " </select>
|
||||
<input id='max_repeaters' name='max_repeaters' class='form-control input-sm' value='".$max_repeaters."' placeholder='max rep' />
|
||||
</div>
|
||||
</div>
|
||||
<div class='form-group'>
|
||||
<label for='max_oid' class='col-sm-2 control-label'>Max OIDs</label>
|
||||
<div class='col-sm-1'>
|
||||
<input id='max_oid' name='max_oid' class='form-control input-sm' value='".$max_oid."' placeholder='max oids' />
|
||||
</div>
|
||||
</div>
|
||||
<div id='snmpv1_2'>
|
||||
<div class='form-group'>
|
||||
<label class='col-sm-3 control-label text-left'><h4><strong>SNMPv1/v2c Configuration</strong></h4></label>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'apc') {
|
||||
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.1.2.3.1.0', '-OsqnU', '');
|
||||
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.1.2.3.1.0', '-OsqnU', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
// Try High-Precision First
|
||||
@@ -12,7 +12,7 @@ if ($device['os'] == 'apc') {
|
||||
|
||||
$precision = 10;
|
||||
$sensorType = 'apc';
|
||||
$current_oid = '1.3.6.1.4.1.318.1.1.1.2.3.1.0';
|
||||
$current_oid = '.1.3.6.1.4.1.318.1.1.1.2.3.1.0';
|
||||
$index = 0;
|
||||
$current_val = ($current / $precision);
|
||||
$limit = 100;
|
||||
@@ -23,7 +23,7 @@ if ($device['os'] == 'apc') {
|
||||
discover_sensor($valid['sensor'], 'charge', $device, $current_oid, $index, $sensorType, $descr, $precision, '1', $lowlimit, $warnlimit, null, $limit, $current_val);
|
||||
} else {
|
||||
// Try to just get capacity
|
||||
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.1.2.2.1.0', '-OsqnU', '');
|
||||
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.1.2.2.1.0', '-OsqnU', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if (!empty($oids)) {
|
||||
@@ -33,7 +33,7 @@ if ($device['os'] == 'apc') {
|
||||
|
||||
$precision = 1;
|
||||
$sensorType = 'apc';
|
||||
$current_oid = '1.3.6.1.4.1.318.1.1.1.2.2.1.0';
|
||||
$current_oid = '.1.3.6.1.4.1.318.1.1.1.2.2.1.0';
|
||||
$index = 0;
|
||||
$current_val = $current;
|
||||
$limit = 100;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modules_compat']['rfc1628'][$device['os']]) {
|
||||
echo 'RFC1628 ';
|
||||
|
||||
$oids = snmp_walk($device, '1.3.6.1.2.1.33.1.2.4', '-Osqn', 'UPS-MIB');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.2.1.33.1.2.4', '-Osqn', 'UPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
@@ -14,7 +14,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$current_id = $split_oid[(count($split_oid) - 1)];
|
||||
$current_oid = "1.3.6.1.2.1.33.1.2.4.$current_id";
|
||||
$current_oid = ".1.3.6.1.2.1.33.1.2.4.$current_id";
|
||||
$current = snmp_get($device, $current_oid, '-O vq');
|
||||
$descr = 'Battery charge remaining'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($current_id + 1));
|
||||
$type = 'rfc1628';
|
||||
|
||||
@@ -25,15 +25,15 @@ if ($device['os'] == 'apc') {
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
|
||||
$current_oid = '1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.'.$index;
|
||||
$current_oid = '.1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.'.$index;
|
||||
// rPDULoadStatusLoad
|
||||
$phase_oid = '1.3.6.1.4.1.318.1.1.12.2.3.1.1.4.'.$index;
|
||||
$phase_oid = '.1.3.6.1.4.1.318.1.1.12.2.3.1.1.4.'.$index;
|
||||
// rPDULoadStatusPhaseNumber
|
||||
$limit_oid = '1.3.6.1.4.1.318.1.1.12.2.2.1.1.4.'.$index;
|
||||
$limit_oid = '.1.3.6.1.4.1.318.1.1.12.2.2.1.1.4.'.$index;
|
||||
// rPDULoadPhaseConfigOverloadThreshold
|
||||
$lowlimit_oid = '1.3.6.1.4.1.318.1.1.12.2.2.1.1.2.'.$index;
|
||||
$lowlimit_oid = '.1.3.6.1.4.1.318.1.1.12.2.2.1.1.2.'.$index;
|
||||
// rPDULoadPhaseConfigLowLoadThreshold
|
||||
$warnlimit_oid = '1.3.6.1.4.1.318.1.1.12.2.2.1.1.3.'.$index;
|
||||
$warnlimit_oid = '.1.3.6.1.4.1.318.1.1.12.2.2.1.1.3.'.$index;
|
||||
// rPDULoadPhaseConfigNearOverloadThreshold
|
||||
$phase = snmp_get($device, $phase_oid, '-Oqv', '');
|
||||
$current = (snmp_get($device, $current_oid, '-Oqv', '') / $precision);
|
||||
@@ -99,15 +99,15 @@ if ($device['os'] == 'apc') {
|
||||
}
|
||||
}
|
||||
|
||||
$current_oid = '1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.'.$index;
|
||||
$current_oid = '.1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.'.$index;
|
||||
// rPDULoadStatusLoad
|
||||
$bank_oid = '1.3.6.1.4.1.318.1.1.12.2.3.1.1.5.'.$index;
|
||||
$bank_oid = '.1.3.6.1.4.1.318.1.1.12.2.3.1.1.5.'.$index;
|
||||
// rPDULoadStatusBankNumber
|
||||
$limit_oid = '1.3.6.1.4.1.318.1.1.12.2.4.1.1.4.'.$index;
|
||||
$limit_oid = '.1.3.6.1.4.1.318.1.1.12.2.4.1.1.4.'.$index;
|
||||
// rPDULoadBankConfigOverloadThreshold
|
||||
$lowlimit_oid = '1.3.6.1.4.1.318.1.1.12.2.4.1.1.2.'.$index;
|
||||
$lowlimit_oid = '.1.3.6.1.4.1.318.1.1.12.2.4.1.1.2.'.$index;
|
||||
// rPDULoadBankConfigLowLoadThreshold
|
||||
$warnlimit_oid = '1.3.6.1.4.1.318.1.1.12.2.4.1.1.3.'.$index;
|
||||
$warnlimit_oid = '.1.3.6.1.4.1.318.1.1.12.2.4.1.1.3.'.$index;
|
||||
// rPDULoadBankConfigNearOverloadThreshold
|
||||
$bank = snmp_get($device, $bank_oid, '-Oqv', '');
|
||||
$current = (snmp_get($device, $current_oid, '-Oqv', '') / $precision);
|
||||
@@ -127,7 +127,7 @@ if ($device['os'] == 'apc') {
|
||||
unset($oids);
|
||||
|
||||
// Per Outlet Power Bar
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.318.1.1.26.9.4.3.1.1', '-t 30 -OsqnU', 'PowerNet-MIB');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.318.1.1.26.9.4.3.1.1', '-t 30 -OsqnU', 'PowerNet-MIB');
|
||||
if ($oids) {
|
||||
echo 'APC PowerNet-MIB Outlets ';
|
||||
d_echo($oids."\n");
|
||||
@@ -144,17 +144,17 @@ if ($device['os'] == 'apc') {
|
||||
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
|
||||
$voltage_oid = '1.3.6.1.4.1.318.1.1.26.6.3.1.6';
|
||||
$voltage_oid = '.1.3.6.1.4.1.318.1.1.26.6.3.1.6';
|
||||
// rPDU2PhaseStatusVoltage
|
||||
$current_oid = '1.3.6.1.4.1.318.1.1.26.9.4.3.1.6.'.$index;
|
||||
$current_oid = '.1.3.6.1.4.1.318.1.1.26.9.4.3.1.6.'.$index;
|
||||
// rPDU2OutletMeteredStatusCurrent
|
||||
$limit_oid = '1.3.6.1.4.1.318.1.1.26.9.4.1.1.7.'.$index;
|
||||
$limit_oid = '.1.3.6.1.4.1.318.1.1.26.9.4.1.1.7.'.$index;
|
||||
// rPDU2OutletMeteredConfigOverloadCurrentThreshold
|
||||
$lowlimit_oid = '1.3.6.1.4.1.318.1.1.26.9.4.1.1.7.'.$index;
|
||||
$lowlimit_oid = '.1.3.6.1.4.1.318.1.1.26.9.4.1.1.7.'.$index;
|
||||
// rPDU2OutletMeteredConfigLowLoadCurrentThreshold
|
||||
$warnlimit_oid = '1.3.6.1.4.1.318.1.1.26.9.4.1.1.6.'.$index;
|
||||
$warnlimit_oid = '.1.3.6.1.4.1.318.1.1.26.9.4.1.1.6.'.$index;
|
||||
// rPDU2OutletMeteredConfigNearOverloadCurrentThreshold
|
||||
$name_oid = '1.3.6.1.4.1.318.1.1.26.9.4.3.1.3.'.$index;
|
||||
$name_oid = '.1.3.6.1.4.1.318.1.1.26.9.4.3.1.3.'.$index;
|
||||
// rPDU2OutletMeteredStatusName
|
||||
$voltage = snmp_get($device, $voltage_oid, '-Oqv', '');
|
||||
|
||||
@@ -182,13 +182,13 @@ if ($device['os'] == 'apc') {
|
||||
echo 'APC PowerNet-MIB ATS ';
|
||||
}
|
||||
|
||||
$current_oid = '1.3.6.1.4.1.318.1.1.8.5.4.3.1.4.1.1.1';
|
||||
$current_oid = '.1.3.6.1.4.1.318.1.1.8.5.4.3.1.4.1.1.1';
|
||||
// atsOutputCurrent
|
||||
$limit_oid = '1.3.6.1.4.1.318.1.1.8.4.16.1.5.1';
|
||||
$limit_oid = '.1.3.6.1.4.1.318.1.1.8.4.16.1.5.1';
|
||||
// atsConfigPhaseOverLoadThreshold
|
||||
$lowlimit_oid = '1.3.6.1.4.1.318.1.1.8.4.16.1.3.1';
|
||||
$lowlimit_oid = '.1.3.6.1.4.1.318.1.1.8.4.16.1.3.1';
|
||||
// atsConfigPhaseLowLoadThreshold
|
||||
$warnlimit_oid = '1.3.6.1.4.1.318.1.1.8.4.16.1.4.1';
|
||||
$warnlimit_oid = '.1.3.6.1.4.1.318.1.1.8.4.16.1.4.1';
|
||||
// atsConfigPhaseNearOverLoadThreshold
|
||||
$index = 1;
|
||||
|
||||
@@ -226,9 +226,9 @@ if ($device['os'] == 'apc') {
|
||||
$oids = snmp_get($device, $item['HighPrecOid'].'.'.$item['index'], '-OsqnU', $item['mib']);
|
||||
if (empty($oids)) {
|
||||
$oids = snmp_get($device, $item['AdvOid'].'.'.$item['index'], '-OsqnU', $item['mib']);
|
||||
$current_oid = $item['AdvOid'];
|
||||
$current_oid = '.1.3.6.1.4.1.318.1.1.1.4.2.4';
|
||||
} else {
|
||||
$current_oid = $item['HighPrecOid'];
|
||||
$current_oid = '.1.3.6.1.4.1.318.1.1.1.4.3.4';
|
||||
}
|
||||
|
||||
if (!empty($oids)) {
|
||||
|
||||
@@ -7,7 +7,7 @@ if ($device['os'] == 'eatonups') {
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsBatCurrent', array(), 'XUPS-MIB');
|
||||
|
||||
foreach ($oids as $current_id => $data) {
|
||||
$current_oid = "1.3.6.1.4.1.534.1.2.3.$current_id";
|
||||
$current_oid = ".1.3.6.1.4.1.534.1.2.3.$current_id";
|
||||
$divisor = 1;
|
||||
$current = $data['xupsBatCurrent'];
|
||||
$descr = 'Battery'.(count($oids) == 1 ? '' : ' '.($current_id + 1));
|
||||
@@ -20,7 +20,7 @@ if ($device['os'] == 'eatonups') {
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsOutputCurrent', array(), 'XUPS-MIB');
|
||||
|
||||
foreach ($oids as $current_id => $data) {
|
||||
$current_oid = "1.3.6.1.4.1.534.1.4.4.1.3.$current_id";
|
||||
$current_oid = ".1.3.6.1.4.1.534.1.4.4.1.3.$current_id";
|
||||
$descr = 'Output';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $current_id";
|
||||
@@ -36,7 +36,7 @@ if ($device['os'] == 'eatonups') {
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsInputCurrent', array(), 'XUPS-MIB');
|
||||
|
||||
foreach ($oids as $current_id => $data) {
|
||||
$current_oid = "1.3.6.1.4.1.534.1.3.4.1.3.$current_id";
|
||||
$current_oid = ".1.3.6.1.4.1.534.1.3.4.1.3.$current_id";
|
||||
$descr = 'Input';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $current_id";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if ($device['os'] == 'gamatronicups') {
|
||||
for ($i = 1; $i <= 3; $i++) {
|
||||
$current_oid = "GAMATRONIC-MIB::gamatronicLTD.5.4.1.1.3.$i";
|
||||
$current_oid = ".1.3.6.1.4.1.6050.5.4.1.1.3.$i";
|
||||
$descr = "Input Phase $i";
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
$type = 'gamatronicups';
|
||||
@@ -12,26 +12,11 @@ if ($device['os'] == 'gamatronicups') {
|
||||
$warnlimit = null;
|
||||
$limit = null;
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'current',
|
||||
$device,
|
||||
$current_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
'1',
|
||||
'1',
|
||||
$lowlimit,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$current
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, null, null, null, $current);
|
||||
}
|
||||
|
||||
for ($i = 1; $i <= 3; $i++) {
|
||||
$current_oid = "GAMATRONIC-MIB::gamatronicLTD.5.5.1.1.3.$i";
|
||||
$current_oid = ".1.3.6.1.4.1.6050.5.5.1.1.3.$i";
|
||||
$descr = "Output Phase $i";
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
$type = 'gamatronicups';
|
||||
@@ -41,21 +26,6 @@ if ($device['os'] == 'gamatronicups') {
|
||||
$warnlimit = null;
|
||||
$limit = null;
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'current',
|
||||
$device,
|
||||
$current_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
'1',
|
||||
'1',
|
||||
$lowlimit,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$current
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,24 +5,24 @@ if ($device['os'] == 'ipoman') {
|
||||
echo ' IPOMANII-MIB ';
|
||||
|
||||
if (!is_array($cache['ipoman'])) {
|
||||
echo 'outletConfigDesc ';
|
||||
d_echo('outletConfigDesc ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigDesc', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
echo 'outletConfigLocation ';
|
||||
d_echo('outletConfigLocation ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigLocation', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
echo 'inletConfigDesc ';
|
||||
d_echo('inletConfigDesc ');
|
||||
$cache['ipoman']['in'] = snmpwalk_cache_multi_oid($device, 'inletConfigDesc', $cache['ipoman'], 'IPOMANII-MIB');
|
||||
}
|
||||
|
||||
$oids_in = array();
|
||||
$oids_out = array();
|
||||
|
||||
echo 'inletConfigCurrentHigh ';
|
||||
d_echo('inletConfigCurrentHigh ');
|
||||
$oids_in = snmpwalk_cache_multi_oid($device, 'inletConfigCurrentHigh', $oids_in, 'IPOMANII-MIB');
|
||||
echo 'inletStatusCurrent ';
|
||||
d_echo('inletStatusCurrent ');
|
||||
$oids_in = snmpwalk_cache_multi_oid($device, 'inletStatusCurrent', $oids_in, 'IPOMANII-MIB');
|
||||
echo 'outletConfigCurrentHigh ';
|
||||
d_echo('outletConfigCurrentHigh ');
|
||||
$oids_out = snmpwalk_cache_multi_oid($device, 'outletConfigCurrentHigh', $oids_out, 'IPOMANII-MIB');
|
||||
echo 'outletStatusCurrent ';
|
||||
d_echo('outletStatusCurrent ');
|
||||
$oids_out = snmpwalk_cache_multi_oid($device, 'outletStatusCurrent', $oids_out, 'IPOMANII-MIB');
|
||||
|
||||
if (is_array($oids_in)) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// MGE UPS
|
||||
if ($device['os'] == 'mgeups') {
|
||||
echo 'MGE ';
|
||||
$oids = trim(snmp_walk($device, '1.3.6.1.4.1.705.1.7.2.1.5', '-OsqnU')); // OID: mgoutputCurrent
|
||||
$oids = trim(snmp_walk($device, '.1.3.6.1.4.1.705.1.7.2.1.5', '-OsqnU')); // OID: mgoutputCurrent
|
||||
d_echo($oids."\n");
|
||||
|
||||
$numPhase = count(explode("\n", $oids));
|
||||
@@ -33,7 +33,7 @@ if ($device['os'] == 'mgeups') {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current);
|
||||
}//end for
|
||||
|
||||
$oids = trim(snmp_walk($device, '1.3.6.1.4.1.705.1.6.2.1.6', '-OsqnU')); // OID: mginputCurrent
|
||||
$oids = trim(snmp_walk($device, '.1.3.6.1.4.1.705.1.6.2.1.6', '-OsqnU')); // OID: mginputCurrent
|
||||
d_echo($oids."\n");
|
||||
|
||||
$numPhase = count(explode("\n", $oids));
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if ($device['os'] == 'netvision') {
|
||||
for ($i = 1; $i <= 3; $i++) {
|
||||
$current_oid = "1.3.6.1.4.1.4555.1.1.1.1.3.3.1.3.$i";
|
||||
$current_oid = ".1.3.6.1.4.1.4555.1.1.1.1.3.3.1.3.$i";
|
||||
$descr = "Input Phase $i";
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
$type = 'netvision';
|
||||
@@ -12,26 +12,11 @@ if ($device['os'] == 'netvision') {
|
||||
$warnlimit = null;
|
||||
$limit = null;
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'current',
|
||||
$device,
|
||||
$current_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
'10',
|
||||
'1',
|
||||
$lowlimit,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$current
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, null, null, $current);
|
||||
}
|
||||
|
||||
for ($i = 1; $i <= 3; $i++) {
|
||||
$current_oid = "1.3.6.1.4.1.4555.1.1.1.1.4.4.1.3.$i";
|
||||
$current_oid = ".1.3.6.1.4.1.4555.1.1.1.1.4.4.1.3.$i";
|
||||
$descr = "Output Phase $i";
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
$type = 'netvision';
|
||||
@@ -41,21 +26,6 @@ if ($device['os'] == 'netvision') {
|
||||
$warnlimit = null;
|
||||
$limit = null;
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'current',
|
||||
$device,
|
||||
$current_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
'10',
|
||||
'1',
|
||||
$lowlimit,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$current
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ if ($device['os'] == 'pbn' || $device['os_group'] == 'pbn') {
|
||||
$divisor = 1000000;
|
||||
foreach ($pbn_oids as $index => $entry) {
|
||||
if (is_numeric($entry['curr']) && ($entry['curr'] !== '-65535')) {
|
||||
$oid = 'NMS-IF-MIB::curr.'.$index;
|
||||
$oid = '.1.3.6.1.4.1.11606.10.9.63.1.7.1.6.'.$index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Current';
|
||||
$limit_low = 8000/$divisor;
|
||||
$warn_limit_low = 8500/$divisor;
|
||||
|
||||
@@ -6,7 +6,7 @@ $divisor = get_device_divisor($device, $_tmp_serial, 'current');
|
||||
if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modules_compat']['rfc1628'][$device['os']]) {
|
||||
echo 'RFC1628 ';
|
||||
|
||||
$oids = snmp_walk($device, '1.3.6.1.2.1.33.1.2.6', '-Osqn', 'UPS-MIB');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.2.1.33.1.2.6', '-Osqn', 'UPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
@@ -16,7 +16,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$current_id = $split_oid[(count($split_oid) - 1)];
|
||||
$current_oid = "1.3.6.1.2.1.33.1.2.6.$current_id";
|
||||
$current_oid = ".1.3.6.1.2.1.33.1.2.6.$current_id";
|
||||
$precision = 10;
|
||||
$current = (snmp_get($device, $current_oid, '-O vq') / $precision);
|
||||
$descr = 'Battery'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($current_id + 1));
|
||||
@@ -27,7 +27,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
}
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, '1.3.6.1.2.1.33.1.4.3.0', '-OsqnU'));
|
||||
$oids = trim(snmp_walk($device, '.1.3.6.1.2.1.33.1.4.3.0', '-OsqnU'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
@@ -46,12 +46,12 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, '1.3.6.1.2.1.33.1.3.2.0', '-OsqnU'));
|
||||
$oids = trim(snmp_walk($device, '.1.3.6.1.2.1.33.1.3.2.0', '-OsqnU'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$current_oid = "1.3.6.1.2.1.33.1.3.3.1.4.$i";
|
||||
$current_oid = ".1.3.6.1.2.1.33.1.3.3.1.4.$i";
|
||||
$descr = 'Input';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
@@ -65,12 +65,12 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, '1.3.6.1.2.1.33.1.5.2.0', '-OsqnU'));
|
||||
$oids = trim(snmp_walk($device, '.1.3.6.1.2.1.33.1.5.2.0', '-OsqnU'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$current_oid = "1.3.6.1.2.1.33.1.5.3.1.3.$i";
|
||||
$current_oid = ".1.3.6.1.2.1.33.1.5.3.1.3.$i";
|
||||
$descr = 'Bypass';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
|
||||
@@ -28,7 +28,7 @@ if ($device['os'] == 'sentry3') {
|
||||
$infeed_index = $split_oid[(count($split_oid) - 1)];
|
||||
|
||||
// infeedLoadValue
|
||||
$infeed_oid = '1.3.6.1.4.1.1718.3.2.2.1.7.'.$towers.'.1';
|
||||
$infeed_oid = '.1.3.6.1.4.1.1718.3.2.2.1.7.'.$towers.'.1';
|
||||
|
||||
$descr_string = snmp_get($device, "infeedID.$towers.$infeed_index", '-Ovq', 'Sentry3-MIB');
|
||||
$descr = "Infeed $descr_string";
|
||||
@@ -63,7 +63,7 @@ if ($device['os'] == 'sentry3') {
|
||||
$outlet_insert_index = $towers.$outlet_index;
|
||||
|
||||
// outletLoadValue: "A non-negative value indicates the measured load in hundredths of Amps"
|
||||
$outlet_oid = "1.3.6.1.4.1.1718.3.2.3.1.7.$outletsuffix";
|
||||
$outlet_oid = ".1.3.6.1.4.1.1718.3.2.3.1.7.$outletsuffix";
|
||||
$outlet_descr_string = snmp_get($device, "outletID.$outletsuffix", '-Ovq', 'Sentry3-MIB');
|
||||
$outlet_descr = "Outlet $outlet_descr_string";
|
||||
$outlet_low_warn_limit = null;
|
||||
|
||||
@@ -14,7 +14,7 @@ if ($device['os'] == 'powerware') {
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$current_id = $split_oid[(count($split_oid) - 1)];
|
||||
$current_oid = "1.3.6.1.4.1.534.1.2.3.$current_id";
|
||||
$current_oid = ".1.3.6.1.4.1.534.1.2.3.$current_id";
|
||||
$divisor = 1;
|
||||
$current = snmp_get($device, $current_oid, '-O vq');
|
||||
$descr = 'Battery'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($current_id + 1));
|
||||
@@ -30,7 +30,7 @@ if ($device['os'] == 'powerware') {
|
||||
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$current_oid = "1.3.6.1.4.1.534.1.4.4.1.3.$i";
|
||||
$current_oid = ".1.3.6.1.4.1.534.1.4.4.1.3.$i";
|
||||
$descr = 'Output';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
@@ -49,7 +49,7 @@ if ($device['os'] == 'powerware') {
|
||||
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$current_oid = "1.3.6.1.4.1.534.1.3.4.1.3.$i";
|
||||
$current_oid = ".1.3.6.1.4.1.534.1.3.4.1.3.$i";
|
||||
$descr = 'Input';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
|
||||
@@ -16,7 +16,7 @@ if ($device['os'] == 'pbn' || $device['os_group'] == 'pbn') {
|
||||
$divisor = 1;
|
||||
foreach ($pbn_oids as $index => $entry) {
|
||||
if (is_numeric($entry['rxPower']) && ($entry['rxPower'] !== '-65535')) {
|
||||
$oid = 'NMS-IF-MIB::rxPower.'.$index;
|
||||
$oid = '.1.3.6.1.4.1.11606.10.9.63.1.7.1.3.'.$index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Rx Power';
|
||||
$limit_low = -30/$divisor;
|
||||
$warn_limit_low = -25/$divisor;
|
||||
@@ -29,7 +29,7 @@ if ($device['os'] == 'pbn' || $device['os_group'] == 'pbn') {
|
||||
}
|
||||
|
||||
if (is_numeric($entry['txPower']) && ($entry['txPower'] !== '-65535')) {
|
||||
$oid = 'NMS-IF-MIB::txPower.'.$index;
|
||||
$oid = '.1.3.6.1.4.1.11606.10.9.63.1.7.1.2.'.$index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Tx Power';
|
||||
$limit_low = -30/$divisor;
|
||||
$warn_limit_low = -25/$divisor;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
// Areca Fanspeeds
|
||||
if ($device['os'] == 'areca') {
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.18928.1.2.2.1.9.1.2', '-OsqnU', '');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.18928.1.2.2.1.9.1.2', '-OsqnU', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids) {
|
||||
@@ -15,7 +15,7 @@ if ($device['os'] == 'areca') {
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
$oid = '1.3.6.1.4.1.18928.1.2.2.1.9.1.3.'.$index;
|
||||
$oid = '.1.3.6.1.4.1.18928.1.2.2.1.9.1.3.'.$index;
|
||||
$current = snmp_get($device, $oid, '-Oqv', '');
|
||||
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'areca', trim($descr, '"'), '1', '1', null, null, null, null, $current);
|
||||
|
||||
@@ -4,7 +4,7 @@ if ($device['os'] == 'xos') {
|
||||
echo(" EXTREME-BASE-MIB ");
|
||||
|
||||
// Fan Speed
|
||||
$oid = "1.3.6.1.4.1.1916.1.1.1.9.1.4";
|
||||
$oid = ".1.3.6.1.4.1.1916.1.1.1.9.1.4";
|
||||
$oids = snmpwalk_cache_multi_oid($device, $oid, array(), "EXTREME-BASE-MIB");
|
||||
|
||||
foreach ($oids as $index => $entry) {
|
||||
@@ -13,7 +13,7 @@ if ($device['os'] == 'xos') {
|
||||
$index = $matches[1];
|
||||
// substract 100 from index to start from 1 instead of 101
|
||||
$modindex = ($index - 100);
|
||||
$oid = "1.3.6.1.4.1.1916.1.1.1.9.1.4.$index";
|
||||
$oid = ".1.3.6.1.4.1.1916.1.1.1.9.1.4.$index";
|
||||
$value = snmp_get($device, $oid, '-Oqv', 'EXTREME-BASE-MIB');
|
||||
$descr = "Fan Speed $modindex";
|
||||
// round function used to round limit values to hundreds to avoid h/w/l limits being changed on every discovery as a change of 1rpm for fan speed would cause the limit values to change since they're dynamically calculated
|
||||
|
||||
@@ -16,7 +16,7 @@ if ($device['os'] == 'linux' || $device['os'] == 'pktj' || $device['os'] == 'cu
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
$oid = '1.3.6.1.4.1.2021.13.16.3.1.3.'.$index;
|
||||
$oid = '.1.3.6.1.4.1.2021.13.16.3.1.3.'.$index;
|
||||
$current = snmp_get($device, $oid, '-Oqv', 'LM-SENSORS-MIB');
|
||||
$descr = trim(str_ireplace('fan-', '', $descr));
|
||||
if ($current !== false && $current >= 0) {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
|
||||
if ($device['os'] == "nos") {
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.1588.2.1.1.1.1.22.1.2', '-Osqn');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.2', '-Osqn');
|
||||
$oids = trim($oids);
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
// Supermicro Fanspeeds
|
||||
if ($device['os'] == 'linux') {
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.10876.2.1.1.1.1.3', '-OsqnU', 'SUPERMICRO-HEALTH-MIB');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.10876.2.1.1.1.1.3', '-OsqnU', 'SUPERMICRO-HEALTH-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
@@ -17,11 +17,11 @@ if ($device['os'] == 'linux') {
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
if ($kind == 0) {
|
||||
$fan_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.4.$index";
|
||||
$descr_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.2.$index";
|
||||
$limit_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.6.$index";
|
||||
$divisor_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.9.$index";
|
||||
$monitor_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.10.$index";
|
||||
$fan_oid = ".1.3.6.1.4.1.10876.2.1.1.1.1.4.$index";
|
||||
$descr_oid = ".1.3.6.1.4.1.10876.2.1.1.1.1.2.$index";
|
||||
$limit_oid = ".1.3.6.1.4.1.10876.2.1.1.1.1.6.$index";
|
||||
$divisor_oid = ".1.3.6.1.4.1.10876.2.1.1.1.1.9.$index";
|
||||
$monitor_oid = ".1.3.6.1.4.1.10876.2.1.1.1.1.10.$index";
|
||||
$descr = snmp_get($device, $descr_oid, '-Oqv', 'SUPERMICRO-HEALTH-MIB');
|
||||
$current = snmp_get($device, $fan_oid, '-Oqv', 'SUPERMICRO-HEALTH-MIB');
|
||||
$low_limit = snmp_get($device, $limit_oid, '-Oqv', 'SUPERMICRO-HEALTH-MIB');
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
// APC
|
||||
if ($device['os'] == 'apc') {
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.318.1.1.8.5.3.2.1.4', '-OsqnU', '');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.318.1.1.8.5.3.2.1.4', '-OsqnU', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids) {
|
||||
@@ -17,13 +17,13 @@ if ($device['os'] == 'apc') {
|
||||
list($oid,$current) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
$oid = '1.3.6.1.4.1.318.1.1.8.5.3.2.1.4.'.$index;
|
||||
$oid = '.1.3.6.1.4.1.318.1.1.8.5.3.2.1.4.'.$index;
|
||||
$descr = 'Input Feed '.chr(64 + $index);
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $oid, "3.2.1.4.$index", $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.318.1.1.8.5.4.2.1.4', '-OsqnU', '');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.318.1.1.8.5.4.2.1.4', '-OsqnU', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids) {
|
||||
@@ -38,7 +38,7 @@ if ($device['os'] == 'apc') {
|
||||
list($oid,$current) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 3)];
|
||||
$oid = '1.3.6.1.4.1.318.1.1.8.5.4.2.1.4.'.$index;
|
||||
$oid = '.1.3.6.1.4.1.318.1.1.8.5.4.2.1.4.'.$index;
|
||||
$descr = 'Output Feed';
|
||||
if (count(explode("\n", $oids)) > 1) {
|
||||
$descr .= " $index";
|
||||
@@ -48,7 +48,7 @@ if ($device['os'] == 'apc') {
|
||||
}
|
||||
}
|
||||
|
||||
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.1.3.2.4.0', '-OsqnU', '');
|
||||
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.1.3.2.4.0', '-OsqnU', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids) {
|
||||
@@ -61,7 +61,7 @@ if ($device['os'] == 'apc') {
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.1.4.2.2.0', '-OsqnU', '');
|
||||
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.1.4.2.2.0', '-OsqnU', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids) {
|
||||
|
||||
@@ -26,7 +26,7 @@ if ($device['os'] == 'eatonups') {
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsOutputFrequency', array(), 'XUPS-MIB');
|
||||
|
||||
foreach ($oids as $freq_id => $data) {
|
||||
$freq_oid = "1.3.6.1.4.1.534.1.4.2.$freq_id";
|
||||
$freq_oid = ".1.3.6.1.4.1.534.1.4.2.$freq_id";
|
||||
$descr = 'Output';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $freq_id";
|
||||
@@ -43,7 +43,7 @@ if ($device['os'] == 'eatonups') {
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsBypassFrequency', array(), 'XUPS-MIB');
|
||||
|
||||
foreach ($oids as $freq_id => $data) {
|
||||
$freq_oid = "1.3.6.1.4.1.534.1.5.1.$freq_id";
|
||||
$freq_oid = ".1.3.6.1.4.1.534.1.5.1.$freq_id";
|
||||
$descr = 'Bypass';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $freq_id";
|
||||
|
||||
@@ -5,21 +5,21 @@ if ($device['os'] == 'ipoman') {
|
||||
echo ' IPOMANII-MIB ';
|
||||
|
||||
if (!is_array($cache['ipoman'])) {
|
||||
echo 'outletConfigDesc ';
|
||||
d_echo('outletConfigDesc ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigDesc', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
echo 'outletConfigLocation ';
|
||||
d_echo('outletConfigLocation ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigLocation', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
echo 'inletConfigDesc ';
|
||||
d_echo('inletConfigDesc ');
|
||||
$cache['ipoman']['in'] = snmpwalk_cache_multi_oid($device, 'inletConfigDesc', $cache['ipoman']['in'], 'IPOMANII-MIB');
|
||||
}
|
||||
|
||||
$oids = array();
|
||||
|
||||
echo 'inletConfigFrequencyHigh ';
|
||||
d_echo('inletConfigFrequencyHigh ');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'inletConfigFrequencyHigh', $oids, 'IPOMANII-MIB');
|
||||
echo 'inletConfigFrequencyLow ';
|
||||
d_echo('inletConfigFrequencyLow ');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'inletConfigFrequencyLow', $oids, 'IPOMANII-MIB');
|
||||
echo 'inletStatusFrequency ';
|
||||
d_echo('inletStatusFrequency ');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'inletStatusFrequency', $oids, 'IPOMANII-MIB');
|
||||
|
||||
if (is_array($oids)) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// MGE UPS Frequencies
|
||||
if ($device['os'] == 'mgeups') {
|
||||
echo 'MGE ';
|
||||
$oids = trim(snmp_walk($device, '1.3.6.1.4.1.705.1.7.1', '-OsqnU'));
|
||||
$oids = trim(snmp_walk($device, '.1.3.6.1.4.1.705.1.7.1', '-OsqnU'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
$numPhase = count(explode("\n", $oids));
|
||||
@@ -27,7 +27,7 @@ if ($device['os'] == 'mgeups') {
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, '1.3.6.1.4.1.705.1.6.1', '-OsqnU'));
|
||||
$oids = trim(snmp_walk($device, '.1.3.6.1.4.1.705.1.6.1', '-OsqnU'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
$numPhase = count(explode("\n", $oids));
|
||||
|
||||
@@ -1,49 +1,19 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'netvision') {
|
||||
$freq_oid = '1.3.6.1.4.1.4555.1.1.1.1.3.2.0';
|
||||
$freq_oid = '.1.3.6.1.4.1.4555.1.1.1.1.3.2.0';
|
||||
$descr = 'Input';
|
||||
$current = (snmp_get($device, $freq_oid, '-Oqv') / 10);
|
||||
$type = 'netvision';
|
||||
$divisor = 10;
|
||||
$index = '3.2.0';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'frequency',
|
||||
$device,
|
||||
$freq_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$current
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
|
||||
$freq_oid = '1.3.6.1.4.1.4555.1.1.1.1.4.2.0';
|
||||
$freq_oid = '.1.3.6.1.4.1.4555.1.1.1.1.4.2.0';
|
||||
$descr = 'Output';
|
||||
$current = (snmp_get($device, $freq_oid, '-Oqv') / 10);
|
||||
$type = 'netvision';
|
||||
$divisor = 10;
|
||||
$index = '4.2.0';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'frequency',
|
||||
$device,
|
||||
$freq_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$current
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modules_compat']['rfc1628'][$device['os']]) {
|
||||
echo 'RFC1628 ';
|
||||
|
||||
$oids = trim(snmp_walk($device, '1.3.6.1.2.1.33.1.3.2.0', '-OsqnU'));
|
||||
$oids = trim(snmp_walk($device, '.1.3.6.1.2.1.33.1.3.2.0', '-OsqnU'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$freq_oid = "1.3.6.1.2.1.33.1.3.3.1.2.$i";
|
||||
$freq_oid = ".1.3.6.1.2.1.33.1.3.3.1.2.$i";
|
||||
$descr = 'Input';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
@@ -23,7 +23,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$freq_oid = '1.3.6.1.2.1.33.1.4.2.0';
|
||||
$freq_oid = '.1.3.6.1.2.1.33.1.4.2.0';
|
||||
$descr = 'Output';
|
||||
$current = (snmp_get($device, $freq_oid, '-Oqv') / 10);
|
||||
$type = 'rfc1628';
|
||||
@@ -32,7 +32,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
$index = '4.2.0';
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
|
||||
$freq_oid = '1.3.6.1.2.1.33.1.5.1.0';
|
||||
$freq_oid = '.1.3.6.1.2.1.33.1.5.1.0';
|
||||
$descr = 'Bypass';
|
||||
$current = (snmp_get($device, $freq_oid, '-Oqv') / 10);
|
||||
$type = 'rfc1628';
|
||||
|
||||
@@ -15,7 +15,7 @@ if ($device['os'] == 'powerware') {
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
|
||||
// XUPS-MIB::xupsOutputFrequency.0 = INTEGER: 500
|
||||
$freq_oid = '1.3.6.1.4.1.534.1.4.2.0';
|
||||
$freq_oid = '.1.3.6.1.4.1.534.1.4.2.0';
|
||||
$descr = 'Output';
|
||||
$divisor = 10;
|
||||
$current = (snmp_get($device, $freq_oid, '-Oqv') / $divisor);
|
||||
@@ -24,7 +24,7 @@ if ($device['os'] == 'powerware') {
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
|
||||
// XUPS-MIB::xupsBypassFrequency.0 = INTEGER: 500
|
||||
$freq_oid = '1.3.6.1.4.1.534.1.5.1.0';
|
||||
$freq_oid = '.1.3.6.1.4.1.534.1.5.1.0';
|
||||
$descr = 'Bypass';
|
||||
$divisor = 10;
|
||||
$current = snmp_get($device, $freq_oid, '-Oqv');
|
||||
|
||||
@@ -31,22 +31,7 @@ if ($device['os'] == 'akcp' || $device['os'] == 'minkelsrms') {
|
||||
$lowlimit = snmp_get($device, $lowlimit_oid, '-Oqv', '');
|
||||
$warnlowlimit = snmp_get($device, $warnlowlimit_oid, '-Oqv', '');
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'humidity',
|
||||
$device,
|
||||
$oid,
|
||||
$index,
|
||||
'akcp',
|
||||
$descr,
|
||||
'1',
|
||||
'1',
|
||||
$lowlimit,
|
||||
$warnlowlimit,
|
||||
$limit,
|
||||
$warnlimit,
|
||||
$humidity
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $oid, $index, 'akcp', $descr, '1', '1', $lowlimit, $warnlowlimit, $limit, $warnlimit, $humidity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,22 +17,7 @@ if ($device['os'] == 'netbotz') {
|
||||
$descr = str_replace('"', '', $descr);
|
||||
$descr = trim($descr);
|
||||
if ($humidity >= 0) {
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'humidity',
|
||||
$device,
|
||||
$humidity_oid,
|
||||
$humidity_id,
|
||||
'netbotz',
|
||||
$descr,
|
||||
'1',
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$humidity
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $humidity_oid, $humidity_id, 'netbotz', $descr, '1', '1', null, null, null, null, $humidity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ if ($device['os'] == 'sentry3') {
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
|
||||
// tempHumidSensorHumidValue
|
||||
$humidity_oid = '1.3.6.1.4.1.1718.3.2.5.1.10.1.'.$index;
|
||||
$humidity_oid = '.1.3.6.1.4.1.1718.3.2.5.1.10.1.'.$index;
|
||||
$descr = 'Removable Sensor '.$index;
|
||||
$low_warn_limit = '0';
|
||||
$low_limit = snmp_get($device, "tempHumidSensorHumidLowThresh.1.$index", '-Ovq', 'Sentry3-MIB');
|
||||
@@ -28,22 +28,7 @@ if ($device['os'] == 'sentry3') {
|
||||
$current = snmp_get($device, "$humidity_oid", '-Ovq', 'Sentry3-MIB');
|
||||
|
||||
if ($current >= 0) {
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'humidity',
|
||||
$device,
|
||||
$humidity_oid,
|
||||
$index,
|
||||
'sentry3',
|
||||
$descr,
|
||||
$divisor,
|
||||
$multiplier,
|
||||
$low_limit,
|
||||
$low_warn_limit,
|
||||
$high_warn_limit,
|
||||
$high_limit,
|
||||
$current
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $humidity_oid, $index, 'sentry3', $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ if ($device['os'] == 'apc') {
|
||||
$oids = snmp_get($device, $item['HighPrecOid'].'.'.$item['index'], '-OsqnU', $item['mib']);
|
||||
if (empty($oids)) {
|
||||
$oids = snmp_get($device, $item['AdvOid'].'.'.$item['index'], '-OsqnU', $item['mib']);
|
||||
$current_oid = $item['AdvOid'];
|
||||
$current_oid = '.1.3.6.1.4.1.318.1.1.1.4.3.3';
|
||||
} else {
|
||||
$current_oid = $item['HighPrecOid'];
|
||||
$current_oid = '.1.3.6.1.4.1.318.1.1.1.4.3.3';
|
||||
}
|
||||
|
||||
if (!empty($oids)) {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modules_compat']['rfc1628'][$device['os']]) {
|
||||
echo 'RFC1628 ';
|
||||
|
||||
$oids = snmp_walk($device, '1.3.6.1.2.1.33.1.4.4.1.5', '-Osqn', 'UPS-MIB');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.2.1.33.1.4.4.1.5', '-Osqn', 'UPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
@@ -14,7 +14,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$current_id = $split_oid[(count($split_oid) - 1)];
|
||||
$current_oid = "1.3.6.1.2.1.33.1.4.4.1.5.$current_id";
|
||||
$current_oid = ".1.3.6.1.2.1.33.1.4.4.1.5.$current_id";
|
||||
$current = snmp_get($device, $current_oid, '-O vq');
|
||||
$descr = 'Percentage load'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($current_id + 1));
|
||||
$type = 'rfc1628';
|
||||
|
||||
@@ -5,7 +5,7 @@ if ($device['os'] == 'xos') {
|
||||
echo(" EXTREME-BASE-MIB ");
|
||||
// Power Usage
|
||||
$descr = "Power Usage";
|
||||
$oid = "1.3.6.1.4.1.1916.1.1.1.40.1.0"; // extremeSystemPowerUsage
|
||||
$oid = ".1.3.6.1.4.1.1916.1.1.1.40.1.0"; // extremeSystemPowerUsage
|
||||
$value = snmp_get($device, $oid, '-Oqv', 'EXTREME-BASE-MIB');
|
||||
$divisor = "1000";
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ if ($device['os'] == 'ipoman') {
|
||||
|
||||
// Inlet Disabled due to the fact thats it's Kwh instead of just Watt
|
||||
if (!is_array($cache['ipoman'])) {
|
||||
echo 'outletConfigDesc ';
|
||||
d_echo('outletConfigDesc ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigDesc', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
echo 'outletConfigLocation ';
|
||||
d_echo('outletConfigLocation ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigLocation', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
// echo("inletConfigDesc ");
|
||||
// $cache['ipoman']['in'] = snmpwalk_cache_multi_oid($device, "inletConfigDesc", $cache['ipoman'], "IPOMANII-MIB");
|
||||
@@ -19,7 +19,7 @@ if ($device['os'] == 'ipoman') {
|
||||
|
||||
// echo("inletStatusWH ");
|
||||
// $oids_in = snmpwalk_cache_multi_oid($device, "inletStatusWH", $oids_in, "IPOMANII-MIB");
|
||||
echo 'outletStatusWH ';
|
||||
d_echo('outletStatusWH ');
|
||||
$oids_out = snmpwalk_cache_multi_oid($device, 'outletStatusWH', $oids_out, 'IPOMANII-MIB');
|
||||
|
||||
// if (is_array($oids_in))
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modules_compat']['rfc1628'][$device['os']]) {
|
||||
echo("RFC1628 ");
|
||||
|
||||
$oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.4.3.0", "-OsqnU"));
|
||||
$oids = trim(snmp_walk($device, ".1.3.6.1.2.1.33.1.4.3.0", "-OsqnU"));
|
||||
d_echo($oids."\n");
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
@@ -21,11 +21,11 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
discover_sensor($valid['sensor'], 'power', $device, $current_oid, $index, $type, $descr, '1', '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.3.2.0", "-OsqnU"));
|
||||
$oids = trim(snmp_walk($device, ".1.3.6.1.2.1.33.1.3.2.0", "-OsqnU"));
|
||||
d_echo($oids."\n");
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$current_oid = "1.3.6.1.2.1.33.1.3.3.1.5.$i";
|
||||
$current_oid = ".1.3.6.1.2.1.33.1.3.3.1.5.$i";
|
||||
$descr = "Input";
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
@@ -38,7 +38,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
discover_sensor($valid['sensor'], 'power', $device, $current_oid, $index, $type, $descr, '1', '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, "1.3.6.1.2.1.33.1.5.2.0", "-OsqnU"));
|
||||
$oids = trim(snmp_walk($device, ".1.3.6.1.2.1.33.1.5.2.0", "-OsqnU"));
|
||||
d_echo($oids."\n");
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
|
||||
@@ -15,5 +15,5 @@ if ($device['os'] == 'pbn') {
|
||||
$pbn_oids = array();
|
||||
echo 'Caching OIDs:';
|
||||
|
||||
$pbn_oids = snmpwalk_cache_multi_oid($device, 'ifSfpParameterTable', array(), 'NMS-IF-MIB', 'pbn');
|
||||
$pbn_oids = snmpwalk_cache_multi_oid($device, '.1.3.6.1.4.1.11606.10.9.63.1.7', array(), 'NMS-IF-MIB', 'pbn');
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<?php
|
||||
// APC
|
||||
if ($device['os'] == 'apc') {
|
||||
// $oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.1.2.2.3.0', '-OsqnUt', '');
|
||||
$oids = snmp_get($device, 'PowerNet-MIB::upsAdvBatteryRunTimeRemaining.0', '-OsqnUt', '');
|
||||
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.1.2.2.3.0', '-OsqnUt', '');
|
||||
d_echo($oids."\n");
|
||||
if ($oids) {
|
||||
echo ' APC Runtime ';
|
||||
|
||||
@@ -6,10 +6,10 @@ if ($device['os'] == 'cambium') {
|
||||
$divisor = 1;
|
||||
if (strstr($cambium_type, 'Cambium PTP 50650')) {
|
||||
$mib = 'CAMBIUM-PTP650-MIB';
|
||||
$oid = 'receivePower.0';
|
||||
$oid = '.1.3.6.1.4.1.17713.7.12.2.0';
|
||||
$divisor = 10;
|
||||
} elseif (strstr($cambium_type, 'PTP250')) {
|
||||
$oid = 'receivePower.0';
|
||||
$oid = '.1.3.6.1.4.1.17713.250.5.1.0';
|
||||
$mib = 'CAMBIUM-PTP250-MIB';
|
||||
$divisor = 10;
|
||||
} elseif (strstr($is_epmp, '.17713.21')) {
|
||||
@@ -17,15 +17,15 @@ if ($device['os'] == 'cambium') {
|
||||
$epmp_number = snmp_get($device, 'cambiumSubModeType.0', '-Oqv', 'CAMBIUM-PMP80211-MIB');
|
||||
if ($epmp_ap == 1) {
|
||||
if ($epmp_number != 1) {
|
||||
$oid = 'cambiumSTADLRSSI.0';
|
||||
$oid = '.1.3.6.1.4.1.17713.21.1.2.3.0';
|
||||
$mib = 'CAMBIUM-PMP80211-MIB';
|
||||
}
|
||||
} else {
|
||||
$oid = 'cambiumSTADLRSSI.0';
|
||||
$oid = '.1.3.6.1.4.1.17713.21.1.2.3.0';
|
||||
$mib = 'CAMBIUM-PMP80211-MIB';
|
||||
}
|
||||
} else {
|
||||
$oid = '1.3.6.1.4.1.161.19.3.2.2.21.0';
|
||||
$oid = '.1.3.6.1.4.1.161.19.3.2.2.21.0';
|
||||
$mib = 'WHISP-BOX-MIBV2-MIB';
|
||||
}
|
||||
|
||||
|
||||
@@ -6,23 +6,23 @@ if ($device['os'] == 'canopy') {
|
||||
if (strstr($cambium_type, 'BHUL450')) {
|
||||
$masterSlaveMode = snmp_get($device, 'bhTimingMode.0', '-Oqv', 'WHISP-BOX-MIBV2-MIB');
|
||||
if ($masterSlaveMode == "timingMaster") {
|
||||
$oid = 'lastPowerLevel.2';
|
||||
$oid = '.1.3.6.1.4.1.17713.21.1.2.3.2';
|
||||
$mib = 'WHISP-APS-MIB';
|
||||
} else {
|
||||
$oid = 'radioDbmInt.0';
|
||||
$oid = '.1.3.6.1.4.1.161.19.3.2.2.21.0';
|
||||
$mib = 'WHISP-SM-MIB';
|
||||
}
|
||||
} elseif (strstr($cambium_type, 'BHUL') || strstr($cambium_type, 'BH')) {
|
||||
$masterSlaveMode = snmp_get($device, 'bhTimingMode.0', '-Oqv', 'WHISP-BOX-MIBV2-MIB');
|
||||
if ($masterSlaveMode == "timingMaster") {
|
||||
$oid = 'lastPowerLevel.2';
|
||||
$oid = '.1.3.6.1.4.1.17713.21.1.2.3.2';
|
||||
$mib = 'WHISP-APS-MIB';
|
||||
} else {
|
||||
$oid = '1.3.6.1.4.1.161.19.3.2.2.21.0';
|
||||
$oid = '.1.3.6.1.4.1.161.19.3.2.2.21.0';
|
||||
$mib = 'WHISP-BOX-MIBV2-MIB';
|
||||
}
|
||||
} else {
|
||||
$oid = '1.3.6.1.4.1.161.19.3.2.2.21.0';
|
||||
$oid = '.1.3.6.1.4.1.161.19.3.2.2.21.0';
|
||||
$mib = 'WHISP-BOX-MIBV2-MIB';
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
|
||||
@@ -154,24 +154,7 @@ if ($device['os'] == 'ibm-amm') {
|
||||
}//end foreach
|
||||
}//end if
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'state',
|
||||
$device,
|
||||
$oid,
|
||||
$index,
|
||||
$state_name,
|
||||
$descr,
|
||||
'1',
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$state,
|
||||
'snmp',
|
||||
$index
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $descr, '1', '1', null, null, null, null, $state, 'snmp', $index);
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
$index++;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modules_compat']['rfc1628'][$device['os']]) {
|
||||
echo 'RFC1628 ';
|
||||
|
||||
$oids = snmp_walk($device, '1.3.6.1.2.1.33.1.2.2', '-Osqn', 'UPS-MIB');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.2.1.33.1.2.2', '-Osqn', 'UPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
@@ -14,7 +14,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$current_id = $split_oid[(count($split_oid) - 1)];
|
||||
$current_oid = "1.3.6.1.2.1.33.1.2.2.$current_id";
|
||||
$current_oid = ".1.3.6.1.2.1.33.1.2.2.$current_id";
|
||||
$current = snmp_get($device, $current_oid, '-O vq');
|
||||
$descr = 'Seconds on Battery'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($current_id + 1));
|
||||
$type = 'rfc1628';
|
||||
@@ -24,7 +24,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
}
|
||||
}
|
||||
|
||||
$oids = snmp_walk($device, '1.3.6.1.2.1.33.1.2.3', '-Osqn', 'UPS-MIB');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.2.1.33.1.2.3', '-Osqn', 'UPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
@@ -34,7 +34,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$current_id = $split_oid[(count($split_oid) - 1)];
|
||||
$current_oid = "1.3.6.1.2.1.33.1.2.3.$current_id";
|
||||
$current_oid = ".1.3.6.1.2.1.33.1.2.3.$current_id";
|
||||
$current = snmp_get($device, $current_oid, '-O vq');
|
||||
$descr = 'Battery: Estimated minutes remaining'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($current_id + 1));
|
||||
$type = 'rfc1628';
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
if ($device['os'] == 'riverbed') {
|
||||
$tables = array(
|
||||
array('systemHealth.0','1.3.6.1.4.1.17163.1.1.2.7.0','systemHealth','System Health') ,
|
||||
array('optServiceStatus.0','1.3.6.1.4.1.17163.1.1.2.8.0','optServiceStatus','Optimization Service Status')
|
||||
array('systemHealth.0','.1.3.6.1.4.1.17163.1.1.2.7.0','systemHealth','System Health') ,
|
||||
array('optServiceStatus.0','.1.3.6.1.4.1.17163.1.1.2.8.0','optServiceStatus','Optimization Service Status')
|
||||
);
|
||||
|
||||
foreach ($tables as $tablevalue) {
|
||||
|
||||
@@ -7,8 +7,8 @@ if ($device['os'] == 'serveriron') {
|
||||
|
||||
// Power Supplies
|
||||
for ($i=1; $i != 3; $i++) {
|
||||
$power_oid = 'FOUNDRY-SN-AGENT-MIB::snChasPwrSupplyOperStatus.'.$i;
|
||||
$power_status = snmp_get($device, $power_oid, '-Oqv', 'FOUNDRY-SN-AGENT-MIB');
|
||||
$power_oid = '.1.3.6.1.4.1.1991.1.1.1.2.1.1.3.'.$i;
|
||||
$power_status = snmp_get($device, $power_oid, '-Oqv');
|
||||
if (!empty($power_status)) {
|
||||
discover_sensor($valid['sensor'], 'state', $device, $power_oid, 'powerstatus'.$i, 'snmp', 'Power Supply '.$i.' Status', '1', '1', '1', null, null, '3', $power_status);
|
||||
}
|
||||
@@ -16,8 +16,8 @@ if ($device['os'] == 'serveriron') {
|
||||
|
||||
// Fan status
|
||||
for ($i=1; $i != 7; $i++) {
|
||||
$fan_oid = 'FOUNDRY-SN-AGENT-MIB::snChasFanOperStatus.'.$i;
|
||||
$fan_status = snmp_get($device, $fan_oid, '-Oqv', 'FOUNDRY-SN-AGENT-MIB');
|
||||
$fan_oid = '.1.3.6.1.4.1.1991.1.1.1.3.1.1.3.'.$i;
|
||||
$fan_status = snmp_get($device, $fan_oid, '-Oqv');
|
||||
if (!empty($fan_status)) {
|
||||
discover_sensor($valid['sensor'], 'state', $device, $fan_oid, 'fanstatus'.$i, 'snmp', 'Fan '.$i.' Status', '1', '1', '1', null, null, '3', $fan_status);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* LibreNMS Accedian MetroNID Temperature Sensor Discovery module
|
||||
*
|
||||
|
||||
@@ -8,21 +8,6 @@ if ($device['os'] == 'aos') {
|
||||
|
||||
if ($descr != '' && is_numeric($temperature) && $temperature > '0') {
|
||||
$temperature_oid = '.1.3.6.1.4.1.18248.1.1.1.0';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
'.1.3.6.1.4.1.6486.800.1.2.1.16.1.1.1.17.0',
|
||||
'1',
|
||||
'alcatel-device',
|
||||
$descr,
|
||||
'1',
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$temperature
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, '.1.3.6.1.4.1.6486.800.1.2.1.16.1.1.1.17.0', '1', 'alcatel-device', $descr, '1', '1', null, null, null, null, $temperature);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'apc') {
|
||||
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.1.2.2.2.0', '-OsqnU', '');
|
||||
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.1.2.2.2.0', '-OsqnU', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids) {
|
||||
@@ -56,24 +56,24 @@ if ($device['os'] == 'apc') {
|
||||
if ($oids) {
|
||||
echo 'APC InRow Chiller ';
|
||||
$temps = array();
|
||||
$temps['airIRRCUnitStatusRackInletTempMetric'] = 'Rack Inlet';
|
||||
$temps['airIRRCUnitStatusSupplyAirTempMetric'] = 'Supply Air';
|
||||
$temps['airIRRCUnitStatusReturnAirTempMetric'] = 'Return Air';
|
||||
$temps['airIRRCUnitStatusEnteringFluidTemperatureMetric'] = 'Entering Fluid';
|
||||
$temps['airIRRCUnitStatusLeavingFluidTemperatureMetric'] = 'Leaving Fluid';
|
||||
$temps['.1.3.6.1.4.1.318.1.1.13.3.2.2.2.7'] = 'Rack Inlet'; //airIRRCUnitStatusRackInletTempMetric
|
||||
$temps['.1.3.6.1.4.1.318.1.1.13.3.2.2.2.9'] = 'Supply Air'; //airIRRCUnitStatusSupplyAirTempMetric
|
||||
$temps['.1.3.6.1.4.1.318.1.1.13.3.2.2.2.11'] = 'Return Air'; //airIRRCUnitStatusReturnAirTempMetric
|
||||
$temps['.1.3.6.1.4.1.318.1.1.13.3.2.2.2.24'] = 'Entering Fluid'; //airIRRCUnitStatusEnteringFluidTemperatureMetric
|
||||
$temps['.1.3.6.1.4.1.318.1.1.13.3.2.2.2.26'] = 'Leaving Fluid'; //airIRRCUnitStatusLeavingFluidTemperatureMetric
|
||||
foreach ($temps as $obj => $descr) {
|
||||
$oids = snmp_get($device, $obj.'.0', '-OsqnU', 'PowerNet-MIB');
|
||||
list($oid,$current) = explode(' ', $oids);
|
||||
$divisor = 10;
|
||||
$sensorType = substr($descr, 0, 2);
|
||||
echo discover_sensor($valid['sensor'], 'temperature', $device, $oid, '0', $sensorType, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, '0', $sensorType, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
|
||||
// Portable Air Conditioner
|
||||
$set_oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.13.2.2.4.0', '-OsqnU', '');
|
||||
$set_oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.13.2.2.4.0', '-OsqnU', '');
|
||||
|
||||
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.13.2.2.10.0', '-OsqnU', '');
|
||||
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.13.2.2.10.0', '-OsqnU', '');
|
||||
d_echo($oids."\n");
|
||||
d_echo($set_oids."\n");
|
||||
|
||||
@@ -96,7 +96,7 @@ if ($device['os'] == 'apc') {
|
||||
}
|
||||
|
||||
unset($oids);
|
||||
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.13.2.2.12.0', '-OsqnU', '');
|
||||
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.13.2.2.12.0', '-OsqnU', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids !== false) {
|
||||
@@ -118,7 +118,7 @@ if ($device['os'] == 'apc') {
|
||||
}
|
||||
|
||||
unset($oids);
|
||||
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.13.2.2.14.0', '-OsqnU', '');
|
||||
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.13.2.2.14.0', '-OsqnU', '');
|
||||
d_echo($oids."\n");
|
||||
if ($oids !== false) {
|
||||
echo 'APC Portable Remote Temp ';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'areca') {
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.18928.1.1.2.14.1.2', '-Osqn', '');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.18928.1.1.2.14.1.2', '-Osqn', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
@@ -15,31 +15,16 @@ if ($device['os'] == 'areca') {
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$temperature_id = $split_oid[(count($split_oid) - 1)];
|
||||
$temperature_oid = "1.3.6.1.4.1.18928.1.1.2.14.1.2.$temperature_id";
|
||||
$temperature_oid = ".1.3.6.1.4.1.18928.1.1.2.14.1.2.$temperature_id";
|
||||
$temperature = snmp_get($device, $temperature_oid, '-Oqv', '');
|
||||
$descr = "Hard disk $temperature_id";
|
||||
if ($temperature != -128) { // -128 = not measured/present
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
$temperature_oid,
|
||||
zeropad($temperature_id),
|
||||
'areca',
|
||||
$descr,
|
||||
'1',
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$temperature
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, zeropad($temperature_id), 'areca', $descr, '1', '1', null, null, null, null, $temperature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.18928.1.2.2.1.10.1.2', '-OsqnU', '');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.18928.1.2.2.1.10.1.2', '-OsqnU', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids) {
|
||||
@@ -54,25 +39,10 @@ if ($device['os'] == 'areca') {
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
$oid = '1.3.6.1.4.1.18928.1.2.2.1.10.1.3.'.$index;
|
||||
$oid = '.1.3.6.1.4.1.18928.1.2.2.1.10.1.3.'.$index;
|
||||
$current = snmp_get($device, $oid, '-Oqv', '');
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
$oid,
|
||||
$index,
|
||||
'areca',
|
||||
trim($descr, '"'),
|
||||
'1',
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$current
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, 'areca', trim($descr, '"'), '1', '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ if ($device['os'] == 'avaya-ers') {
|
||||
|
||||
// Temperature info only known to be present in firmware 6.1 or higher
|
||||
if ($fw_major_version >= 6.1) {
|
||||
$temps = snmp_walk($device, '1.3.6.1.4.1.45.1.6.3.7.1.1.5.5', '-Osqn');
|
||||
$temps = snmp_walk($device, '.1.3.6.1.4.1.45.1.6.3.7.1.1.5.5', '-Osqn');
|
||||
|
||||
foreach (explode("\n", $temps) as $i => $t) {
|
||||
$t = explode(' ', $t);
|
||||
@@ -16,22 +16,7 @@ if ($device['os'] == 'avaya-ers') {
|
||||
$val = $t[1];
|
||||
// Sensors are reported as 2 * value
|
||||
$val = (trim($val) / 2);
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
$oid,
|
||||
zeropad($i + 1),
|
||||
'avaya-ers',
|
||||
'Unit '.($i + 1).' temperature',
|
||||
'2',
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$val
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, zeropad($i + 1), 'avaya-ers', 'Unit '.($i + 1).' temperature', '2', '1', null, null, null, null, $val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'cambium') {
|
||||
$oid = 'boxTemperatureC.0';
|
||||
$oids = trim(str_replace('"', '', snmp_get($device, "$oid", '-OsqnU', 'WHISP-BOX-MIBV2-MIB')));
|
||||
$oid = '.1.3.6.1.4.1.161.19.3.3.1.35.0';
|
||||
$oids = trim(str_replace('"', '', snmp_get($device, "$oid", '-OsqnU')));
|
||||
d_echo($oids."\n");
|
||||
|
||||
if (!empty($oids)) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'canopy') {
|
||||
$oid = 'boxTemperatureC.0';
|
||||
$oids = trim(str_replace('"', '', snmp_get($device, "$oid", '-OsqnU', 'WHISP-BOX-MIBV2-MIB')));
|
||||
$oid = '.1.3.6.1.4.1.161.19.3.3.1.35.0';
|
||||
$oids = trim(str_replace('"', '', snmp_get($device, "$oid", '-OsqnU')));
|
||||
d_echo($oids."\n");
|
||||
|
||||
if (!empty($oids)) {
|
||||
|
||||
@@ -44,22 +44,7 @@ if ($device['os'] == 'cometsystem-p85xx') {
|
||||
$limit = trim($sensor['limit_high'], ' "');
|
||||
$temperature = $sensor['temp_intval'];
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
$temperature_oid,
|
||||
$temperature_id,
|
||||
'cometsystem-p85xx',
|
||||
$descr,
|
||||
'10',
|
||||
'1',
|
||||
$lowlimit,
|
||||
null,
|
||||
null,
|
||||
$limit,
|
||||
$temperature
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, $temperature_id, 'cometsystem-p85xx', $descr, '10', '1', $lowlimit, null, null, $limit, $temperature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,22 +15,7 @@ if ($device['os'] == 'dnos') {
|
||||
if (substr($oid, -1) == '1') {
|
||||
// This code will only pull CPU temp for each stack member, but there is no reason why the additional values couldn't be graphed
|
||||
$counter = $counter + 1;
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
$oid,
|
||||
$counter,
|
||||
'dnos',
|
||||
'Unit '.$counter.' CPU temperature',
|
||||
'1',
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$val
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $counter, 'dnos', 'Unit '.$counter.' CPU temperature', '1', '1', null, null, null, null, $val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ if ($device['os'] == 'xos') {
|
||||
$low_limit = 5;
|
||||
|
||||
$descr = "Chassis Temperature";
|
||||
$oid = "1.3.6.1.4.1.1916.1.1.1.8.0"; // extremeCurrentTemperature
|
||||
$oid = ".1.3.6.1.4.1.1916.1.1.1.8.0"; // extremeCurrentTemperature
|
||||
$value = snmp_get($device, $oid, '-Oqv', 'EXTREME-BASE-MIB');
|
||||
|
||||
if (is_numeric($value)) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if (strpos($sysObjectId, '.1.3.6.1.4.1.232.') !== false) {
|
||||
echo 'HP_ILO ';
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.232.6.2.6.8.1.2.1', '-Osqn', '');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.232.6.2.6.8.1.2.1', '-Osqn', '');
|
||||
$oids = trim($oids);
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
@@ -11,13 +11,13 @@ if (strpos($sysObjectId, '.1.3.6.1.4.1.232.') !== false) {
|
||||
$split_oid = explode('.', $oid);
|
||||
$temperature_id = $split_oid[(count($split_oid) - 2)].'.'.$split_oid[(count($split_oid) - 1)];
|
||||
|
||||
$descr_oid = "1.3.6.1.4.1.232.6.2.6.8.1.3.$temperature_id";
|
||||
$descr_oid = ".1.3.6.1.4.1.232.6.2.6.8.1.3.$temperature_id";
|
||||
$descr = snmp_get($device, $descr_oid, '-Oqnv', 'CPQHLTH-MIB');
|
||||
|
||||
$temperature_oid = "1.3.6.1.4.1.232.6.2.6.8.1.4.$temperature_id";
|
||||
$temperature_oid = ".1.3.6.1.4.1.232.6.2.6.8.1.4.$temperature_id";
|
||||
$temperature = snmp_get($device, $temperature_oid, '-Oqv', '');
|
||||
|
||||
$threshold_oid = "1.3.6.1.4.1.232.6.2.6.8.1.5.$temperature_id";
|
||||
$threshold_oid = ".1.3.6.1.4.1.232.6.2.6.8.1.5.$temperature_id";
|
||||
$threshold = snmp_get($device, $threshold_oid, '-Oqv', '');
|
||||
|
||||
if (!empty($temperature)) {
|
||||
|
||||
@@ -5,12 +5,12 @@ if (strstr($device['sysDescr'], 'IBM Flex System Fabric')) {
|
||||
$index = 0;
|
||||
echo 'IBM Flex System Fabric ';
|
||||
$temps = array();
|
||||
$temps['1.3.6.1.4.1.20301.2.5.1.3.1.22.0'] = 'Temperature Sensor 1';
|
||||
$temps['1.3.6.1.4.1.20301.2.5.1.3.1.23.0'] = 'Temperature Sensor 2';
|
||||
$temps['1.3.6.1.4.1.20301.2.5.1.3.1.26.0'] = 'Temperature Sensor 3';
|
||||
$temps['1.3.6.1.4.1.20301.2.5.1.3.1.27.0'] = 'Temperature Sensor 4';
|
||||
$temps['.1.3.6.1.4.1.20301.2.5.1.3.1.22.0'] = 'Temperature Sensor 1';
|
||||
$temps['.1.3.6.1.4.1.20301.2.5.1.3.1.23.0'] = 'Temperature Sensor 2';
|
||||
$temps['.1.3.6.1.4.1.20301.2.5.1.3.1.26.0'] = 'Temperature Sensor 3';
|
||||
$temps['.1.3.6.1.4.1.20301.2.5.1.3.1.27.0'] = 'Temperature Sensor 4';
|
||||
if (strstr($device['hardware'], 'EN4093R 10Gb Scalable Switch')) {
|
||||
$temps['1.3.6.1.4.1.20301.2.5.1.3.1.36.0'] = 'Temperature Sensor 5';
|
||||
$temps['.1.3.6.1.4.1.20301.2.5.1.3.1.36.0'] = 'Temperature Sensor 5';
|
||||
}
|
||||
|
||||
foreach ($temps as $obj => $descr) {
|
||||
|
||||
@@ -26,22 +26,7 @@ if ($device['os'] == 'ironware') {
|
||||
|
||||
$current = ($temperature / 2);
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
$temperature_oid,
|
||||
$oid,
|
||||
'ironware',
|
||||
$descr,
|
||||
'2',
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$current
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, $oid, 'ironware', $descr, '2', '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
|
||||
if ($device['os'] == 'junos' || $device['os_group'] == 'junos') {
|
||||
echo 'JunOS ';
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.2636.3.1.13.1.7', '-Osqn', 'JUNIPER-MIB', 'junos');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.2636.3.1.13.1.7', '-Osqn', 'JUNIPER-MIB', 'junos');
|
||||
$oids = trim($oids);
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
$data = substr($data, 29);
|
||||
if ($data) {
|
||||
list($oid) = explode(' ', $data);
|
||||
$temperature_oid = "1.3.6.1.4.1.2636.3.1.13.1.7.$oid";
|
||||
$descr_oid = "1.3.6.1.4.1.2636.3.1.13.1.5.$oid";
|
||||
$temperature_oid = ".1.3.6.1.4.1.2636.3.1.13.1.7.$oid";
|
||||
$descr_oid = ".1.3.6.1.4.1.2636.3.1.13.1.5.$oid";
|
||||
$descr = snmp_get($device, $descr_oid, '-Oqv', 'JUNIPER-MIB', 'junos');
|
||||
$temperature = snmp_get($device, $temperature_oid, '-Oqv', 'JUNIPER-MIB', 'junos');
|
||||
if (!strstr($descr, 'No') && !strstr($temperature, 'No') && $descr != '' && $temperature != '0') {
|
||||
@@ -20,22 +20,7 @@ if ($device['os'] == 'junos' || $device['os_group'] == 'junos') {
|
||||
$descr = str_replace('sensor', '', $descr);
|
||||
$descr = trim($descr);
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
$temperature_oid,
|
||||
$oid,
|
||||
'junos',
|
||||
$descr,
|
||||
'1',
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$temperature
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, $oid, 'junos', $descr, '1', '1', null, null, null, null, $temperature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,28 +15,13 @@ if ($device['os'] == 'linux' || $device['os'] == 'pktj' || $device['os'] == 'cum
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$temperature_id = $split_oid[(count($split_oid) - 1)];
|
||||
$temperature_oid = "1.3.6.1.4.1.2021.13.16.2.1.3.$temperature_id";
|
||||
$temperature_oid = ".1.3.6.1.4.1.2021.13.16.2.1.3.$temperature_id";
|
||||
$temperature = (snmp_get($device, $temperature_oid, '-Ovq') / 1000);
|
||||
$descr = str_ireplace('temperature-', '', $descr);
|
||||
$descr = str_ireplace('temp-', '', $descr);
|
||||
$descr = trim($descr);
|
||||
if ($temperature != '0' && $temperature <= '1000') {
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
$temperature_oid,
|
||||
$temperature_id,
|
||||
'lmsensors',
|
||||
$descr,
|
||||
'1000',
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$temperature
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, $temperature_id, 'lmsensors', $descr, '1000', '1', null, null, null, null, $temperature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,22 +17,7 @@ if ($device['os'] == 'netbotz') {
|
||||
$descr = preg_replace('/Temperature /', '', $descr);
|
||||
$descr = trim($descr);
|
||||
if ($temperature != '0' && $temperature <= '1000') {
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
$temperature_oid,
|
||||
$temperature_id,
|
||||
'netbotz',
|
||||
$descr,
|
||||
'1',
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$temperature
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, $temperature_id, 'netbotz', $descr, '1', '1', null, null, null, null, $temperature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
if ($device['os'] == "nos") {
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.1588.2.1.1.1.1.22.1.2', '-Osqn');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.1588.2.1.1.1.1.22.1.2', '-Osqn');
|
||||
$oids = trim($oids);
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
|
||||
@@ -9,21 +9,6 @@ if ($device['os'] == 'papouch-tme') {
|
||||
if ($descr != '' && is_numeric($temperature) && $temperature > '0') {
|
||||
$temperature_oid = '.1.3.6.1.4.1.18248.1.1.1.0';
|
||||
$descr = trim(str_replace('"', '', $descr));
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
$temperature_oid,
|
||||
'1',
|
||||
'papouch-tme',
|
||||
$descr,
|
||||
'10',
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$temperature
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, '1', 'papouch-tme', $descr, '10', '1', null, null, null, null, $temperature);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ if ($device['os'] == 'pbn' || $device['os_group'] == 'pbn') {
|
||||
$divisor = 256;
|
||||
foreach ($pbn_oids as $index => $entry) {
|
||||
if (is_numeric($entry['temperature']) && ($entry['temperature'] !== '-65535')) {
|
||||
$oid = 'NMS-IF-MIB::temperature.'.$index;
|
||||
$oid = '.1.3.6.1.4.1.11606.10.9.63.1.7.1.4.'.$index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Temperature';
|
||||
$limit_low = -256;
|
||||
$warn_limit_low = 10;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
// RFC1628 UPS
|
||||
if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modules_compat']['rfc1628'][$device['os']]) {
|
||||
$oids = snmp_walk($device, '1.3.6.1.2.1.33.1.2.7', '-Osqn', 'UPS-MIB');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.2.1.33.1.2.7', '-Osqn', 'UPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
@@ -15,7 +15,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$temperature_id = $split_oid[(count($split_oid) - 1)];
|
||||
$temperature_oid = "1.3.6.1.2.1.33.1.2.7.$temperature_id";
|
||||
$temperature_oid = ".1.3.6.1.2.1.33.1.2.7.$temperature_id";
|
||||
$temperature = snmp_get($device, $temperature_oid, '-Ovq');
|
||||
$descr = 'Battery'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($temperature_id + 1));
|
||||
|
||||
|
||||
@@ -13,11 +13,10 @@
|
||||
if ($device['os'] == 'riverbed') {
|
||||
d_echo('Riverbed');
|
||||
|
||||
$oid = 'systemTemperature.0';
|
||||
$mib = 'STEELHEAD-MIB';
|
||||
$oid = '.1.3.6.1.4.1.17163.1.1.2.9.0';
|
||||
$descr = 'System Temperature';
|
||||
$index = $oid;
|
||||
$temp = snmp_get($device, $oid, 'Oqv', $mib);
|
||||
$temp = snmp_get($device, $oid, 'Oqv');
|
||||
|
||||
if (is_numeric($temp)) {
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, 'riverbed', $descr, '1', '1', 0, null, null, 65, $current);
|
||||
|
||||
@@ -19,7 +19,7 @@ if ($device['os'] == 'sentry3') {
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
|
||||
// tempHumidSensorTempValue
|
||||
$temperature_oid = '1.3.6.1.4.1.1718.3.2.5.1.6.1.'.$index;
|
||||
$temperature_oid = '.1.3.6.1.4.1.1718.3.2.5.1.6.1.'.$index;
|
||||
$descr = 'Removable Sensor '.$index;
|
||||
$low_warn_limit = null;
|
||||
$low_limit = (snmp_get($device, "tempHumidSensorTempLowThresh.1.$index", '-Ovq', 'Sentry3-MIB') / $divisor);
|
||||
@@ -28,22 +28,7 @@ if ($device['os'] == 'sentry3') {
|
||||
$current = (snmp_get($device, "$temperature_oid", '-Ovq', 'Sentry3-MIB') / $divisor);
|
||||
|
||||
if ($current >= 0) {
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
$temperature_oid,
|
||||
$index,
|
||||
'sentry3',
|
||||
$descr,
|
||||
$divisor,
|
||||
$multiplier,
|
||||
$low_limit,
|
||||
$low_warn_limit,
|
||||
$high_warn_limit,
|
||||
$high_limit,
|
||||
$current
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, $index, 'sentry3', $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (c) 2016 Dropbox, Inc.
|
||||
*
|
||||
@@ -35,7 +34,7 @@ if ($device['os'] == 'sentry4') {
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
|
||||
// Sentry4-MIB::st4TempSensorValue
|
||||
$temperature_oid = '1.3.6.1.4.1.1718.4.1.9.3.1.1.1.'.$index;
|
||||
$temperature_oid = '.1.3.6.1.4.1.1718.4.1.9.3.1.1.1.'.$index;
|
||||
$descr = 'Removable Sensor '.$index;
|
||||
$low_warn_limit = (snmp_get($device, "st4TempSensorLowWarning.1.$index", '-Ovq', 'Sentry4-MIB') / $divisor);
|
||||
$low_limit = (snmp_get($device, "st4TempSensorLowAlarm.1.$index", '-Ovq', 'Sentry4-MIB') / $divisor);
|
||||
@@ -44,22 +43,7 @@ if ($device['os'] == 'sentry4') {
|
||||
$current = (snmp_get($device, "$temperature_oid", '-Ovq', 'Sentry4-MIB') / $divisor);
|
||||
|
||||
if ($current >= 0) {
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
$temperature_oid,
|
||||
$index,
|
||||
'sentry4',
|
||||
$descr,
|
||||
$divisor,
|
||||
$multiplier,
|
||||
$low_limit,
|
||||
$low_warn_limit,
|
||||
$high_warn_limit,
|
||||
$high_limit,
|
||||
$current
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, $index, 'sentry4', $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ if ($device['os'] == 'serveriron') {
|
||||
$high_warn_limit = 95;
|
||||
|
||||
$descr = "Chassis Temperature";
|
||||
$oid = "1.3.6.1.4.1.1991.1.1.1.1.18.0"; // snChasActualTemperature
|
||||
$warn_oid = "1.3.6.1.4.1.1991.1.1.1.1.19.0"; // snChasWarningTemperature
|
||||
$high_oid = "1.3.6.1.4.1.1991.1.1.1.1.20.0"; // snChasShutdownTemperature
|
||||
$oid = ".1.3.6.1.4.1.1991.1.1.1.1.18.0"; // snChasActualTemperature
|
||||
$warn_oid = ".1.3.6.1.4.1.1991.1.1.1.1.19.0"; // snChasWarningTemperature
|
||||
$high_oid = ".1.3.6.1.4.1.1991.1.1.1.1.20.0"; // snChasShutdownTemperature
|
||||
$value = snmp_get($device, $oid, '-Oqv');
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'siklu') {
|
||||
$oid = 'rbSysTemperature.0';
|
||||
$oids = snmp_get($device, "$oid", '-OsqnU', 'RADIO-BRIDGE-MIB');
|
||||
$oid = '.1.3.6.1.4.1.31926.1.2.0';
|
||||
$oids = snmp_get($device, "$oid", '-OsqnU');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if (!empty($oids)) {
|
||||
|
||||
@@ -26,20 +26,5 @@ if ($device['os'] == 'sub10') {
|
||||
}
|
||||
|
||||
// Create Sensor
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
$oid,
|
||||
$oid,
|
||||
'sub10',
|
||||
'Modem',
|
||||
'1',
|
||||
'1',
|
||||
$thresholds[$indexes['low']],
|
||||
null,
|
||||
null,
|
||||
$thresholds[$indexes['high']],
|
||||
$current
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $oid, 'sub10', 'Modem', '1', '1', $thresholds[$indexes['low']], null, null, $thresholds[$indexes['high']], $current);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if ($device['os'] == 'linux') {
|
||||
// Supermicro sensors
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.10876.2.1.1.1.1.3', '-Osqn', 'SUPERMICRO-HEALTH-MIB');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.10876.2.1.1.1.1.3', '-Osqn', 'SUPERMICRO-HEALTH-MIB');
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo 'Supermicro ';
|
||||
@@ -15,11 +15,11 @@ if ($device['os'] == 'linux') {
|
||||
$oid_ex = explode('.', $oid);
|
||||
$index = $oid_ex[(count($oid_ex) - 1)];
|
||||
if ($type == 2) {
|
||||
$temperature_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.4.$index";
|
||||
$descr_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.2.$index";
|
||||
$limit_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.5.$index";
|
||||
$divisor_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.9.$index";
|
||||
$monitor_oid = "1.3.6.1.4.1.10876.2.1.1.1.1.10.$index";
|
||||
$temperature_oid = ".1.3.6.1.4.1.10876.2.1.1.1.1.4.$index";
|
||||
$descr_oid = ".1.3.6.1.4.1.10876.2.1.1.1.1.2.$index";
|
||||
$limit_oid = ".1.3.6.1.4.1.10876.2.1.1.1.1.5.$index";
|
||||
$divisor_oid = ".1.3.6.1.4.1.10876.2.1.1.1.1.9.$index";
|
||||
$monitor_oid = ".1.3.6.1.4.1.10876.2.1.1.1.1.10.$index";
|
||||
$descr = snmp_get($device, $descr_oid, '-Oqv', 'SUPERMICRO-HEALTH-MIB');
|
||||
$temperature = snmp_get($device, $temperature_oid, '-Oqv', 'SUPERMICRO-HEALTH-MIB');
|
||||
$limit = snmp_get($device, $limit_oid, '-Oqv', 'SUPERMICRO-HEALTH-MIB');
|
||||
@@ -27,22 +27,7 @@ if ($device['os'] == 'linux') {
|
||||
$monitor = snmp_get($device, $monitor_oid, '-Oqv', 'SUPERMICRO-HEALTH-MIB');
|
||||
if ($monitor == 'true') {
|
||||
$descr = trim(str_ireplace('temperature', '', $descr));
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
$temperature_oid,
|
||||
trim($index, '.'),
|
||||
'supermicro',
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$limit,
|
||||
$temperature
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, trim($index, '.'), 'supermicro', $descr, (int)$divisor, '1', null, null, null, $limit, $temperature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,22 +24,7 @@ if ($device['os'] == 'powerware') {
|
||||
$temperature = snmp_get($device, $temperature_oid, '-Ovq');
|
||||
$descr = 'Ambient'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($temperature_id + 1));
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
$temperature_oid,
|
||||
'1.6.1.'.$temperature_id,
|
||||
'powerware',
|
||||
$descr,
|
||||
'1',
|
||||
'1',
|
||||
$lowlimit,
|
||||
null,
|
||||
null,
|
||||
$highlimit,
|
||||
$temperature
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $temperature_oid, '1.6.1.'.$temperature_id, 'powerware', $descr, '1', '1', $lowlimit, null, null, $highlimit, $temperature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,22 +15,7 @@ if ($device['os'] == 'ies') {
|
||||
$oid = '.1.3.6.1.4.1.890.1.5.1.1.6.1.2.'.$index;
|
||||
$current = $entry['accessSwitchSysTempCurValue'];
|
||||
$divisor = '1';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'temperature',
|
||||
$device,
|
||||
$oid,
|
||||
$index,
|
||||
'zyxel-ies',
|
||||
$descr,
|
||||
'1',
|
||||
'1',
|
||||
null,
|
||||
$entry['accessSwitchSysTempHighThresh'],
|
||||
null,
|
||||
null,
|
||||
$current
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $index, 'zyxel-ies', $descr, '1', '1', null, $entry['accessSwitchSysTempHighThresh'], null, null, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
// APC Voltages
|
||||
if ($device['os'] == 'apc') {
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.318.1.1.8.5.3.3.1.3', '-OsqnU', '');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.318.1.1.8.5.3.3.1.3', '-OsqnU');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids) {
|
||||
@@ -17,14 +17,14 @@ if ($device['os'] == 'apc') {
|
||||
list($oid,$current) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 3)];
|
||||
$oid = '1.3.6.1.4.1.318.1.1.8.5.3.3.1.3.'.$index.'.1.1';
|
||||
$oid = '.1.3.6.1.4.1.318.1.1.8.5.3.3.1.3.'.$index.'.1.1';
|
||||
$descr = 'Input Feed '.chr(64 + $index);
|
||||
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $oid, "3.3.1.3.$index", $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.318.1.1.8.5.4.3.1.3', '-OsqnU', '');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.318.1.1.8.5.4.3.1.3', '-OsqnU');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids) {
|
||||
@@ -39,7 +39,7 @@ if ($device['os'] == 'apc') {
|
||||
list($oid,$current) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 3)];
|
||||
$oid = '1.3.6.1.4.1.318.1.1.8.5.4.3.1.3.'.$index.'.1.1';
|
||||
$oid = '.1.3.6.1.4.1.318.1.1.8.5.4.3.1.3.'.$index.'.1.1';
|
||||
$descr = 'Output Feed';
|
||||
if (count(explode("\n", $oids)) > 1) {
|
||||
$descr .= " $index";
|
||||
@@ -49,7 +49,7 @@ if ($device['os'] == 'apc') {
|
||||
}
|
||||
}
|
||||
|
||||
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.1.3.2.1.0', '-OsqnU', '');
|
||||
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.1.3.2.1.0', '-OsqnU');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids) {
|
||||
@@ -63,7 +63,7 @@ if ($device['os'] == 'apc') {
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = snmp_get($device, '1.3.6.1.4.1.318.1.1.1.4.2.1.0', '-OsqnU', '');
|
||||
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.1.4.2.1.0', '-OsqnU');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids) {
|
||||
@@ -78,8 +78,7 @@ if ($device['os'] == 'apc') {
|
||||
}
|
||||
|
||||
// PDU
|
||||
// $oids = snmp_get($device, "1.3.6.1.4.1.318.1.1.12.1.15.0", "-OsqnU", "");
|
||||
$oids = snmp_walk($device, 'rPDUIdentDeviceLinetoLineVoltage.0', '-OsqnU', 'PowerNet-MIB');
|
||||
$oids = snmp_get($device, ".1.3.6.1.4.1.318.1.1.12.1.15.0", "-OsqnU");
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids) {
|
||||
@@ -93,7 +92,7 @@ if ($device['os'] == 'apc') {
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.318.1.1.26.6.3.1.6', '-OsqnU', 'PowerNet-MIB');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.318.1.1.26.6.3.1.6', '-OsqnU');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
// Areca Voltages
|
||||
if ($device['os'] == 'areca') {
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.18928.1.2.2.1.8.1.2', '-OsqnU', '');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.18928.1.2.2.1.8.1.2', '-OsqnU', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids) {
|
||||
@@ -17,7 +17,7 @@ if ($device['os'] == 'areca') {
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
$oid = '1.3.6.1.4.1.18928.1.2.2.1.8.1.3.'.$index;
|
||||
$oid = '.1.3.6.1.4.1.18928.1.2.2.1.8.1.3.'.$index;
|
||||
$current = (snmp_get($device, $oid, '-Oqv', '') / $divisor);
|
||||
if (trim($descr, '"') != 'Battery Status') {
|
||||
// Battery Status is charge percentage, or 255 when no BBU
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if ($device['os'] == 'gamatronicups') {
|
||||
for ($i = 1; $i <= 3; $i++) {
|
||||
$volt_oid = "GAMATRONIC-MIB::gamatronicLTD.5.4.1.1.2.$i";
|
||||
$volt_oid = ".1.3.6.1.4.1.6050.5.4.1.1.2.$i";
|
||||
$descr = "Input Phase $i";
|
||||
$volt = snmp_get($device, $volt_oid, '-Oqv');
|
||||
$type = 'gamatronicups';
|
||||
@@ -11,26 +11,11 @@ if ($device['os'] == 'gamatronicups') {
|
||||
$lowlimit = 0;
|
||||
$limit = null;
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'voltage',
|
||||
$device,
|
||||
$volt_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$volt
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $volt);
|
||||
}
|
||||
|
||||
for ($i = 1; $i <= 3; $i++) {
|
||||
$volt_oid = "GAMATRONIC-MIB::gamatronicLTD.5.5.1.1.2.$i";
|
||||
$volt_oid = ".1.3.6.1.4.1.6050.5.5.1.1.2.$i";
|
||||
$descr = "Output Phase $i";
|
||||
$volt = snmp_get($device, $volt_oid, '-Oqv');
|
||||
$type = 'gamatronicups';
|
||||
@@ -39,21 +24,6 @@ if ($device['os'] == 'gamatronicups') {
|
||||
$lowlimit = 0;
|
||||
$limit = null;
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'voltage',
|
||||
$device,
|
||||
$volt_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$volt
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $volt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,21 +5,21 @@ if ($device['os'] == 'ipoman') {
|
||||
echo ' IPOMANII-MIB ';
|
||||
|
||||
if (!is_array($cache['ipoman'])) {
|
||||
echo 'outletConfigDesc ';
|
||||
d_echo('outletConfigDesc ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigDesc', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
echo 'outletConfigLocation ';
|
||||
d_echo('outletConfigLocation ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigLocation', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
echo 'inletConfigDesc ';
|
||||
d_echo('inletConfigDesc ');
|
||||
$cache['ipoman']['in'] = snmpwalk_cache_multi_oid($device, 'inletConfigDesc', $cache['ipoman']['in'], 'IPOMANII-MIB');
|
||||
}
|
||||
|
||||
$oids = array();
|
||||
|
||||
echo 'inletConfigVoltageHigh ';
|
||||
d_echo('inletConfigVoltageHigh ');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'inletConfigVoltageHigh', $oids, 'IPOMANII-MIB');
|
||||
echo 'inletConfigVoltageLow ';
|
||||
d_echo('inletConfigVoltageLow ');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'inletConfigVoltageLow', $oids, 'IPOMANII-MIB');
|
||||
echo 'inletStatusVoltage ';
|
||||
d_echo('inletStatusVoltage ');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'inletStatusVoltage', $oids, 'IPOMANII-MIB');
|
||||
|
||||
if (is_array($oids)) {
|
||||
|
||||
@@ -45,7 +45,7 @@ if (preg_match("/(bcm).+(boardrev)/", $raspberry)) {
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
$oid = '1.3.6.1.4.1.2021.13.16.4.1.3.'.$index;
|
||||
$oid = '.1.3.6.1.4.1.2021.13.16.4.1.3.'.$index;
|
||||
$current = (snmp_get($device, $oid, '-Oqv', 'LM-SENSORS-MIB') / $divisor);
|
||||
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
if ($device['os'] == 'netvision') {
|
||||
// Battery voltage
|
||||
$volt_oid = '1.3.6.1.4.1.4555.1.1.1.1.2.5.0';
|
||||
$volt_oid = '.1.3.6.1.4.1.4555.1.1.1.1.2.5.0';
|
||||
$descr = 'Battery';
|
||||
$volt = snmp_get($device, $volt_oid, '-Oqv');
|
||||
$type = 'netvision';
|
||||
@@ -11,25 +11,10 @@ if ($device['os'] == 'netvision') {
|
||||
$lowlimit = 0;
|
||||
$limit = null;
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'voltage',
|
||||
$device,
|
||||
$volt_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$volt
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $volt);
|
||||
|
||||
for ($i = 1; $i <= 3; $i++) {
|
||||
$volt_oid = "1.3.6.1.4.1.4555.1.1.1.1.3.3.1.2.$i";
|
||||
$volt_oid = ".1.3.6.1.4.1.4555.1.1.1.1.3.3.1.2.$i";
|
||||
$descr = "Input Phase $i";
|
||||
$volt = snmp_get($device, $volt_oid, '-Oqv');
|
||||
$type = 'netvision';
|
||||
@@ -38,26 +23,11 @@ if ($device['os'] == 'netvision') {
|
||||
$lowlimit = 0;
|
||||
$limit = null;
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'voltage',
|
||||
$device,
|
||||
$volt_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$volt
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $volt);
|
||||
}
|
||||
|
||||
for ($i = 1; $i <= 3; $i++) {
|
||||
$volt_oid = "1.3.6.1.4.1.4555.1.1.1.1.4.4.1.2.$i";
|
||||
$volt_oid = ".1.3.6.1.4.1.4555.1.1.1.1.4.4.1.2.$i";
|
||||
$descr = "Output Phase $i";
|
||||
$volt = snmp_get($device, $volt_oid, '-Oqv');
|
||||
$type = 'netvision';
|
||||
@@ -66,21 +36,6 @@ if ($device['os'] == 'netvision') {
|
||||
$lowlimit = 0;
|
||||
$limit = null;
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'voltage',
|
||||
$device,
|
||||
$volt_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$volt
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $volt);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ if ($device['os'] == 'pbn' || $device['os_group'] == 'pbn') {
|
||||
$divisor = 10000;
|
||||
foreach ($pbn_oids as $index => $entry) {
|
||||
if (is_numeric($entry['voltage']) && ($entry['voltage'] !== '-65535')) {
|
||||
$oid = 'NMS-IF-MIB::voltage.'.$index;
|
||||
$oid = '.1.3.6.1.4.1.11606.10.9.63.1.7.1.5.'.$index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Voltage';
|
||||
$limit_low = 30000/$divisor;
|
||||
$warn_limit_low = 32100/$divisor;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modules_compat']['rfc1628'][$device['os']]) {
|
||||
echo 'RFC1628 ';
|
||||
|
||||
$oids = snmp_walk($device, '1.3.6.1.2.1.33.1.2.5', '-Osqn', 'UPS-MIB');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.2.1.33.1.2.5', '-Osqn', 'UPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
@@ -14,7 +14,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$volt_id = $split_oid[(count($split_oid) - 1)];
|
||||
$volt_oid = "1.3.6.1.2.1.33.1.2.5.$volt_id";
|
||||
$volt_oid = ".1.3.6.1.2.1.33.1.2.5.$volt_id";
|
||||
$divisor = get_device_divisor($device, $_tmp_serial, 'voltages');
|
||||
|
||||
$volt = (snmp_get($device, $volt_oid, '-O vq') / $divisor);
|
||||
@@ -26,7 +26,7 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
}
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, '1.3.6.1.2.1.33.1.4.3.0', '-OsqnU'));
|
||||
$oids = trim(snmp_walk($device, '.1.3.6.1.2.1.33.1.4.3.0', '-OsqnU'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
@@ -46,12 +46,12 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, '1.3.6.1.2.1.33.1.3.2.0', '-OsqnU'));
|
||||
$oids = trim(snmp_walk($device, '.1.3.6.1.2.1.33.1.3.2.0', '-OsqnU'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$volt_oid = "1.3.6.1.2.1.33.1.3.3.1.3.$i";
|
||||
$volt_oid = ".1.3.6.1.2.1.33.1.3.3.1.3.$i";
|
||||
$descr = 'Input';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
@@ -67,12 +67,12 @@ if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modul
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $volt_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, '1.3.6.1.2.1.33.1.5.2.0', '-OsqnU'));
|
||||
$oids = trim(snmp_walk($device, '.1.3.6.1.2.1.33.1.5.2.0', '-OsqnU'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$volt_oid = "1.3.6.1.2.1.33.1.5.3.1.2.$i";
|
||||
$volt_oid = ".1.3.6.1.2.1.33.1.5.3.1.2.$i";
|
||||
$descr = 'Bypass';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
|
||||
@@ -18,25 +18,10 @@ if ($device['os'] == 'sentry3') {
|
||||
$split_oid = explode('.', $oid);
|
||||
$descr = 'Tower '.$index;
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
$oid = '1.3.6.1.4.1.1718.3.2.2.1.11.1.'.$index;
|
||||
$oid = '.1.3.6.1.4.1.1718.3.2.2.1.11.1.'.$index;
|
||||
$current = (snmp_get($device, $oid, '-Oqv') / $divisor);
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'voltage',
|
||||
$device,
|
||||
$oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
$current
|
||||
);
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
}//end if
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
// Supermicro Voltages
|
||||
if ($device['os'] == 'linux') {
|
||||
$oids = snmp_walk($device, '1.3.6.1.4.1.10876.2.1.1.1.1.3', '-OsqnU', 'SUPERMICRO-HEALTH-MIB');
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.10876.2.1.1.1.1.3', '-OsqnU', 'SUPERMICRO-HEALTH-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
@@ -19,11 +19,11 @@ if ($device['os'] == 'linux') {
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
if ($kind == 1) {
|
||||
$volt_oid = '1.3.6.1.4.1.10876.2.1.1.1.1.4.'.$index;
|
||||
$descr_oid = '1.3.6.1.4.1.10876.2.1.1.1.1.2.'.$index;
|
||||
$monitor_oid = '1.3.6.1.4.1.10876.2.1.1.1.1.10.'.$index;
|
||||
$limit_oid = '1.3.6.1.4.1.10876.2.1.1.1.1.5.'.$index;
|
||||
$lowlimit_oid = '1.3.6.1.4.1.10876.2.1.1.1.1.6.'.$index;
|
||||
$volt_oid = '.1.3.6.1.4.1.10876.2.1.1.1.1.4.'.$index;
|
||||
$descr_oid = '.1.3.6.1.4.1.10876.2.1.1.1.1.2.'.$index;
|
||||
$monitor_oid = '.1.3.6.1.4.1.10876.2.1.1.1.1.10.'.$index;
|
||||
$limit_oid = '.1.3.6.1.4.1.10876.2.1.1.1.1.5.'.$index;
|
||||
$lowlimit_oid = '.1.3.6.1.4.1.10876.2.1.1.1.1.6.'.$index;
|
||||
|
||||
$descr = snmp_get($device, $descr_oid, '-Oqv', 'SUPERMICRO-HEALTH-MIB');
|
||||
$current = (snmp_get($device, $volt_oid, '-Oqv', 'SUPERMICRO-HEALTH-MIB') / $divisor);
|
||||
|
||||
@@ -2,83 +2,87 @@
|
||||
|
||||
require_once $config['install_dir'].'/includes/device-groups.inc.php';
|
||||
|
||||
function bulk_sensor_snmpget($device, $sensors)
|
||||
{
|
||||
$oid_per_pdu = get_device_oid_limit($device);
|
||||
$sensors = array_chunk($sensors, $oid_per_pdu);
|
||||
$cache = array();
|
||||
foreach ($sensors as $chunk) {
|
||||
$oids = array_map(function ($data) {
|
||||
return $data['sensor_oid'];
|
||||
}, $chunk);
|
||||
$oids = implode(' ', $oids);
|
||||
$multi_response = snmp_get_multi_oid($device, $oids, '-OUQn');
|
||||
$cache = array_merge($cache, $multi_response);
|
||||
}
|
||||
return $cache;
|
||||
}
|
||||
|
||||
function poll_sensor($device, $class, $unit)
|
||||
{
|
||||
global $config, $memcache, $agent_sensors;
|
||||
|
||||
$sensors = array();
|
||||
$misc_sensors = array();
|
||||
$all_sensors = array();
|
||||
foreach (dbFetchRows('SELECT * FROM `sensors` WHERE `sensor_class` = ? AND `device_id` = ?', array($class, $device['device_id'])) as $sensor) {
|
||||
echo 'Checking ('.$sensor['poller_type'].") $class ".$sensor['sensor_descr'].'... ';
|
||||
$sensor_value = '';
|
||||
if ($sensor['poller_type'] == 'agent') {
|
||||
$misc_sensors[] = $sensor;
|
||||
} elseif ($sensor['poller_type'] == 'ipmi') {
|
||||
$misc_sensors[] = $sensor;
|
||||
} else {
|
||||
$sensors[] = $sensor;
|
||||
}
|
||||
}
|
||||
|
||||
$snmp_data = bulk_sensor_snmpget($device, $sensors);
|
||||
|
||||
foreach ($sensors as $sensor) {
|
||||
echo 'Checking (' . $sensor['poller_type'] . ") $class " . $sensor['sensor_descr'] . '... '.PHP_EOL;
|
||||
|
||||
if ($sensor['poller_type'] == 'snmp') {
|
||||
$mibdir = null;
|
||||
if ($device['os'] == 'pbn') {
|
||||
$mibdir = 'pbn';
|
||||
|
||||
if (file_exists('includes/polling/sensors/'. $class .'/'. $device['os'] .'.inc.php')) {
|
||||
require_once 'includes/polling/sensors/'. $class .'/'. $device['os'] .'.inc.php';
|
||||
}
|
||||
|
||||
$mib = '';
|
||||
if ($device['os'] == 'siklu') {
|
||||
$mib = ':RADIO-BRIDGE-MIB';
|
||||
}
|
||||
$sensor_value = trim(str_replace('"', '', $snmp_data[$sensor['sensor_oid']]));
|
||||
|
||||
if ($class == 'temperature') {
|
||||
if ($device['os'] == 'netapp') {
|
||||
include 'includes/polling/temperatures/netapp.inc.php';
|
||||
} elseif ($device['os'] == 'canopy') {
|
||||
include 'includes/polling/temperatures/canopy.inc.php';
|
||||
} elseif ($device['os'] == 'hytera') {
|
||||
require_once 'includes/polling/temperatures/hytera.inc.php';
|
||||
} else {
|
||||
// Try 5 times to get a valid temp reading
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
d_echo("Attempt $i ");
|
||||
|
||||
$sensor_value = trim(str_replace('"', '', snmp_get($device, $sensor['sensor_oid'], '-OUqnv', "SNMPv2-MIB$mib", $mibdir)));
|
||||
preg_match('/[\d\.]+/', $sensor_value, $temp_response);
|
||||
if (!empty($temp_response[0])) {
|
||||
$sensor_value = $temp_response[0];
|
||||
}
|
||||
|
||||
if (is_numeric($sensor_value) && $sensor_value != 9999) {
|
||||
break;
|
||||
// TME sometimes sends 999.9 when it is right in the middle of an update;
|
||||
} sleep(1);
|
||||
// end if
|
||||
}
|
||||
}//end if
|
||||
} elseif ($class == "voltage" && $device['os'] == 'hytera') {
|
||||
require_once "includes/polling/voltages/hytera.inc.php";
|
||||
preg_match('/[\d\.\-]+/', $sensor_value, $temp_response);
|
||||
if (!empty($temp_response[0])) {
|
||||
$sensor_value = $temp_response[0];
|
||||
}
|
||||
} elseif ($class == 'state') {
|
||||
$sensor_value = trim(str_replace('"', '', snmp_walk($device, $sensor['sensor_oid'], '-Oevq', 'SNMPv2-MIB', $mibdir)));
|
||||
if (!is_numeric($sensor_value)) {
|
||||
$state_value = dbFetchCell('SELECT `state_value` FROM `state_translations` LEFT JOIN `sensors_to_state_indexes` ON `state_translations`.`state_index_id` = `sensors_to_state_indexes`.`state_index_id` WHERE `sensors_to_state_indexes`.`sensor_id` = ? AND `state_translations`.`state_descr` LIKE ?', array($sensor['sensor_id'], $sensor_value));
|
||||
$state_value = dbFetchCell(
|
||||
'SELECT `state_value`
|
||||
FROM `state_translations` LEFT JOIN `sensors_to_state_indexes`
|
||||
ON `state_translations`.`state_index_id` = `sensors_to_state_indexes`.`state_index_id`
|
||||
WHERE `sensors_to_state_indexes`.`sensor_id` = ?
|
||||
AND `state_translations`.`state_descr` LIKE ?',
|
||||
array($sensor['sensor_id'], $sensor_value)
|
||||
);
|
||||
d_echo('State value of ' . $sensor_value . ' is ' . $state_value . "\n");
|
||||
if (is_numeric($state_value)) {
|
||||
$sensor_value = $state_value;
|
||||
}
|
||||
}
|
||||
} elseif ($class == 'signal') {
|
||||
$currentOS = $device['os'];
|
||||
include "includes/polling/signal/$currentOS.inc.php";
|
||||
$sensor_value = trim(str_replace('"', '', snmp_get($device, $sensor['sensor_oid'], '-OUqnv', "SNMPv2-MIB$mib", $mibdir)));
|
||||
} elseif ($class == 'dbm') {
|
||||
$sensor_value = trim(str_replace('"', '', snmp_get($device, $sensor['sensor_oid'], '-OUqnv', "SNMPv2-MIB$mib", $mibdir)));
|
||||
//iosxr does not expose dbm values through SNMP so we convert Watts to dbm to have a nice graph to show
|
||||
if ($device['os'] == "iosxr") {
|
||||
$sensor_value = round(10*log10($sensor_value/1000), 3);
|
||||
}
|
||||
} else {
|
||||
if ($sensor['sensor_type'] == 'apc') {
|
||||
$sensor_value = trim(str_replace('"', '', snmp_walk($device, $sensor['sensor_oid'], '-OUqnvt', "SNMPv2-MIB:PowerNet-MIB$mib", $mibdir)));
|
||||
} else {
|
||||
$sensor_value = trim(str_replace('"', '', snmp_get($device, $sensor['sensor_oid'], '-OUqnvt', "SNMPv2-MIB$mib", $mibdir)));
|
||||
}
|
||||
}//end if
|
||||
unset($mib);
|
||||
unset($mibdir);
|
||||
} elseif ($sensor['poller_type'] == 'agent') {
|
||||
$sensor['new_value'] = $sensor_value;
|
||||
$all_sensors[] = $sensor;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($misc_sensors as $sensor) {
|
||||
if ($sensor['poller_type'] == 'agent') {
|
||||
if (isset($agent_sensors)) {
|
||||
$sensor_value = $agent_sensors[$class][$sensor['sensor_type']][$sensor['sensor_index']]['current'];
|
||||
$sensor['new_value'] = $sensor_value;
|
||||
$all_sensors[] = $sensor;
|
||||
} else {
|
||||
echo "no agent data!\n";
|
||||
continue;
|
||||
@@ -91,7 +95,10 @@ function poll_sensor($device, $class, $unit)
|
||||
echo "unknown poller type!\n";
|
||||
continue;
|
||||
}//end if
|
||||
}
|
||||
|
||||
foreach ($all_sensors as $sensor) {
|
||||
$sensor_value = $sensor['new_value'];
|
||||
if ($sensor_value == -32768) {
|
||||
echo 'Invalid (-32768) ';
|
||||
$sensor_value = 0;
|
||||
@@ -132,13 +139,11 @@ function poll_sensor($device, $class, $unit)
|
||||
echo 'Alerting for '.$device['hostname'].' '.$sensor['sensor_descr']."\n";
|
||||
log_event(ucfirst($class).' '.$sensor['sensor_descr'].' above threshold: '.$sensor_value." $unit (> ".$sensor['sensor_limit']." $unit)", $device, $class, $sensor['sensor_id']);
|
||||
}
|
||||
|
||||
if ($sensor['sensor_class'] == 'state' && $sensor['sensor_current'] != $sensor_value) {
|
||||
log_event($class . ' sensor has changed from ' . $sensor['sensor_current'] . ' to ' . $sensor_value, $device, $class, $sensor['sensor_id']);
|
||||
}
|
||||
|
||||
dbUpdate(array('sensor_current' => $sensor_value, 'sensor_prev' => $sensor['sensor_current'], 'lastupdate' => array('NOW()')), 'sensors', '`sensor_class` = ? AND `sensor_id` = ?', array($class,$sensor['sensor_id']));
|
||||
}//end foreach
|
||||
}
|
||||
}//end poll_sensor()
|
||||
|
||||
|
||||
@@ -148,6 +153,7 @@ function poll_device($device, $options)
|
||||
|
||||
$attribs = get_dev_attribs($device['device_id']);
|
||||
$device['snmp_max_repeaters'] = $attribs['snmp_max_repeaters'];
|
||||
$device['snmp_max_oid'] = $attribs['snmp_max_oid'];
|
||||
|
||||
$status = 0;
|
||||
unset($array);
|
||||
@@ -505,3 +511,22 @@ function location_to_latlng($device)
|
||||
}
|
||||
}
|
||||
}// end location_to_latlng()
|
||||
|
||||
/**
|
||||
* @param $device
|
||||
* @return int|null
|
||||
*/
|
||||
function get_device_oid_limit($device)
|
||||
{
|
||||
global $config;
|
||||
|
||||
$max_oid = $device['snmp_max_oid'];
|
||||
|
||||
if (isset($max_oid) && $max_oid > 0) {
|
||||
return $max_oid;
|
||||
} elseif (isset($config['snmp']['max_oid']) && $config['snmp']['max_oid'] > 0) {
|
||||
return $config['snmp']['max_oid'];
|
||||
} else {
|
||||
return 10;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
$sensor_value = round(10 * log10($sensor_value / 1000), 3);
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
$sensor_value = hytera_h2f(str_replace("\"", "", $sensor_value), 2);
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
$sensor_value = trim(str_replace('"', '', snmp_get($device, $sensor['sensor_oid'], '-OUqnv', '')));
|
||||
preg_match_all('/([0-9]+C)+/', $sensor_value, $temps);
|
||||
list(,$index) = explode('.', $sensor['sensor_index']);
|
||||
$sensor_value = $temps[0][$index];
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
$sensor_value = hytera_h2f(str_replace("\"", "", $sensor_value), 2);
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
$cambium_type = snmp_get($device, 'sysDescr.0', '-Oqv', '');
|
||||
$is_epmp = snmp_get($device, 'sysObjectID.0', '-Oqv', '');
|
||||
if (strstr($cambium_type, 'Cambium PTP 50650')) {
|
||||
$mib = ':CAMBIUM-PTP650-MIB';
|
||||
} elseif (strstr($cambium_type, 'PTP250')) {
|
||||
$mib = ':CAMBIUM-PTP250-MIB';
|
||||
} elseif (strstr($is_epmp, '.17713.21')) {
|
||||
$epmp_ap = snmp_get($device, 'wirelessInterfaceMode.0', '-Oqv', 'CAMBIUM-PMP80211-MIB');
|
||||
$epmp_number = snmp_get($device, 'cambiumSubModeType.0', '-Oqv', 'CAMBIUM-PMP80211-MIB');
|
||||
if ($epmp_ap == 1) {
|
||||
if ($epmp_number != 1) {
|
||||
$mib = ':CAMBIUM-PMP80211-MIB';
|
||||
}
|
||||
} else {
|
||||
$mib = ':CAMBIUM-PMP80211-MIB';
|
||||
}
|
||||
} else {
|
||||
$mib = ':WHISP-BOX-MIBV2-MIB';
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
$cambium_type = snmp_get($device, 'sysDescr.0', '-Oqv', '');
|
||||
if (strstr($cambium_type, 'BHUL450-DES') || stristr($cambium_type, 'BHUL450-AES')) {
|
||||
$masterSlaveMode = snmp_get($device, 'bhTimingMode.0', '-Oqv', 'WHISP-BOX-MIBV2-MIB');
|
||||
if ($masterSlaveMode == "timingMaster") {
|
||||
$mib = ':WHISP-APS-MIB';
|
||||
} else {
|
||||
$mib = ':WHISP-SM-MIB';
|
||||
}
|
||||
} elseif (strstr($cambium_type, 'BHUL') || stristr($cambium_type, 'BH')) {
|
||||
$masterSlaveMode = snmp_get($device, 'bhTimingMode.0', '-Oqv', 'WHISP-BOX-MIBV2-MIB');
|
||||
if ($masterSlaveMode == "timingMaster") {
|
||||
$mib = ':WHISP-APS-MIB';
|
||||
} else {
|
||||
$mib = ':WHISP-BOX-MIBV2-MIB';
|
||||
}
|
||||
} else {
|
||||
$mib = ':WHISP-BOX-MIBV2-MIB';
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
|
||||
$sensor_value = trim(str_replace('"', '', snmp_get($device, $sensor['sensor_oid'], '-OUqnv', "SNMPv2-MIB:WHISP-BOX-MIBV2-MIB")));
|
||||
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
|
||||
$sensor_value = hytera_h2f(str_replace("\"", "", snmp_get($device, $sensor['sensor_oid'], "-OUqnv", "")), 2);
|
||||
@@ -1,4 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
$sensor_value = hytera_h2f(str_replace("\"", "", snmp_get($device, $sensor['sensor_oid'], "-OUqnv", "")), 2);
|
||||
@@ -175,6 +175,30 @@ function snmp_get_multi($device, $oids, $options = '-OQUs', $mib = null, $mibdir
|
||||
return $array;
|
||||
}//end snmp_get_multi()
|
||||
|
||||
function snmp_get_multi_oid($device, $oids, $options = '-OUQn', $mib = null, $mibdir = null)
|
||||
{
|
||||
global $runtime_stats;
|
||||
|
||||
if (is_array($oids)) {
|
||||
$oids = implode(' ', $oids);
|
||||
}
|
||||
|
||||
$cmd = gen_snmpget_cmd($device, $oids, $options, $mib, $mibdir);
|
||||
$data = trim(external_exec($cmd));
|
||||
|
||||
$runtime_stats['snmpget']++;
|
||||
$array = array();
|
||||
foreach (explode("\n", $data) as $entry) {
|
||||
list($oid,$value) = explode('=', $entry, 2);
|
||||
$oid = trim($oid);
|
||||
$value = trim($value);
|
||||
if (!strstr($value, 'at this OID') && isset($oid)) {
|
||||
$array[$oid] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $array;
|
||||
}//end snmp_get_multi_oid()
|
||||
|
||||
function snmp_get($device, $oid, $options = null, $mib = null, $mibdir = null)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, '1.3.6.1.', '.1.3.6.1.') WHERE `sensor_oid` LIKE '1.3.6.1.%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'GAMATRONIC-MIB::gamatronicLTD', '.1.3.6.1.4.1.6050') WHERE `sensor_oid` LIKE 'GAMATRONIC-MIB::gamatronicLTD%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'NMS-IF-MIB::curr', '.1.3.6.1.4.1.11606.10.9.63.1.7.1.6') WHERE `sensor_oid` LIKE 'NMS-IF-MIB::curr%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'NMS-IF-MIB::rxPower', '.1.3.6.1.4.1.11606.10.9.63.1.7.1.3') WHERE `sensor_oid` LIKE 'NMS-IF-MIB::rxPower%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'NMS-IF-MIB::txPower', '.1.3.6.1.4.1.11606.10.9.63.1.7.1.2') WHERE `sensor_oid` LIKE 'NMS-IF-MIB::txPower%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'ifSfpParameterTable', '.1.3.6.1.4.1.11606.10.9.63.1.7') WHERE `sensor_oid` LIKE 'ifSfpParameterTable%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'PowerNet-MIB::upsAdvBatteryRunTimeRemaining', '.1.3.6.1.4.1.318.1.1.1.2.2.3') WHERE `sensor_oid` LIKE 'PowerNet-MIB::upsAdvBatteryRunTimeRemaining%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'receivePower', '.1.3.6.1.4.1.17713.7.12.2') WHERE `sensor_oid` LIKE 'receivePower%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'cambiumSTADLRSSI', '.1.3.6.1.4.1.17713.21.1.2.3') WHERE `sensor_oid` LIKE 'cambiumSTADLRSSI%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'lastPowerLevel', '.1.3.6.1.4.1.17713.21.1.2.3') WHERE `sensor_oid` LIKE 'lastPowerLevel%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'radioDbmInt', '.1.3.6.1.4.1.161.19.3.2.2.21') WHERE `sensor_oid` LIKE 'radioDbmInt%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'airIRRCUnitStatusRackInletTempMetric', '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.7') WHERE `sensor_oid` LIKE 'airIRRCUnitStatusRackInletTempMetric%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'airIRRCUnitStatusSupplyAirTempMetric', '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.9') WHERE `sensor_oid` LIKE 'airIRRCUnitStatusSupplyAirTempMetric%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'airIRRCUnitStatusReturnAirTempMetric', '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.11') WHERE `sensor_oid` LIKE 'airIRRCUnitStatusReturnAirTempMetric%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'airIRRCUnitStatusEnteringFluidTemperatureMetric', '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.24') WHERE `sensor_oid` LIKE 'airIRRCUnitStatusEnteringFluidTemperatureMetric%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'airIRRCUnitStatusLeavingFluidTemperatureMetric', '.1.3.6.1.4.1.318.1.1.13.3.2.2.2.26') WHERE `sensor_oid` LIKE 'airIRRCUnitStatusLeavingFluidTemperatureMetric%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'boxTemperatureC', '.1.3.6.1.4.1.161.19.3.3.1.35') WHERE `sensor_oid` LIKE 'boxTemperatureC%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'NMS-IF-MIB::temperature', '.1.3.6.1.4.1.11606.10.9.63.1.7.1.44') WHERE `sensor_oid` LIKE 'NMS-IF-MIB::temperature%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'systemTemperature', '.1.3.6.1.4.1.17163.1.1.2.9') WHERE `sensor_oid` LIKE 'systemTemperature%';
|
||||
UPDATE `sensors` SET `sensor_oid` = REPLACE(`sensor_oid`, 'rbSysTemperature', '.1.3.6.1.4.1.31926.1.2') WHERE `sensor_oid` LIKE 'rbSysTemperature%';
|
||||
Reference in New Issue
Block a user