mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
refactor: Tidy up sensor discovery (#5550)
* refactor: Tidy up sensor discovery * more files * removed uneeded files * updated array check * updates for linux/supermicro * small changes * Update linux.inc.php * Add supermicro temps back to linux.inc.php * No need for is_file on rfc1628.inc.php, it exists * Revert rfc1628 change * Fix whitespace... * rebased * fixed $valid data not being passed to new sensors() function
This commit is contained in:
committed by
Tony Murray
parent
008af4cea0
commit
d4e8c54516
@@ -955,3 +955,33 @@ function ignore_storage($descr)
|
||||
|
||||
return $deny;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $types
|
||||
* @param $device
|
||||
* @param array $pre_cache
|
||||
*/
|
||||
function sensors($types, $device, $valid, $pre_cache = array())
|
||||
{
|
||||
global $config;
|
||||
foreach ((array)$types as $type) {
|
||||
echo ucfirst($type) . ': ';
|
||||
|
||||
$dir = $config['install_dir'] . '/includes/discovery/sensors/' . $type .'/';
|
||||
|
||||
if (is_file($dir . $device['os_group'] . '.inc.php')) {
|
||||
include_once $dir . $device['os_group'] . '.inc.php';
|
||||
}
|
||||
if (is_file($dir . $device['os'] . '.inc.php')) {
|
||||
include_once $dir . $device['os'] . '.inc.php';
|
||||
}
|
||||
if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modules_compat']['rfc1628'][$device['os']]) {
|
||||
if (is_file($dir . '/rfc1628.inc.php')) {
|
||||
include_once $dir . '/rfc1628.inc.php';
|
||||
}
|
||||
}
|
||||
d_echo($valid['sensor'][$type]);
|
||||
check_valid_sensors($device, $type, $valid['sensor']);
|
||||
echo "\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ $valid['sensor'] = array();
|
||||
// Pre-cache data for later use
|
||||
require 'includes/discovery/sensors/pre-cache.inc.php';
|
||||
|
||||
// Run custom sensors
|
||||
require 'includes/discovery/sensors/cisco-entity-sensor.inc.php';
|
||||
require 'includes/discovery/sensors/entity-sensor.inc.php';
|
||||
require 'includes/discovery/sensors/ipmi.inc.php';
|
||||
@@ -17,17 +18,27 @@ if ($device['os'] == 'openbsd') {
|
||||
include 'includes/discovery/sensors/openbsd.inc.php';
|
||||
}
|
||||
|
||||
require 'includes/discovery/sensors/temperatures.inc.php';
|
||||
require 'includes/discovery/sensors/humidity.inc.php';
|
||||
require 'includes/discovery/sensors/voltages.inc.php';
|
||||
require 'includes/discovery/sensors/frequencies.inc.php';
|
||||
require 'includes/discovery/sensors/runtime.inc.php';
|
||||
require 'includes/discovery/sensors/current.inc.php';
|
||||
require 'includes/discovery/sensors/power.inc.php';
|
||||
require 'includes/discovery/sensors/fanspeeds.inc.php';
|
||||
require 'includes/discovery/sensors/charge.inc.php';
|
||||
require 'includes/discovery/sensors/load.inc.php';
|
||||
require 'includes/discovery/sensors/states.inc.php';
|
||||
require 'includes/discovery/sensors/dbm.inc.php';
|
||||
require 'includes/discovery/sensors/signal.inc.php';
|
||||
require 'includes/discovery/sensors/airflow.inc.php';
|
||||
if (strstr($device['hardware'], 'Dell')) {
|
||||
include 'includes/discovery/sensors/fanspeeds/dell.inc.php';
|
||||
include 'includes/discovery/sensors/states/dell.inc.php';
|
||||
include 'includes/discovery/sensors/temperatures/dell.inc.php';
|
||||
}
|
||||
|
||||
$run_sensors = array(
|
||||
'airflow',
|
||||
'current',
|
||||
'charge',
|
||||
'dbm',
|
||||
'fanspeeds',
|
||||
'frequencies',
|
||||
'humidity',
|
||||
'load',
|
||||
'power',
|
||||
'runtime',
|
||||
'signal',
|
||||
'states',
|
||||
'temperatures',
|
||||
'voltages',
|
||||
);
|
||||
sensors($run_sensors, $device, $valid, $pre_cache);
|
||||
unset($pre_cache);
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* airflow.inc.php
|
||||
*
|
||||
* LibreNMS airflow module for discovery
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2016 Neil Lathwood
|
||||
* @author Neil Lathwood <[email protected]>
|
||||
*/
|
||||
|
||||
echo 'Airflow: ';
|
||||
|
||||
// Include all discovery modules
|
||||
$include_dir = 'includes/discovery/sensors/airflow';
|
||||
require 'includes/include-dir.inc.php';
|
||||
|
||||
d_echo($valid['sensor']['airflow']);
|
||||
|
||||
check_valid_sensors($device, 'airflow', $valid['sensor']);
|
||||
|
||||
echo "\n";
|
||||
@@ -23,7 +23,7 @@
|
||||
* @author Neil Lathwood <[email protected]>
|
||||
*/
|
||||
|
||||
foreach ($cooling_unit_analog as $index => $data) {
|
||||
foreach ($pre_cache['cooling_unit_analog'] as $index => $data) {
|
||||
$cur_oid = '.1.3.6.1.4.1.318.1.1.27.1.4.1.2.1.3.' . $index;
|
||||
$descr = $data['coolingUnitStatusAnalogDescription'];
|
||||
$scale = $data['coolingUnitStatusAnalogScale'];
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
echo 'Battery Charge: ';
|
||||
|
||||
// Include all discovery modules
|
||||
$include_dir = 'includes/discovery/sensors/charge';
|
||||
require 'includes/include-dir.inc.php';
|
||||
|
||||
d_echo($valid['sensor']['charge']);
|
||||
|
||||
check_valid_sensors($device, 'charge', $valid['sensor']);
|
||||
|
||||
echo "\n";
|
||||
@@ -1,47 +1,45 @@
|
||||
<?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
|
||||
if (!empty($oids)) {
|
||||
echo 'APC UPS Battery Charge High Precision';
|
||||
$type = 'apc';
|
||||
list($oid,$current) = explode(' ', $oids);
|
||||
|
||||
$precision = 10;
|
||||
$sensorType = 'apc';
|
||||
$current_oid = '.1.3.6.1.4.1.318.1.1.1.2.3.1.0';
|
||||
$index = 0;
|
||||
$current_val = ($current / $precision);
|
||||
$limit = 100;
|
||||
$lowlimit = 0;
|
||||
$warnlimit = 10;
|
||||
$descr = 'Battery Charge';
|
||||
|
||||
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');
|
||||
d_echo($oids."\n");
|
||||
|
||||
// Try High-Precision First
|
||||
if (!empty($oids)) {
|
||||
echo 'APC UPS Battery Charge High Precision';
|
||||
echo 'APC UPS Battery Charge';
|
||||
$type = 'apc';
|
||||
list($oid,$current) = explode(' ', $oids);
|
||||
|
||||
$precision = 10;
|
||||
$precision = 1;
|
||||
$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.2.1.0';
|
||||
$index = 0;
|
||||
$current_val = ($current / $precision);
|
||||
$current_val = $current;
|
||||
$limit = 100;
|
||||
$lowlimit = 0;
|
||||
$warnlimit = 10;
|
||||
$descr = 'Battery Charge';
|
||||
|
||||
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', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if (!empty($oids)) {
|
||||
echo 'APC UPS Battery Charge';
|
||||
$type = 'apc';
|
||||
list($oid,$current) = explode(' ', $oids);
|
||||
|
||||
$precision = 1;
|
||||
$sensorType = 'apc';
|
||||
$current_oid = '.1.3.6.1.4.1.318.1.1.1.2.2.1.0';
|
||||
$index = 0;
|
||||
$current_val = $current;
|
||||
$limit = 100;
|
||||
$lowlimit = 0;
|
||||
$warnlimit = 10;
|
||||
$descr = 'Battery Charge';
|
||||
|
||||
discover_sensor($valid['sensor'], 'charge', $device, $current_oid, $index, $sensorType, $descr, $precision, '1', $lowlimit, $warnlimit, null, $limit, $current_val);
|
||||
}
|
||||
}//end if
|
||||
}
|
||||
}//end if
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2015 Steve Calvário <https://github.com/Calvario/>
|
||||
* Copyright (c) 2015 Steve Calv�rio <https://github.com/Calvario/>
|
||||
*
|
||||
* 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
|
||||
@@ -12,21 +11,19 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'dsm') {
|
||||
echo 'DSM UPS Charge';
|
||||
echo 'DSM UPS Charge';
|
||||
|
||||
// UPS Device Manufacturer, example return : SNMPv2-SMI::enterprises.6574.4.1.2.0 = STRING: "American Power Conversion"
|
||||
$ups_device_manufacturer_oid = '.1.3.6.1.4.1.6574.4.1.2.0';
|
||||
$ups_device_manufacturer = str_replace('"', '', snmp_get($device, $ups_device_manufacturer_oid, '-Oqv'));
|
||||
// UPS Device Model, example return : SNMPv2-SMI::enterprises.6574.4.1.1.0 = STRING: "Back-UPS RS 900G"
|
||||
$ups_device_model_oid = '.1.3.6.1.4.1.6574.4.1.1.0';
|
||||
$ups_device_model = str_replace('"', '', snmp_get($device, $ups_device_model_oid, '-Oqv'));
|
||||
// UPS Device Manufacturer, example return : SNMPv2-SMI::enterprises.6574.4.1.2.0 = STRING: "American Power Conversion"
|
||||
$ups_device_manufacturer_oid = '.1.3.6.1.4.1.6574.4.1.2.0';
|
||||
$ups_device_manufacturer = str_replace('"', '', snmp_get($device, $ups_device_manufacturer_oid, '-Oqv'));
|
||||
// UPS Device Model, example return : SNMPv2-SMI::enterprises.6574.4.1.1.0 = STRING: "Back-UPS RS 900G"
|
||||
$ups_device_model_oid = '.1.3.6.1.4.1.6574.4.1.1.0';
|
||||
$ups_device_model = str_replace('"', '', snmp_get($device, $ups_device_model_oid, '-Oqv'));
|
||||
|
||||
|
||||
// UPS Battery Charge Value, example return : SNMPv2-SMI::enterprises.6574.4.3.1.1.0 = Opaque: Float: 100.000000
|
||||
$ups_charge_oid = '.1.3.6.1.4.1.6574.4.3.1.1.0';
|
||||
$ups_charge = snmp_get($device, $ups_charge_oid, '-Oqv');
|
||||
if (is_numeric($ups_charge)) {
|
||||
discover_sensor($valid['sensor'], 'charge', $device, $ups_charge_oid, 'UPSChargeValue', $ups_device_manufacturer.' '.$ups_device_model, 'UPS Charge Value', '1', '1', 0, 10, null, 100, $ups_charge);
|
||||
}
|
||||
// UPS Battery Charge Value, example return : SNMPv2-SMI::enterprises.6574.4.3.1.1.0 = Opaque: Float: 100.000000
|
||||
$ups_charge_oid = '.1.3.6.1.4.1.6574.4.3.1.1.0';
|
||||
$ups_charge = snmp_get($device, $ups_charge_oid, '-Oqv');
|
||||
if (is_numeric($ups_charge)) {
|
||||
discover_sensor($valid['sensor'], 'charge', $device, $ups_charge_oid, 'UPSChargeValue', $ups_device_manufacturer.' '.$ups_device_model, 'UPS Charge Value', '1', '1', 0, 10, null, 100, $ups_charge);
|
||||
}
|
||||
|
||||
@@ -23,34 +23,32 @@
|
||||
* @author Tony Murray <[email protected]>
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'netagent2') {
|
||||
$charge_oid = '.1.3.6.1.4.1.935.1.1.1.2.2.1.0';
|
||||
$charge = snmp_get($device, $charge_oid, '-Osqnv');
|
||||
$charge_oid = '.1.3.6.1.4.1.935.1.1.1.2.2.1.0';
|
||||
$charge = snmp_get($device, $charge_oid, '-Osqnv');
|
||||
|
||||
if (!empty($charge)) {
|
||||
$type = 'netagent2';
|
||||
$index = 0;
|
||||
$limit = 100;
|
||||
$lowlimit = 0;
|
||||
$lowwarnlimit = 10;
|
||||
$divisor = 1;
|
||||
$descr = 'Battery Charge';
|
||||
if (!empty($charge)) {
|
||||
$type = 'netagent2';
|
||||
$index = 0;
|
||||
$limit = 100;
|
||||
$lowlimit = 0;
|
||||
$lowwarnlimit = 10;
|
||||
$divisor = 1;
|
||||
$descr = 'Battery Charge';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'charge',
|
||||
$device,
|
||||
$charge_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
1,
|
||||
$lowlimit,
|
||||
$lowwarnlimit,
|
||||
null,
|
||||
$limit,
|
||||
$charge
|
||||
);
|
||||
}
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'charge',
|
||||
$device,
|
||||
$charge_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
1,
|
||||
$lowlimit,
|
||||
$lowwarnlimit,
|
||||
null,
|
||||
$limit,
|
||||
$charge
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,26 +1,24 @@
|
||||
<?php
|
||||
|
||||
// RFC1628 UPS
|
||||
if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modules_compat']['rfc1628'][$device['os']]) {
|
||||
echo 'RFC1628 ';
|
||||
echo 'RFC1628 ';
|
||||
|
||||
$oids = snmp_walk($device, '.1.3.6.1.2.1.33.1.2.4', '-Osqn', 'UPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
$oids = snmp_walk($device, '.1.3.6.1.2.1.33.1.2.4', '-Osqn', 'UPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
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 = snmp_get($device, $current_oid, '-O vq');
|
||||
$descr = 'Battery charge remaining'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($current_id + 1));
|
||||
$type = 'rfc1628';
|
||||
$index = (500 + $current_id);
|
||||
$oids = trim($oids);
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
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 = snmp_get($device, $current_oid, '-O vq');
|
||||
$descr = 'Battery charge remaining'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($current_id + 1));
|
||||
$type = 'rfc1628';
|
||||
$index = (500 + $current_id);
|
||||
|
||||
discover_sensor($valid['sensor'], 'charge', $device, $current_oid, $index, $type, $descr, '1', '1', null, null, null, null, $current);
|
||||
}
|
||||
discover_sensor($valid['sensor'], 'charge', $device, $current_oid, $index, $type, $descr, '1', '1', null, null, null, null, $current);
|
||||
}
|
||||
}//end if
|
||||
}
|
||||
|
||||
@@ -23,33 +23,31 @@
|
||||
* @author Tony Murray <[email protected]>
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'sinetica') {
|
||||
$charge_oid = '.1.3.6.1.4.1.13891.101.2.4.0';
|
||||
$charge = snmp_get($device, $charge_oid, '-Osqnv');
|
||||
$charge_oid = '.1.3.6.1.4.1.13891.101.2.4.0';
|
||||
$charge = snmp_get($device, $charge_oid, '-Osqnv');
|
||||
|
||||
if (!empty($charge)) {
|
||||
$type = 'sinetica';
|
||||
$index = 0;
|
||||
$limit = 100;
|
||||
$lowlimit = 0;
|
||||
$lowwarnlimit = 10;
|
||||
$descr = 'Battery Charge';
|
||||
if (!empty($charge)) {
|
||||
$type = 'sinetica';
|
||||
$index = 0;
|
||||
$limit = 100;
|
||||
$lowlimit = 0;
|
||||
$lowwarnlimit = 10;
|
||||
$descr = 'Battery Charge';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'charge',
|
||||
$device,
|
||||
$charge_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
1,
|
||||
1,
|
||||
$lowlimit,
|
||||
$lowwarnlimit,
|
||||
null,
|
||||
$limit,
|
||||
$charge
|
||||
);
|
||||
}
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'charge',
|
||||
$device,
|
||||
$charge_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
1,
|
||||
1,
|
||||
$lowlimit,
|
||||
$lowwarnlimit,
|
||||
null,
|
||||
$limit,
|
||||
$charge
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
echo 'Current: ';
|
||||
|
||||
// Include all discovery modules
|
||||
$include_dir = 'includes/discovery/sensors/current';
|
||||
require 'includes/include-dir.inc.php';
|
||||
|
||||
d_echo($valid['sensor']['current']);
|
||||
|
||||
check_valid_sensors($device, 'current', $valid['sensor']);
|
||||
|
||||
echo "\n";
|
||||
@@ -1,246 +1,243 @@
|
||||
<?php
|
||||
|
||||
// APC
|
||||
if ($device['os'] == 'apc') {
|
||||
// PDU - Phase
|
||||
$oids = snmp_walk($device, 'rPDUStatusPhaseIndex', '-OsqnU', 'PowerNet-MIB');
|
||||
if (empty($oids)) {
|
||||
$oids = snmp_walk($device, 'rPDULoadPhaseConfigIndex', '-OsqnU', 'PowerNet-MIB');
|
||||
}
|
||||
// PDU - Phase
|
||||
$oids = snmp_walk($device, 'rPDUStatusPhaseIndex', '-OsqnU', 'PowerNet-MIB');
|
||||
if (empty($oids)) {
|
||||
$oids = snmp_walk($device, 'rPDULoadPhaseConfigIndex', '-OsqnU', 'PowerNet-MIB');
|
||||
}
|
||||
|
||||
if ($oids) {
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo 'APC PowerNet-MIB Phase ';
|
||||
}
|
||||
|
||||
$type = 'apc';
|
||||
$precision = '10';
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$kind) = explode(' ', $data);
|
||||
$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;
|
||||
// rPDULoadStatusLoad
|
||||
$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;
|
||||
// rPDULoadPhaseConfigOverloadThreshold
|
||||
$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;
|
||||
// rPDULoadPhaseConfigNearOverloadThreshold
|
||||
$phase = snmp_get($device, $phase_oid, '-Oqv', '');
|
||||
$current = (snmp_get($device, $current_oid, '-Oqv', '') / $precision);
|
||||
$limit = snmp_get($device, $limit_oid, '-Oqv', '');
|
||||
// No / $precision here! Nice, APC!
|
||||
$lowlimit = snmp_get($device, $lowlimit_oid, '-Oqv', '');
|
||||
// No / $precision here! Nice, APC!
|
||||
$warnlimit = snmp_get($device, $warnlimit_oid, '-Oqv', '');
|
||||
// No / $precision here! Nice, APC!
|
||||
if (count(explode("\n", $oids)) != 1) {
|
||||
$descr = "Phase $phase";
|
||||
} else {
|
||||
$descr = 'Output';
|
||||
}
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
}
|
||||
}
|
||||
echo 'APC PowerNet-MIB Phase ';
|
||||
}
|
||||
|
||||
unset($oids);
|
||||
$type = 'apc';
|
||||
$precision = '10';
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$kind) = explode(' ', $data);
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
|
||||
// v2 firmware- first bank is total, v3 firmware, 3rd bank is total
|
||||
$bank_count = snmp_get($device, 'rPDULoadDevNumBanks.0', '-Oqv', 'PowerNet-MIB');
|
||||
if ($bank_count > 0) {
|
||||
$oids = snmp_walk($device, 'rPDULoadStatusIndex', '-OsqnU', 'PowerNet-MIB');
|
||||
}
|
||||
// should work with firmware v2 and v3
|
||||
if ($oids) {
|
||||
echo 'APC PowerNet-MIB Banks ';
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
$type = 'apc';
|
||||
$precision = '10';
|
||||
|
||||
// version 2 does some stuff differently- total power is first oid in index instead of the last.
|
||||
// will look something like "AOS v2.6.4 / App v2.6.5"
|
||||
$baseversion = '3';
|
||||
if (stristr($device['version'], 'AOS v2') == true) {
|
||||
$baseversion = '2';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$kind) = explode(' ', $data);
|
||||
$split_oid = explode('.', $oid);
|
||||
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
|
||||
$banknum = ($index - 1);
|
||||
$descr = 'Bank '.$banknum;
|
||||
if ($baseversion == '3') {
|
||||
if ($index == '1') {
|
||||
$descr = 'Bank Total';
|
||||
}
|
||||
}
|
||||
|
||||
if ($baseversion == '2') {
|
||||
if ($index == '1') {
|
||||
$descr = 'Bank Total';
|
||||
}
|
||||
}
|
||||
|
||||
$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;
|
||||
// rPDULoadStatusBankNumber
|
||||
$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;
|
||||
// rPDULoadBankConfigLowLoadThreshold
|
||||
$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);
|
||||
$limit = snmp_get($device, $limit_oid, '-Oqv', '');
|
||||
$lowlimit = snmp_get($device, $lowlimit_oid, '-Oqv', '');
|
||||
$warnlimit = snmp_get($device, $warnlimit_oid, '-Oqv', '');
|
||||
|
||||
if ($limit != -1 && $lowlimit != -1 && $warnlimit != -1) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($baseversion);
|
||||
}
|
||||
|
||||
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');
|
||||
if ($oids) {
|
||||
echo 'APC PowerNet-MIB Outlets ';
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
$type = 'apc';
|
||||
$precision = '10';
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$kind) = explode(' ', $data);
|
||||
$split_oid = explode('.', $oid);
|
||||
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
|
||||
$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;
|
||||
// rPDU2OutletMeteredStatusCurrent
|
||||
$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;
|
||||
// rPDU2OutletMeteredConfigLowLoadCurrentThreshold
|
||||
$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;
|
||||
// rPDU2OutletMeteredStatusName
|
||||
$voltage = snmp_get($device, $voltage_oid, '-Oqv', '');
|
||||
|
||||
$current = (snmp_get($device, $current_oid, '-Oqv', '') / $precision);
|
||||
$limit = (snmp_get($device, $limit_oid, '-Oqv', '') / $voltage);
|
||||
$lowlimit = (snmp_get($device, $lowlimit_oid, '-Oqv', '') / $voltage);
|
||||
$warnlimit = (snmp_get($device, $warnlimit_oid, '-Oqv', '') / $voltage);
|
||||
$descr = 'Outlet '.$index.' - '.snmp_get($device, $name_oid, '-Oqv', '');
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($oids);
|
||||
|
||||
// ATS
|
||||
$oids = snmp_walk($device, 'atsConfigPhaseTableIndex', '-OsqnU', 'PowerNet-MIB');
|
||||
if ($oids) {
|
||||
$type = 'apc';
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
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';
|
||||
// atsOutputCurrent
|
||||
$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';
|
||||
// atsConfigPhaseLowLoadThreshold
|
||||
$warnlimit_oid = '.1.3.6.1.4.1.318.1.1.8.4.16.1.4.1';
|
||||
// atsConfigPhaseNearOverLoadThreshold
|
||||
$index = 1;
|
||||
|
||||
$current = (snmp_get($device, $current_oid, '-Oqv', '') / $precision);
|
||||
$limit = snmp_get($device, $limit_oid, '-Oqv', '');
|
||||
// No / $precision here! Nice, APC!
|
||||
$lowlimit = snmp_get($device, $lowlimit_oid, '-Oqv', '');
|
||||
// No / $precision here! Nice, APC!
|
||||
$warnlimit = snmp_get($device, $warnlimit_oid, '-Oqv', '');
|
||||
// No / $precision here! Nice, APC!
|
||||
$descr = 'Output Feed';
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
}
|
||||
|
||||
unset($oids);
|
||||
|
||||
// UPS
|
||||
$oid_array = array(
|
||||
array(
|
||||
'HighPrecOid' => 'upsHighPrecOutputCurrent',
|
||||
'AdvOid' => 'upsAdvOutputCurrent',
|
||||
'type' => 'apc',
|
||||
'index' => 0,
|
||||
'descr' => 'Current Drawn',
|
||||
'divisor' => 10,
|
||||
'mib' => '+PowerNet-MIB',
|
||||
),
|
||||
);
|
||||
|
||||
foreach ($oid_array as $item) {
|
||||
$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 = '.1.3.6.1.4.1.318.1.1.1.4.2.4';
|
||||
$current = $oids;
|
||||
$item['divisor'] = 1;
|
||||
} else {
|
||||
$current_oid = '.1.3.6.1.4.1.318.1.1.1.4.3.4';
|
||||
$value = explode(" ", $oids);
|
||||
$current = $value[1]/$item['divisor'];
|
||||
}
|
||||
|
||||
if (!empty($oids)) {
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo $item['type'].' '.$item['mib'].' UPS';
|
||||
$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;
|
||||
// rPDULoadStatusPhaseNumber
|
||||
$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;
|
||||
// rPDULoadPhaseConfigLowLoadThreshold
|
||||
$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);
|
||||
$limit = snmp_get($device, $limit_oid, '-Oqv', '');
|
||||
// No / $precision here! Nice, APC!
|
||||
$lowlimit = snmp_get($device, $lowlimit_oid, '-Oqv', '');
|
||||
// No / $precision here! Nice, APC!
|
||||
$warnlimit = snmp_get($device, $warnlimit_oid, '-Oqv', '');
|
||||
// No / $precision here! Nice, APC!
|
||||
if (count(explode("\n", $oids)) != 1) {
|
||||
$descr = "Phase $phase";
|
||||
} else {
|
||||
$descr = 'Output';
|
||||
}
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid.'.'.$item['index'], $current_oid.'.'.$item['index'], $item['type'], $item['descr'], $item['divisor'], 1, null, null, null, null, $current);
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($oids);
|
||||
|
||||
// v2 firmware- first bank is total, v3 firmware, 3rd bank is total
|
||||
$bank_count = snmp_get($device, 'rPDULoadDevNumBanks.0', '-Oqv', 'PowerNet-MIB');
|
||||
if ($bank_count > 0) {
|
||||
$oids = snmp_walk($device, 'rPDULoadStatusIndex', '-OsqnU', 'PowerNet-MIB');
|
||||
}
|
||||
// should work with firmware v2 and v3
|
||||
if ($oids) {
|
||||
echo 'APC PowerNet-MIB Banks ';
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
$type = 'apc';
|
||||
$precision = '10';
|
||||
|
||||
// version 2 does some stuff differently- total power is first oid in index instead of the last.
|
||||
// will look something like "AOS v2.6.4 / App v2.6.5"
|
||||
$baseversion = '3';
|
||||
if (stristr($device['version'], 'AOS v2') == true) {
|
||||
$baseversion = '2';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$kind) = explode(' ', $data);
|
||||
$split_oid = explode('.', $oid);
|
||||
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
|
||||
$banknum = ($index - 1);
|
||||
$descr = 'Bank '.$banknum;
|
||||
if ($baseversion == '3') {
|
||||
if ($index == '1') {
|
||||
$descr = 'Bank Total';
|
||||
}
|
||||
}
|
||||
|
||||
if ($baseversion == '2') {
|
||||
if ($index == '1') {
|
||||
$descr = 'Bank Total';
|
||||
}
|
||||
}
|
||||
|
||||
$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;
|
||||
// rPDULoadStatusBankNumber
|
||||
$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;
|
||||
// rPDULoadBankConfigLowLoadThreshold
|
||||
$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);
|
||||
$limit = snmp_get($device, $limit_oid, '-Oqv', '');
|
||||
$lowlimit = snmp_get($device, $lowlimit_oid, '-Oqv', '');
|
||||
$warnlimit = snmp_get($device, $warnlimit_oid, '-Oqv', '');
|
||||
|
||||
if ($limit != -1 && $lowlimit != -1 && $warnlimit != -1) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($baseversion);
|
||||
}
|
||||
|
||||
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');
|
||||
if ($oids) {
|
||||
echo 'APC PowerNet-MIB Outlets ';
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
$type = 'apc';
|
||||
$precision = '10';
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$kind) = explode(' ', $data);
|
||||
$split_oid = explode('.', $oid);
|
||||
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
|
||||
$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;
|
||||
// rPDU2OutletMeteredStatusCurrent
|
||||
$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;
|
||||
// rPDU2OutletMeteredConfigLowLoadCurrentThreshold
|
||||
$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;
|
||||
// rPDU2OutletMeteredStatusName
|
||||
$voltage = snmp_get($device, $voltage_oid, '-Oqv', '');
|
||||
|
||||
$current = (snmp_get($device, $current_oid, '-Oqv', '') / $precision);
|
||||
$limit = (snmp_get($device, $limit_oid, '-Oqv', '') / $voltage);
|
||||
$lowlimit = (snmp_get($device, $lowlimit_oid, '-Oqv', '') / $voltage);
|
||||
$warnlimit = (snmp_get($device, $warnlimit_oid, '-Oqv', '') / $voltage);
|
||||
$descr = 'Outlet '.$index.' - '.snmp_get($device, $name_oid, '-Oqv', '');
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($oids);
|
||||
|
||||
// ATS
|
||||
$oids = snmp_walk($device, 'atsConfigPhaseTableIndex', '-OsqnU', 'PowerNet-MIB');
|
||||
if ($oids) {
|
||||
$type = 'apc';
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
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';
|
||||
// atsOutputCurrent
|
||||
$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';
|
||||
// atsConfigPhaseLowLoadThreshold
|
||||
$warnlimit_oid = '.1.3.6.1.4.1.318.1.1.8.4.16.1.4.1';
|
||||
// atsConfigPhaseNearOverLoadThreshold
|
||||
$index = 1;
|
||||
|
||||
$current = (snmp_get($device, $current_oid, '-Oqv', '') / $precision);
|
||||
$limit = snmp_get($device, $limit_oid, '-Oqv', '');
|
||||
// No / $precision here! Nice, APC!
|
||||
$lowlimit = snmp_get($device, $lowlimit_oid, '-Oqv', '');
|
||||
// No / $precision here! Nice, APC!
|
||||
$warnlimit = snmp_get($device, $warnlimit_oid, '-Oqv', '');
|
||||
// No / $precision here! Nice, APC!
|
||||
$descr = 'Output Feed';
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, $warnlimit, $limit, $current);
|
||||
}
|
||||
|
||||
unset($oids);
|
||||
|
||||
// UPS
|
||||
$oid_array = array(
|
||||
array(
|
||||
'HighPrecOid' => 'upsHighPrecOutputCurrent',
|
||||
'AdvOid' => 'upsAdvOutputCurrent',
|
||||
'type' => 'apc',
|
||||
'index' => 0,
|
||||
'descr' => 'Current Drawn',
|
||||
'divisor' => 10,
|
||||
'mib' => '+PowerNet-MIB',
|
||||
),
|
||||
);
|
||||
|
||||
foreach ($oid_array as $item) {
|
||||
$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 = '.1.3.6.1.4.1.318.1.1.1.4.2.4';
|
||||
$current = $oids;
|
||||
$item['divisor'] = 1;
|
||||
} else {
|
||||
$current_oid = '.1.3.6.1.4.1.318.1.1.1.4.3.4';
|
||||
$value = explode(" ", $oids);
|
||||
$current = $value[1]/$item['divisor'];
|
||||
}
|
||||
|
||||
if (!empty($oids)) {
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo $item['type'].' '.$item['mib'].' UPS';
|
||||
}
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid.'.'.$item['index'], $current_oid.'.'.$item['index'], $item['type'], $item['descr'], $item['divisor'], 1, null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,30 +10,28 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'comware') {
|
||||
echo 'Comware ';
|
||||
echo 'Comware ';
|
||||
|
||||
$multiplier = 1;
|
||||
$divisor = 100000;
|
||||
$divisor_alarm = 1000000;
|
||||
foreach ($comware_oids as $index => $entry) {
|
||||
if (is_numeric($entry['hh3cTransceiverBiasCurrent']) && $entry['hh3cTransceiverBiasCurrent'] != 2147483647) {
|
||||
$oid = '.1.3.6.1.4.1.25506.2.70.1.1.1.17.' . $index;
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", array(
|
||||
$index,
|
||||
$device['device_id']
|
||||
));
|
||||
$limit_low = $entry['hh3cTransceiverBiasLoAlarm'] / $divisor_alarm;
|
||||
$warn_limit_low = $entry['hh3cTransceiverBiasLoWarn'] / $divisor_alarm;
|
||||
$limit = $entry['hh3cTransceiverBiasHiAlarm'] / $divisor_alarm;
|
||||
$warn_limit = $entry['hh3cTransceiverBiasHiWarn'] / $divisor_alarm;
|
||||
$current = $entry['hh3cTransceiverBiasCurrent'] / $divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
foreach ($dbquery as $dbindex => $dbresult) {
|
||||
$descr = $dbresult['ifDescr'] . ' Bias Current';
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, 'bias-' . $index, 'comware', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
$multiplier = 1;
|
||||
$divisor = 100000;
|
||||
$divisor_alarm = 1000000;
|
||||
foreach ($pre_cache['comware_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['hh3cTransceiverBiasCurrent']) && $entry['hh3cTransceiverBiasCurrent'] != 2147483647) {
|
||||
$oid = '.1.3.6.1.4.1.25506.2.70.1.1.1.17.' . $index;
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", array(
|
||||
$index,
|
||||
$device['device_id']
|
||||
));
|
||||
$limit_low = $entry['hh3cTransceiverBiasLoAlarm'] / $divisor_alarm;
|
||||
$warn_limit_low = $entry['hh3cTransceiverBiasLoWarn'] / $divisor_alarm;
|
||||
$limit = $entry['hh3cTransceiverBiasHiAlarm'] / $divisor_alarm;
|
||||
$warn_limit = $entry['hh3cTransceiverBiasHiWarn'] / $divisor_alarm;
|
||||
$current = $entry['hh3cTransceiverBiasCurrent'] / $divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
foreach ($dbquery as $dbindex => $dbresult) {
|
||||
$descr = $dbresult['ifDescr'] . ' Bias Current';
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, 'bias-' . $index, 'comware', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,14 +10,12 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'eatonpdu') {
|
||||
$data = snmpwalk_cache_multi_oid($device, 'outletCurrent', array(), 'EATON-EPDU-MIB');
|
||||
$descr = snmpwalk_cache_multi_oid($device, 'outletName', array(), 'EATON-EPDU-MIB');
|
||||
if (is_array($data)) {
|
||||
$cur_oid = '.1.3.6.1.4.1.534.6.6.7.6.4.1.3.';
|
||||
foreach ($data as $index => $entry) {
|
||||
$i++;
|
||||
discover_sensor($valid['sensor'], 'current', $device, $cur_oid.$index, $i, 'eatonpdu', $descr[$index]['outletName'], '1000', '1', null, null, null, null, $data[$index]['outletCurrent'], 'snmp', $index);
|
||||
}
|
||||
$data = snmpwalk_cache_multi_oid($device, 'outletCurrent', array(), 'EATON-EPDU-MIB');
|
||||
$descr = snmpwalk_cache_multi_oid($device, 'outletName', array(), 'EATON-EPDU-MIB');
|
||||
if (is_array($data)) {
|
||||
$cur_oid = '.1.3.6.1.4.1.534.6.6.7.6.4.1.3.';
|
||||
foreach ($data as $index => $entry) {
|
||||
$i++;
|
||||
discover_sensor($valid['sensor'], 'current', $device, $cur_oid.$index, $i, 'eatonpdu', $descr[$index]['outletName'], '1000', '1', null, null, null, null, $data[$index]['outletCurrent'], 'snmp', $index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,51 +1,48 @@
|
||||
<?php
|
||||
|
||||
// XUPS-MIB
|
||||
if ($device['os'] == 'eatonups') {
|
||||
echo 'XUPS-MIB ';
|
||||
echo 'XUPS-MIB ';
|
||||
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsBatCurrent', array(), 'XUPS-MIB');
|
||||
$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";
|
||||
$divisor = 1;
|
||||
$current = $data['xupsBatCurrent'];
|
||||
$descr = 'Battery'.(count($oids) == 1 ? '' : ' '.($current_id + 1));
|
||||
$type = 'xups';
|
||||
$index = '1.2.3.'.$current_id;
|
||||
foreach ($oids as $current_id => $data) {
|
||||
$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));
|
||||
$type = 'xups';
|
||||
$index = '1.2.3.'.$current_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$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";
|
||||
$descr = 'Output';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $current_id";
|
||||
}
|
||||
$current = $data['xupsOutputCurrent'];
|
||||
$type = 'xups';
|
||||
$divisor = 1;
|
||||
$index = '4.4.1.3.'.$current_id;
|
||||
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsOutputCurrent', array(), 'XUPS-MIB');
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
foreach ($oids as $current_id => $data) {
|
||||
$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";
|
||||
}
|
||||
$current = $data['xupsOutputCurrent'];
|
||||
$type = 'xups';
|
||||
$divisor = 1;
|
||||
$index = '4.4.1.3.'.$current_id;
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsInputCurrent', array(), 'XUPS-MIB');
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
foreach ($oids as $current_id => $data) {
|
||||
$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";
|
||||
}
|
||||
$current = $data['xupsInputCurrent'];
|
||||
$type = 'xups';
|
||||
$divisor = 1;
|
||||
$index = '3.4.1.3.'.$current_id;
|
||||
|
||||
$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";
|
||||
$descr = 'Input';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $current_id";
|
||||
}
|
||||
$current = $data['xupsInputCurrent'];
|
||||
$type = 'xups';
|
||||
$divisor = 1;
|
||||
$index = '3.4.1.3.'.$current_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
}//end if
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
@@ -1,31 +1,29 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'gamatronicups') {
|
||||
for ($i = 1; $i <= 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';
|
||||
$precision = 1;
|
||||
$index = $i;
|
||||
$lowlimit = 0;
|
||||
$warnlimit = null;
|
||||
$limit = null;
|
||||
for ($i = 1; $i <= 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';
|
||||
$precision = 1;
|
||||
$index = $i;
|
||||
$lowlimit = 0;
|
||||
$warnlimit = null;
|
||||
$limit = null;
|
||||
|
||||
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 = ".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';
|
||||
$precision = 1;
|
||||
$index = (100 + $i);
|
||||
$lowlimit = 0;
|
||||
$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 = ".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';
|
||||
$precision = 1;
|
||||
$index = (100 + $i);
|
||||
$lowlimit = 0;
|
||||
$warnlimit = null;
|
||||
$limit = null;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '1', '1', $lowlimit, null, null, null, $current);
|
||||
}
|
||||
|
||||
@@ -1,52 +1,49 @@
|
||||
<?php
|
||||
|
||||
// IPOMANII-MIB
|
||||
if ($device['os'] == 'ipoman') {
|
||||
echo ' IPOMANII-MIB ';
|
||||
echo ' IPOMANII-MIB ';
|
||||
|
||||
if (!is_array($cache['ipoman'])) {
|
||||
d_echo('outletConfigDesc ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigDesc', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
d_echo('outletConfigLocation ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigLocation', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
d_echo('inletConfigDesc ');
|
||||
$cache['ipoman']['in'] = snmpwalk_cache_multi_oid($device, 'inletConfigDesc', $cache['ipoman'], 'IPOMANII-MIB');
|
||||
if (!is_array($cache['ipoman'])) {
|
||||
d_echo('outletConfigDesc ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigDesc', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
d_echo('outletConfigLocation ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigLocation', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
d_echo('inletConfigDesc ');
|
||||
$cache['ipoman']['in'] = snmpwalk_cache_multi_oid($device, 'inletConfigDesc', $cache['ipoman'], 'IPOMANII-MIB');
|
||||
}
|
||||
|
||||
$oids_in = array();
|
||||
$oids_out = array();
|
||||
|
||||
d_echo('inletConfigCurrentHigh ');
|
||||
$oids_in = snmpwalk_cache_multi_oid($device, 'inletConfigCurrentHigh', $oids_in, 'IPOMANII-MIB');
|
||||
d_echo('inletStatusCurrent ');
|
||||
$oids_in = snmpwalk_cache_multi_oid($device, 'inletStatusCurrent', $oids_in, 'IPOMANII-MIB');
|
||||
d_echo('outletConfigCurrentHigh ');
|
||||
$oids_out = snmpwalk_cache_multi_oid($device, 'outletConfigCurrentHigh', $oids_out, 'IPOMANII-MIB');
|
||||
d_echo('outletStatusCurrent ');
|
||||
$oids_out = snmpwalk_cache_multi_oid($device, 'outletStatusCurrent', $oids_out, 'IPOMANII-MIB');
|
||||
|
||||
if (is_array($oids_in)) {
|
||||
foreach ($oids_in as $index => $entry) {
|
||||
$cur_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.1.3.1.3.'.$index;
|
||||
$divisor = 1000;
|
||||
$descr = (trim($cache['ipoman']['in'][$index]['inletConfigDesc'], '"') != '' ? trim($cache['ipoman']['in'][$index]['inletConfigDesc'], '"') : "Inlet $index");
|
||||
$current = ($entry['inletStatusCurrent'] / $divisor);
|
||||
$high_limit = ($entry['inletConfigCurrentHigh'] / 10);
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $cur_oid, '1.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', null, null, null, $high_limit, $current);
|
||||
// FIXME: iPoMan 1201 also says it has 2 inlets, at least until firmware 1.06 - wtf?
|
||||
}
|
||||
}
|
||||
|
||||
$oids_in = array();
|
||||
$oids_out = array();
|
||||
if (is_array($oids_out)) {
|
||||
foreach ($oids_out as $index => $entry) {
|
||||
$cur_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.2.3.1.3.'.$index;
|
||||
$divisor = 1000;
|
||||
$descr = (trim($cache['ipoman']['out'][$index]['outletConfigDesc'], '"') != '' ? trim($cache['ipoman']['out'][$index]['outletConfigDesc'], '"') : "Output $index");
|
||||
$current = ($entry['outletStatusCurrent'] / $divisor);
|
||||
$high_limit = ($entry['outletConfigCurrentHigh'] / 10);
|
||||
|
||||
d_echo('inletConfigCurrentHigh ');
|
||||
$oids_in = snmpwalk_cache_multi_oid($device, 'inletConfigCurrentHigh', $oids_in, 'IPOMANII-MIB');
|
||||
d_echo('inletStatusCurrent ');
|
||||
$oids_in = snmpwalk_cache_multi_oid($device, 'inletStatusCurrent', $oids_in, 'IPOMANII-MIB');
|
||||
d_echo('outletConfigCurrentHigh ');
|
||||
$oids_out = snmpwalk_cache_multi_oid($device, 'outletConfigCurrentHigh', $oids_out, 'IPOMANII-MIB');
|
||||
d_echo('outletStatusCurrent ');
|
||||
$oids_out = snmpwalk_cache_multi_oid($device, 'outletStatusCurrent', $oids_out, 'IPOMANII-MIB');
|
||||
|
||||
if (is_array($oids_in)) {
|
||||
foreach ($oids_in as $index => $entry) {
|
||||
$cur_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.1.3.1.3.'.$index;
|
||||
$divisor = 1000;
|
||||
$descr = (trim($cache['ipoman']['in'][$index]['inletConfigDesc'], '"') != '' ? trim($cache['ipoman']['in'][$index]['inletConfigDesc'], '"') : "Inlet $index");
|
||||
$current = ($entry['inletStatusCurrent'] / $divisor);
|
||||
$high_limit = ($entry['inletConfigCurrentHigh'] / 10);
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $cur_oid, '1.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', null, null, null, $high_limit, $current);
|
||||
// FIXME: iPoMan 1201 also says it has 2 inlets, at least until firmware 1.06 - wtf?
|
||||
}
|
||||
discover_sensor($valid['sensor'], 'current', $device, $cur_oid, '2.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', null, null, null, $high_limit, $current);
|
||||
}
|
||||
|
||||
if (is_array($oids_out)) {
|
||||
foreach ($oids_out as $index => $entry) {
|
||||
$cur_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.2.3.1.3.'.$index;
|
||||
$divisor = 1000;
|
||||
$descr = (trim($cache['ipoman']['out'][$index]['outletConfigDesc'], '"') != '' ? trim($cache['ipoman']['out'][$index]['outletConfigDesc'], '"') : "Output $index");
|
||||
$current = ($entry['outletStatusCurrent'] / $divisor);
|
||||
$high_limit = ($entry['outletConfigCurrentHigh'] / 10);
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $cur_oid, '2.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', null, null, null, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
}//end if
|
||||
}
|
||||
|
||||
@@ -10,23 +10,21 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'junos' || $device['os_group'] == 'junos') {
|
||||
echo 'JunOS ';
|
||||
echo 'JunOS ';
|
||||
|
||||
$multiplier = 1;
|
||||
$divisor = 1000000;
|
||||
foreach ($junos_oids as $index => $entry) {
|
||||
if (is_numeric($entry['jnxDomCurrentTxLaserBiasCurrent']) && $entry['jnxDomCurrentTxLaserBiasCurrent'] != 0 && $entry['jnxDomCurrentTxLaserBiasCurrentLowAlarmThreshold'] != 0) {
|
||||
$oid = '.1.3.6.1.4.1.2636.3.60.1.1.1.1.6.'.$index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Rx Current';
|
||||
$limit_low = $entry['jnxDomCurrentTxLaserBiasCurrentLowAlarmThreshold']/$divisor;
|
||||
$warn_limit_low = $entry['jnxDomCurrentTxLaserBiasCurrentLowWarningThreshold']/$divisor;
|
||||
$limit = $entry['jnxDomCurrentTxLaserBiasCurrentHighAlarmThreshold']/$divisor;
|
||||
$warn_limit = $entry['jnxDomCurrentTxLaserBiasCurrentHighWarningThreshold']/$divisor;
|
||||
$current = $entry['jnxDomCurrentTxLaserBiasCurrent'];
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, 'rx-'.$index, 'junos', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
$multiplier = 1;
|
||||
$divisor = 1000000;
|
||||
foreach ($pre_cache['junos_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['jnxDomCurrentTxLaserBiasCurrent']) && $entry['jnxDomCurrentTxLaserBiasCurrent'] != 0 && $entry['jnxDomCurrentTxLaserBiasCurrentLowAlarmThreshold'] != 0) {
|
||||
$oid = '.1.3.6.1.4.1.2636.3.60.1.1.1.1.6.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Rx Current';
|
||||
$limit_low = $entry['jnxDomCurrentTxLaserBiasCurrentLowAlarmThreshold'] / $divisor;
|
||||
$warn_limit_low = $entry['jnxDomCurrentTxLaserBiasCurrentLowWarningThreshold'] / $divisor;
|
||||
$limit = $entry['jnxDomCurrentTxLaserBiasCurrentHighAlarmThreshold'] / $divisor;
|
||||
$warn_limit = $entry['jnxDomCurrentTxLaserBiasCurrentHighWarningThreshold'] / $divisor;
|
||||
$current = $entry['jnxDomCurrentTxLaserBiasCurrent'];
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, 'rx-' . $index, 'junos', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,65 +1,62 @@
|
||||
<?php
|
||||
|
||||
// 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
|
||||
d_echo($oids."\n");
|
||||
echo 'MGE ';
|
||||
$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));
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
unset($current);
|
||||
$current_oid = ".1.3.6.1.4.1.705.1.7.2.1.5.$i";
|
||||
$descr = 'Output';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
$numPhase = count(explode("\n", $oids));
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
unset($current);
|
||||
$current_oid = ".1.3.6.1.4.1.705.1.7.2.1.5.$i";
|
||||
$descr = 'Output';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
if (!$current) {
|
||||
$current_oid .= '.0';
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
}
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
if (!$current) {
|
||||
$current_oid .= '.0';
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
}
|
||||
|
||||
$current /= 10;
|
||||
$type = 'mge-ups';
|
||||
$precision = 10;
|
||||
$index = $i;
|
||||
$warnlimit = null;
|
||||
$lowlimit = 0;
|
||||
$limit = null;
|
||||
$lowwarnlimit = null;
|
||||
$current /= 10;
|
||||
$type = 'mge-ups';
|
||||
$precision = 10;
|
||||
$index = $i;
|
||||
$warnlimit = null;
|
||||
$lowlimit = 0;
|
||||
$limit = null;
|
||||
$lowwarnlimit = null;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current);
|
||||
}//end for
|
||||
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
|
||||
d_echo($oids."\n");
|
||||
$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));
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
unset($current);
|
||||
$current_oid = ".1.3.6.1.4.1.705.1.6.2.1.6.$i";
|
||||
$descr = 'Input';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
$numPhase = count(explode("\n", $oids));
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
unset($current);
|
||||
$current_oid = ".1.3.6.1.4.1.705.1.6.2.1.6.$i";
|
||||
$descr = 'Input';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
if (!$current) {
|
||||
$current_oid .= '.0';
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
}
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
if (!$current) {
|
||||
$current_oid .= '.0';
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
}
|
||||
|
||||
$current /= 10;
|
||||
$type = 'mge-ups';
|
||||
$precision = 10;
|
||||
$index = (100 + $i);
|
||||
$warnlimit = null;
|
||||
$lowlimit = 0;
|
||||
$limit = null;
|
||||
$lowwarnlimit = null;
|
||||
$current /= 10;
|
||||
$type = 'mge-ups';
|
||||
$precision = 10;
|
||||
$index = (100 + $i);
|
||||
$warnlimit = null;
|
||||
$lowlimit = 0;
|
||||
$limit = null;
|
||||
$lowwarnlimit = null;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current);
|
||||
}//end for
|
||||
}//end if
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, $lowwarnlimit, $warnlimit, $limit, $current);
|
||||
}//end for
|
||||
|
||||
@@ -23,36 +23,34 @@
|
||||
* @author Tony Murray <[email protected]>
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'netagent2') {
|
||||
$battery_current_oid = '.1.3.6.1.4.1.935.1.1.1.2.2.7.0';
|
||||
$battery_current = snmp_get($device, $battery_current_oid, '-Oqv');
|
||||
$battery_current_oid = '.1.3.6.1.4.1.935.1.1.1.2.2.7.0';
|
||||
$battery_current = snmp_get($device, $battery_current_oid, '-Oqv');
|
||||
|
||||
if (!empty($battery_current) || $battery_current == 0) {
|
||||
$type = 'netagent2';
|
||||
$index = 0;
|
||||
$limit = 30;
|
||||
$warnlimit = null;
|
||||
$lowlimit = null;
|
||||
$lowwarnlimit = null;
|
||||
$divisor = 10;
|
||||
$current = $battery_current / $divisor;
|
||||
$descr = 'Battery Current';
|
||||
if (!empty($battery_current) || $battery_current == 0) {
|
||||
$type = 'netagent2';
|
||||
$index = 0;
|
||||
$limit = 30;
|
||||
$warnlimit = null;
|
||||
$lowlimit = null;
|
||||
$lowwarnlimit = null;
|
||||
$divisor = 10;
|
||||
$current = $battery_current / $divisor;
|
||||
$descr = 'Battery Current';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'current',
|
||||
$device,
|
||||
$battery_current_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
$lowlimit,
|
||||
$lowwarnlimit,
|
||||
$warnlimit,
|
||||
$limit,
|
||||
$current
|
||||
);
|
||||
}
|
||||
}//end if
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'current',
|
||||
$device,
|
||||
$battery_current_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
$lowlimit,
|
||||
$lowwarnlimit,
|
||||
$warnlimit,
|
||||
$limit,
|
||||
$current
|
||||
);
|
||||
}
|
||||
|
||||
@@ -23,16 +23,13 @@
|
||||
* @author Tony Murray <[email protected]>
|
||||
*/
|
||||
|
||||
echo 'Netonix: ';
|
||||
|
||||
if ($device['os'] == 'netonix') {
|
||||
echo 'Netonix: ';
|
||||
$dcinput_oid = '.1.3.6.1.4.1.46242.7.0'; // NETONIX-SWITCH-MIB::dcdcInputCurrent.0
|
||||
$dcinput_value = snmp_get($device, $dcinput_oid, '-Oqv');
|
||||
$descr = 'DC Input Current';
|
||||
$divisor = 10;
|
||||
|
||||
$dcinput_oid = '.1.3.6.1.4.1.46242.7.0'; // NETONIX-SWITCH-MIB::dcdcInputCurrent.0
|
||||
$dcinput_value = snmp_get($device, $dcinput_oid, '-Oqv');
|
||||
$descr = 'DC Input Current';
|
||||
$divisor = 10;
|
||||
|
||||
if (is_numeric($dcinput_value) && $dcinput_value > 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $dcinput_oid, 0, $device['os'], $descr, $divisor, 1, null, null, null, null, $dcinput_value / $divisor);
|
||||
}
|
||||
if (is_numeric($dcinput_value) && $dcinput_value > 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $dcinput_oid, 0, $device['os'], $descr, $divisor, 1, null, null, null, null, $dcinput_value / $divisor);
|
||||
}
|
||||
|
||||
@@ -1,31 +1,29 @@
|
||||
<?php
|
||||
|
||||
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";
|
||||
$descr = "Input Phase $i";
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
$type = 'netvision';
|
||||
$precision = 1;
|
||||
$index = $i;
|
||||
$lowlimit = 0;
|
||||
$warnlimit = null;
|
||||
$limit = null;
|
||||
for ($i = 1; $i <= 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';
|
||||
$precision = 1;
|
||||
$index = $i;
|
||||
$lowlimit = 0;
|
||||
$warnlimit = null;
|
||||
$limit = null;
|
||||
|
||||
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";
|
||||
$descr = "Output Phase $i";
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
$type = 'netvision';
|
||||
$precision = 1;
|
||||
$index = (100 + $i);
|
||||
$lowlimit = 0;
|
||||
$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";
|
||||
$descr = "Output Phase $i";
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
$type = 'netvision';
|
||||
$precision = 1;
|
||||
$index = (100 + $i);
|
||||
$lowlimit = 0;
|
||||
$warnlimit = null;
|
||||
$limit = null;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, '10', '1', $lowlimit, null, null, null, $current);
|
||||
}
|
||||
|
||||
@@ -9,23 +9,21 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'pbn' || $device['os_group'] == 'pbn') {
|
||||
echo 'PBN ';
|
||||
echo 'PBN ';
|
||||
|
||||
$multiplier = 1;
|
||||
$divisor = 1000000;
|
||||
foreach ($pbn_oids as $index => $entry) {
|
||||
if (is_numeric($entry['curr']) && ($entry['curr'] !== '-65535')) {
|
||||
$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;
|
||||
$limit = 15000/$divisor;
|
||||
$warn_limit = 14500/$divisor;
|
||||
$value = $entry['curr']/$divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, ''.$index, 'pbn', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
$multiplier = 1;
|
||||
$divisor = 1000000;
|
||||
foreach ($pre_cache['pbn_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['curr']) && ($entry['curr'] !== '-65535')) {
|
||||
$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;
|
||||
$limit = 15000/$divisor;
|
||||
$warn_limit = 14500/$divisor;
|
||||
$value = $entry['curr']/$divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid, ''.$index, 'pbn', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,65 +1,62 @@
|
||||
<?php
|
||||
|
||||
// XUPS-MIB
|
||||
if ($device['os'] == 'powerware') {
|
||||
echo 'XUPS-MIB ';
|
||||
echo 'XUPS-MIB ';
|
||||
|
||||
$oids = snmp_walk($device, 'xupsBatCurrent', '-Osqn', 'XUPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
$oids = snmp_walk($device, 'xupsBatCurrent', '-Osqn', 'XUPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
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";
|
||||
$divisor = 1;
|
||||
$current = snmp_get($device, $current_oid, '-O vq');
|
||||
$descr = 'Battery'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($current_id + 1));
|
||||
$type = 'xups';
|
||||
$index = '1.2.3.'.$current_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, 'xupsOutputCurrent', '-OsqnU', 'XUPS-MIB'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
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";
|
||||
$descr = 'Output';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
$type = 'xups';
|
||||
$divisor = 1;
|
||||
$index = '4.4.1.3.'.$i;
|
||||
$oids = trim($oids);
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
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";
|
||||
$divisor = 1;
|
||||
$current = snmp_get($device, $current_oid, '-O vq');
|
||||
$descr = 'Battery'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($current_id + 1));
|
||||
$type = 'xups';
|
||||
$index = '1.2.3.'.$current_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, 'xupsInputCurrent', '-OsqnU', 'XUPS-MIB'));
|
||||
d_echo($oids."\n");
|
||||
$oids = trim(snmp_walk($device, 'xupsOutputCurrent', '-OsqnU', 'XUPS-MIB'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
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";
|
||||
$descr = 'Input';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
$type = 'xups';
|
||||
$divisor = 1;
|
||||
$index = '3.4.1.3.'.$i;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
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";
|
||||
$descr = 'Output';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
}//end if
|
||||
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
$type = 'xups';
|
||||
$divisor = 1;
|
||||
$index = '4.4.1.3.'.$i;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, 'xupsInputCurrent', '-OsqnU', 'XUPS-MIB'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
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";
|
||||
$descr = 'Input';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$current = snmp_get($device, $current_oid, '-Oqv');
|
||||
$type = 'xups';
|
||||
$divisor = 1;
|
||||
$index = '3.4.1.3.'.$i;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
@@ -1,78 +1,62 @@
|
||||
<?php
|
||||
|
||||
// blindly copied from sentry3
|
||||
if ($device['os'] == 'raritan') {
|
||||
$divisor = '1000';
|
||||
$outlet_divisor = $divisor;
|
||||
$multiplier = '1';
|
||||
$divisor = '1000';
|
||||
$outlet_divisor = $divisor;
|
||||
$multiplier = '1';
|
||||
|
||||
// Check Inlets
|
||||
$inlet_oids = snmp_walk($device, 'inletLabel', '-Osqn', 'PDU2-MIB');
|
||||
$inlet_oids = trim($inlet_oids);
|
||||
if ($inlet_oids) {
|
||||
echo 'PDU Inlet ';
|
||||
}
|
||||
// Check Inlets
|
||||
$inlet_oids = snmp_walk($device, 'inletLabel', '-Osqn', 'PDU2-MIB');
|
||||
$inlet_oids = trim($inlet_oids);
|
||||
if ($inlet_oids) {
|
||||
echo 'PDU Inlet ';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $inlet_oids) as $inlet_data) {
|
||||
$inlet_data = trim($inlet_data);
|
||||
if ($inlet_data) {
|
||||
list($inlet_oid,$inlet_descr) = explode(' ', $inlet_data, 2);
|
||||
$inlet_split_oid = explode('.', $inlet_oid);
|
||||
$inlet_index = $inlet_split_oid[(count($inlet_split_oid) - 2)].'.'.$inlet_split_oid[(count($inlet_split_oid) - 1)];
|
||||
foreach (explode("\n", $inlet_oids) as $inlet_data) {
|
||||
$inlet_data = trim($inlet_data);
|
||||
if ($inlet_data) {
|
||||
list($inlet_oid,$inlet_descr) = explode(' ', $inlet_data, 2);
|
||||
$inlet_split_oid = explode('.', $inlet_oid);
|
||||
$inlet_index = $inlet_split_oid[(count($inlet_split_oid) - 2)].'.'.$inlet_split_oid[(count($inlet_split_oid) - 1)];
|
||||
|
||||
$inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.$inlet_index.1";
|
||||
$inlet_divisor = pow(10, snmp_get($device, "inletSensorDecimalDigits.$inlet_index.rmsCurrent", '-Ovq', 'PDU2-MIB'));
|
||||
$inlet_current = (snmp_get($device, "measurementsInletSensorValue.$inlet_index.1", '-Ovq', 'PDU2-MIB') / $inlet_divisor);
|
||||
$inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.$inlet_index.1";
|
||||
$inlet_divisor = pow(10, snmp_get($device, "inletSensorDecimalDigits.$inlet_index.rmsCurrent", '-Ovq', 'PDU2-MIB'));
|
||||
$inlet_current = (snmp_get($device, "measurementsInletSensorValue.$inlet_index.1", '-Ovq', 'PDU2-MIB') / $inlet_divisor);
|
||||
|
||||
if ($inlet_current >= 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $inlet_oid, $inlet_index, 'raritan', $inlet_descr, $inlet_divisor, $multiplier, null, null, null, null, $inlet_current);
|
||||
}
|
||||
if ($inlet_current >= 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $inlet_oid, $inlet_index, 'raritan', $inlet_descr, $inlet_divisor, $multiplier, null, null, null, null, $inlet_current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check for per-outlet polling
|
||||
$outlet_oids = snmp_walk($device, 'outletIndex', '-Osqn', 'PDU-MIB');
|
||||
$outlet_oids = trim($outlet_oids);
|
||||
|
||||
if ($outlet_oids) {
|
||||
echo 'PDU Outlet ';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $outlet_oids) as $outlet_data) {
|
||||
$outlet_data = trim($outlet_data);
|
||||
if ($outlet_data) {
|
||||
list($outlet_oid,$outlet_descr) = explode(' ', $outlet_data, 2);
|
||||
$outlet_split_oid = explode('.', $outlet_oid);
|
||||
$outlet_index = $outlet_split_oid[(count($outlet_split_oid) - 1)];
|
||||
|
||||
$outletsuffix = "$outlet_index";
|
||||
$outlet_insert_index = $outlet_index;
|
||||
|
||||
// outletLoadValue: "A non-negative value indicates the measured load in milli Amps"
|
||||
$outlet_oid = ".1.3.6.1.4.1.13742.4.1.2.2.1.4.$outletsuffix";
|
||||
$outlet_descr = snmp_get($device, "outletLabel.$outletsuffix", '-Ovq', 'PDU-MIB');
|
||||
$outlet_low_warn_limit = null;
|
||||
$outlet_low_limit = null;
|
||||
$outlet_high_warn_limit = (snmp_get($device, "outletCurrentUpperWarning.$outletsuffix", '-Ovq', 'PDU-MIB') / $outlet_divisor);
|
||||
$outlet_high_limit = (snmp_get($device, "outletCurrentUpperCritical.$outletsuffix", '-Ovq', 'PDU-MIB') / $outlet_divisor);
|
||||
$outlet_current = (snmp_get($device, "outletCurrent.$outletsuffix", '-Ovq', 'PDU-MIB') / $outlet_divisor);
|
||||
|
||||
if ($outlet_current >= 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $outlet_oid, $outlet_insert_index, 'raritan', $outlet_descr, $outlet_divisor, $multiplier, $outlet_low_limit, $outlet_low_warn_limit, $outlet_high_warn_limit, $outlet_high_limit, $outlet_current);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Check for per-outlet polling
|
||||
$outlet_oids = snmp_walk($device, 'outletIndex', '-Osqn', 'PDU-MIB');
|
||||
$outlet_oids = trim($outlet_oids);
|
||||
|
||||
if ($outlet_oids) {
|
||||
echo 'PDU Outlet ';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $outlet_oids) as $outlet_data) {
|
||||
$outlet_data = trim($outlet_data);
|
||||
if ($outlet_data) {
|
||||
list($outlet_oid,$outlet_descr) = explode(' ', $outlet_data, 2);
|
||||
$outlet_split_oid = explode('.', $outlet_oid);
|
||||
$outlet_index = $outlet_split_oid[(count($outlet_split_oid) - 1)];
|
||||
|
||||
$outletsuffix = "$outlet_index";
|
||||
$outlet_insert_index = $outlet_index;
|
||||
|
||||
// outletLoadValue: "A non-negative value indicates the measured load in milli Amps"
|
||||
$outlet_oid = ".1.3.6.1.4.1.13742.4.1.2.2.1.4.$outletsuffix";
|
||||
$outlet_descr = snmp_get($device, "outletLabel.$outletsuffix", '-Ovq', 'PDU-MIB');
|
||||
$outlet_low_warn_limit = null;
|
||||
$outlet_low_limit = null;
|
||||
$outlet_high_warn_limit = (snmp_get($device, "outletCurrentUpperWarning.$outletsuffix", '-Ovq', 'PDU-MIB') / $outlet_divisor);
|
||||
$outlet_high_limit = (snmp_get($device, "outletCurrentUpperCritical.$outletsuffix", '-Ovq', 'PDU-MIB') / $outlet_divisor);
|
||||
$outlet_current = (snmp_get($device, "outletCurrent.$outletsuffix", '-Ovq', 'PDU-MIB') / $outlet_divisor);
|
||||
|
||||
if ($outlet_current >= 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $outlet_oid, $outlet_insert_index, 'raritan', $outlet_descr, $outlet_divisor, $multiplier, $outlet_low_limit, $outlet_low_warn_limit, $outlet_high_warn_limit, $outlet_high_limit, $outlet_current);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// unset($outlet_data);
|
||||
// unset($outlet_oids);
|
||||
// unset($outlet_oid);
|
||||
// unset($outlet_descr);
|
||||
// unset($outlet_low_warn_limit);
|
||||
// unset($outlet_low_limit);
|
||||
// unset($outlet_high_warn_limit);
|
||||
// unset($outlet_high_limit);
|
||||
// unset($outlet_current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,86 +1,83 @@
|
||||
<?php
|
||||
|
||||
$divisor = get_device_divisor($device, $_tmp_serial, 'current');
|
||||
$divisor = get_device_divisor($device, $pre_cache['poweralert_serial'], 'current');
|
||||
|
||||
// RFC1628 UPS
|
||||
if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modules_compat']['rfc1628'][$device['os']]) {
|
||||
echo 'RFC1628 ';
|
||||
echo 'RFC1628 ';
|
||||
|
||||
$oids = snmp_walk($device, '.1.3.6.1.2.1.33.1.2.6', '-Osqn', 'UPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
$oids = snmp_walk($device, '.1.3.6.1.2.1.33.1.2.6', '-Osqn', 'UPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
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";
|
||||
$precision = 10;
|
||||
$current = (snmp_get($device, $current_oid, '-O vq') / $precision);
|
||||
$descr = 'Battery'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($current_id + 1));
|
||||
$type = 'rfc1628';
|
||||
$index = (500 + $current_id);
|
||||
|
||||
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.4.3.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.4.4.1.3.$i";
|
||||
$descr = 'Output';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$precision = 10;
|
||||
$current = (snmp_get($device, $current_oid, '-Oqv') / $precision);
|
||||
$type = 'rfc1628';
|
||||
$index = $i;
|
||||
$oids = trim($oids);
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
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";
|
||||
$precision = 10;
|
||||
$current = (snmp_get($device, $current_oid, '-O vq') / $precision);
|
||||
$descr = 'Battery'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($current_id + 1));
|
||||
$type = 'rfc1628';
|
||||
$index = (500 + $current_id);
|
||||
|
||||
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'));
|
||||
d_echo($oids."\n");
|
||||
$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++) {
|
||||
$current_oid = ".1.3.6.1.2.1.33.1.3.3.1.4.$i";
|
||||
$descr = 'Input';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$precision = 10;
|
||||
$current = (snmp_get($device, $current_oid, '-Oqv') / $precision);
|
||||
$type = 'rfc1628';
|
||||
$index = (100 + $i);
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
list($unused,$numPhase) = explode(' ', $oids);
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$current_oid = ".1.3.6.1.2.1.33.1.4.4.1.3.$i";
|
||||
$descr = 'Output';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$oids = trim(snmp_walk($device, '.1.3.6.1.2.1.33.1.5.2.0', '-OsqnU'));
|
||||
d_echo($oids."\n");
|
||||
$precision = 10;
|
||||
$current = (snmp_get($device, $current_oid, '-Oqv') / $precision);
|
||||
$type = 'rfc1628';
|
||||
$index = $i;
|
||||
|
||||
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";
|
||||
$descr = 'Bypass';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$precision = 10;
|
||||
$current = (snmp_get($device, $current_oid, '-Oqv') / $precision);
|
||||
$type = 'rfc1628';
|
||||
$index = (200 + $i);
|
||||
$oids = trim(snmp_walk($device, '.1.3.6.1.2.1.33.1.3.2.0', '-OsqnU'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
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";
|
||||
$descr = 'Input';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
}//end if
|
||||
|
||||
$precision = 10;
|
||||
$current = (snmp_get($device, $current_oid, '-Oqv') / $precision);
|
||||
$type = 'rfc1628';
|
||||
$index = (100 + $i);
|
||||
|
||||
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'));
|
||||
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";
|
||||
$descr = 'Bypass';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$precision = 10;
|
||||
$current = (snmp_get($device, $current_oid, '-Oqv') / $precision);
|
||||
$type = 'rfc1628';
|
||||
$index = (200 + $i);
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'routeros') {
|
||||
echo 'MIKROTIK-MIB ';
|
||||
echo 'MIKROTIK-MIB ';
|
||||
|
||||
$input_oid = '.1.3.6.1.4.1.14988.1.1.3.13.0'; // MIKROTIK-MIB::mtxrHlCurrent
|
||||
$input_value = snmp_get($device, $input_oid, '-Oqv');
|
||||
$descr = 'Current';
|
||||
$divisor = 1000;
|
||||
$input_oid = '.1.3.6.1.4.1.14988.1.1.3.13.0'; // MIKROTIK-MIB::mtxrHlCurrent
|
||||
$input_value = snmp_get($device, $input_oid, '-Oqv');
|
||||
$descr = 'Current';
|
||||
$divisor = 1000;
|
||||
|
||||
if (is_numeric($input_value) && $input_value > 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $input_oid, 0, $device['os'], $descr, $divisor, 1, null, null, null, null, $input_value / $divisor);
|
||||
}
|
||||
if (is_numeric($input_value) && $input_value > 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $input_oid, 0, $device['os'], $descr, $divisor, 1, null, null, null, null, $input_value / $divisor);
|
||||
}
|
||||
|
||||
@@ -1,108 +1,104 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'sentry3') {
|
||||
$divisor = '100';
|
||||
$outlet_divisor = $divisor;
|
||||
$multiplier = '1';
|
||||
$divisor = '100';
|
||||
$outlet_divisor = $divisor;
|
||||
$multiplier = '1';
|
||||
|
||||
// These PDUs may have > 1 "tower" accessible via a single management interface
|
||||
$tower_count = snmp_get($device, 'systemTowerCount.0', '-Ovq', 'Sentry3-MIB');
|
||||
$towers = 1;
|
||||
while ($towers <= $tower_count) {
|
||||
//
|
||||
// Check for Infeeds
|
||||
$infeed_oids = snmp_walk($device, "infeedID.$towers.1", '-Osqn', 'Sentry3-MIB');
|
||||
d_echo($infeed_oids."\n");
|
||||
// These PDUs may have > 1 "tower" accessible via a single management interface
|
||||
$tower_count = snmp_get($device, 'systemTowerCount.0', '-Ovq', 'Sentry3-MIB');
|
||||
$towers = 1;
|
||||
while ($towers <= $tower_count) {
|
||||
// Check for Infeeds
|
||||
$infeed_oids = snmp_walk($device, "infeedID.$towers.1", '-Osqn', 'Sentry3-MIB');
|
||||
d_echo($infeed_oids."\n");
|
||||
|
||||
$infeed_oids = trim($infeed_oids);
|
||||
$infeed_oids = trim($infeed_oids);
|
||||
|
||||
if ($infeed_oids) {
|
||||
echo 'ServerTech Sentry Infeed ';
|
||||
}
|
||||
if ($infeed_oids) {
|
||||
echo 'ServerTech Sentry Infeed ';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $infeed_oids) as $infeed_data) {
|
||||
$infeed_data = trim($infeed_data);
|
||||
if ($infeed_data) {
|
||||
list($infeed_oid,$descr) = explode(' ', $infeed_data, 2);
|
||||
$split_oid = explode('.', $infeed_oid);
|
||||
$infeed_index = $split_oid[(count($split_oid) - 1)];
|
||||
foreach (explode("\n", $infeed_oids) as $infeed_data) {
|
||||
$infeed_data = trim($infeed_data);
|
||||
if ($infeed_data) {
|
||||
list($infeed_oid,$descr) = explode(' ', $infeed_data, 2);
|
||||
$split_oid = explode('.', $infeed_oid);
|
||||
$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';
|
||||
// infeedLoadValue
|
||||
$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";
|
||||
$low_warn_limit = null;
|
||||
$low_limit = null;
|
||||
$high_warn_limit = snmp_get($device, "infeedLoadHighThresh.$towers.$infeed_index", '-Ovq', 'Sentry3-MIB');
|
||||
$high_limit = snmp_get($device, "infeedCapacity.$towers.$infeed_index", '-Ovq', 'Sentry3-MIB');
|
||||
$current = (snmp_get($device, "$infeed_oid", '-Ovq', 'Sentry3-MIB') / $divisor);
|
||||
$descr_string = snmp_get($device, "infeedID.$towers.$infeed_index", '-Ovq', 'Sentry3-MIB');
|
||||
$descr = "Infeed $descr_string";
|
||||
$low_warn_limit = null;
|
||||
$low_limit = null;
|
||||
$high_warn_limit = snmp_get($device, "infeedLoadHighThresh.$towers.$infeed_index", '-Ovq', 'Sentry3-MIB');
|
||||
$high_limit = snmp_get($device, "infeedCapacity.$towers.$infeed_index", '-Ovq', 'Sentry3-MIB');
|
||||
$current = (snmp_get($device, "$infeed_oid", '-Ovq', 'Sentry3-MIB') / $divisor);
|
||||
|
||||
if ($current >= 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $infeed_oid, $towers, 'sentry3', $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
if ($current >= 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $infeed_oid, $towers, 'sentry3', $descr, $divisor, $multiplier, $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
|
||||
//
|
||||
// Check for per-outlet polling
|
||||
// $outlet_oids = snmp_walk($device, "outletLoadValue.$towers.$infeed_index", "-Osqn", "Sentry3-MIB");
|
||||
$outlet_oids = snmp_walk($device, "outletLoadValue.$towers.1", '-Osqn', 'Sentry3-MIB');
|
||||
$outlet_oids = trim($outlet_oids);
|
||||
// Check for per-outlet polling
|
||||
// $outlet_oids = snmp_walk($device, "outletLoadValue.$towers.$infeed_index", "-Osqn", "Sentry3-MIB");
|
||||
$outlet_oids = snmp_walk($device, "outletLoadValue.$towers.1", '-Osqn', 'Sentry3-MIB');
|
||||
$outlet_oids = trim($outlet_oids);
|
||||
|
||||
if ($outlet_oids) {
|
||||
echo 'ServerTech Sentry Outlet ';
|
||||
}
|
||||
if ($outlet_oids) {
|
||||
echo 'ServerTech Sentry Outlet ';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $outlet_oids) as $outlet_data) {
|
||||
$outlet_data = trim($outlet_data);
|
||||
if ($outlet_data) {
|
||||
list($outlet_oid,$outlet_descr) = explode(' ', $outlet_data, 2);
|
||||
$outlet_split_oid = explode('.', $outlet_oid);
|
||||
$outlet_index = $outlet_split_oid[(count($outlet_split_oid) - 1)];
|
||||
foreach (explode("\n", $outlet_oids) as $outlet_data) {
|
||||
$outlet_data = trim($outlet_data);
|
||||
if ($outlet_data) {
|
||||
list($outlet_oid,$outlet_descr) = explode(' ', $outlet_data, 2);
|
||||
$outlet_split_oid = explode('.', $outlet_oid);
|
||||
$outlet_index = $outlet_split_oid[(count($outlet_split_oid) - 1)];
|
||||
|
||||
$outletsuffix = "$towers.$infeed_index.$outlet_index";
|
||||
$outlet_insert_index = $towers.$outlet_index;
|
||||
$outletsuffix = "$towers.$infeed_index.$outlet_index";
|
||||
$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_descr_string = snmp_get($device, "outletID.$outletsuffix", '-Ovq', 'Sentry3-MIB');
|
||||
$outlet_descr = "Outlet $outlet_descr_string";
|
||||
$outlet_low_warn_limit = null;
|
||||
$outlet_low_limit = null;
|
||||
$outlet_high_warn_limit = null;
|
||||
// Should be "outletCapacity" but is always -1. According to MIB: "A negative value indicates that the capacity was not available."
|
||||
$outlet_high_limit = snmp_get($device, "outletLoadHighThresh.$outletsuffix", '-Ovq', 'Sentry3-MIB');
|
||||
$outlet_current = (snmp_get($device, "$outlet_oid", '-Ovq', 'Sentry3-MIB') / $outlet_divisor);
|
||||
// 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_descr_string = snmp_get($device, "outletID.$outletsuffix", '-Ovq', 'Sentry3-MIB');
|
||||
$outlet_descr = "Outlet $outlet_descr_string";
|
||||
$outlet_low_warn_limit = null;
|
||||
$outlet_low_limit = null;
|
||||
$outlet_high_warn_limit = null;
|
||||
// Should be "outletCapacity" but is always -1. According to MIB: "A negative value indicates that the capacity was not available."
|
||||
$outlet_high_limit = snmp_get($device, "outletLoadHighThresh.$outletsuffix", '-Ovq', 'Sentry3-MIB');
|
||||
$outlet_current = (snmp_get($device, "$outlet_oid", '-Ovq', 'Sentry3-MIB') / $outlet_divisor);
|
||||
|
||||
if ($outlet_current >= 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $outlet_oid, $outlet_insert_index, 'sentry3', $outlet_descr, $outlet_divisor, $multiplier, $outlet_low_limit, $outlet_low_warn_limit, $outlet_high_warn_limit, $outlet_high_limit, $outlet_current);
|
||||
}
|
||||
} //end if
|
||||
if ($outlet_current >= 0) {
|
||||
discover_sensor($valid['sensor'], 'current', $device, $outlet_oid, $outlet_insert_index, 'sentry3', $outlet_descr, $outlet_divisor, $multiplier, $outlet_low_limit, $outlet_low_warn_limit, $outlet_high_warn_limit, $outlet_high_limit, $outlet_current);
|
||||
}
|
||||
} //end if
|
||||
|
||||
unset($outlet_data);
|
||||
unset($outlet_oids);
|
||||
unset($outlet_oid);
|
||||
unset($outlet_descr_string);
|
||||
unset($outlet_descr);
|
||||
unset($outlet_low_warn_limit);
|
||||
unset($outlet_low_limit);
|
||||
unset($outlet_high_warn_limit);
|
||||
unset($outlet_high_limit);
|
||||
unset($outlet_current);
|
||||
} //end foreach
|
||||
} //end if
|
||||
unset($infeed_data);
|
||||
unset($infeed_oids);
|
||||
unset($descr_string);
|
||||
unset($descr);
|
||||
unset($low_warn_limit);
|
||||
unset($low_limit);
|
||||
unset($high_warn_limit);
|
||||
unset($high_limit);
|
||||
unset($current);
|
||||
} //end foreach
|
||||
unset($outlet_data);
|
||||
unset($outlet_oids);
|
||||
unset($outlet_oid);
|
||||
unset($outlet_descr_string);
|
||||
unset($outlet_descr);
|
||||
unset($outlet_low_warn_limit);
|
||||
unset($outlet_low_limit);
|
||||
unset($outlet_high_warn_limit);
|
||||
unset($outlet_high_limit);
|
||||
unset($outlet_current);
|
||||
} //end foreach
|
||||
} //end if
|
||||
unset($infeed_data);
|
||||
unset($infeed_oids);
|
||||
unset($descr_string);
|
||||
unset($descr);
|
||||
unset($low_warn_limit);
|
||||
unset($low_limit);
|
||||
unset($high_warn_limit);
|
||||
unset($high_limit);
|
||||
unset($current);
|
||||
} //end foreach
|
||||
|
||||
$towers++;
|
||||
} //end while
|
||||
$towers++;
|
||||
} //end while
|
||||
|
||||
unset($towers);
|
||||
}//end if
|
||||
unset($towers);
|
||||
|
||||
@@ -23,54 +23,51 @@
|
||||
* @author Tony Murray <[email protected]>
|
||||
*/
|
||||
|
||||
$battery_oid = '.1.3.6.1.4.1.13891.101.2.6.0';
|
||||
$battery_current = snmp_get($device, $battery_oid, '-Oqv');
|
||||
|
||||
if ($device['os'] == 'sinetica') {
|
||||
$battery_oid = '.1.3.6.1.4.1.13891.101.2.6.0';
|
||||
$battery_current = snmp_get($device, $battery_oid, '-Oqv');
|
||||
if (!empty($battery_current) || $battery_current == 0) {
|
||||
$divisor = 10;
|
||||
$current = $battery_current / $divisor;
|
||||
$descr = 'Battery';
|
||||
$type = 'sinetica';
|
||||
$index = '2.6.0';
|
||||
|
||||
if (!empty($battery_current) || $battery_current == 0) {
|
||||
$divisor = 10;
|
||||
$current = $battery_current / $divisor;
|
||||
$descr = 'Battery';
|
||||
$type = 'sinetica';
|
||||
$index = '2.6.0';
|
||||
discover_sensor($valid['sensor'], 'current', $device, $battery_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $battery_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.4.4.1.3', array());
|
||||
|
||||
foreach ($oids as $oid => $data) {
|
||||
$current_id = substr($oid, strrpos($oid, '.') + 1);
|
||||
|
||||
$current_oid = ".$oid";
|
||||
$descr = 'Output';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $current_id";
|
||||
}
|
||||
$divisor = 100;
|
||||
$current = current($data) / $divisor;
|
||||
$type = 'sinetica';
|
||||
$index = '4.4.1.3.'.$current_id;
|
||||
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.4.4.1.3', array());
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
foreach ($oids as $oid => $data) {
|
||||
$current_id = substr($oid, strrpos($oid, '.') + 1);
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.3.3.1.4', array());
|
||||
|
||||
$current_oid = ".$oid";
|
||||
$descr = 'Output';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $current_id";
|
||||
}
|
||||
$divisor = 100;
|
||||
$current = current($data) / $divisor;
|
||||
$type = 'sinetica';
|
||||
$index = '4.4.1.3.'.$current_id;
|
||||
foreach ($oids as $oid => $data) {
|
||||
$current_id = substr($oid, strrpos($oid, '.') + 1);
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
$current_oid = ".$oid";
|
||||
$descr = 'Input';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $current_id";
|
||||
}
|
||||
$divisor = 10;
|
||||
$current = current($data) / $divisor;
|
||||
$type = 'sinetica';
|
||||
$index = '3.3.1.3.'.$current_id;
|
||||
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.3.3.1.4', array());
|
||||
|
||||
foreach ($oids as $oid => $data) {
|
||||
$current_id = substr($oid, strrpos($oid, '.') + 1);
|
||||
|
||||
$current_oid = ".$oid";
|
||||
$descr = 'Input';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $current_id";
|
||||
}
|
||||
$divisor = 10;
|
||||
$current = current($data) / $divisor;
|
||||
$type = 'sinetica';
|
||||
$index = '3.3.1.3.'.$current_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
}//end if
|
||||
discover_sensor($valid['sensor'], 'current', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
@@ -23,30 +23,28 @@
|
||||
* @author Neil Lathwood <[email protected]>
|
||||
*/
|
||||
|
||||
if ($device['os'] === 'vrp') {
|
||||
echo 'Huawei VRP ';
|
||||
$data = $vrp_oids['hwEntityOpticalBiasCurrent'];
|
||||
echo 'Huawei VRP ';
|
||||
$data = $pre_cache['vrp_oids']['hwEntityOpticalBiasCurrent'];
|
||||
|
||||
foreach ($data as $index => $value) {
|
||||
if (is_numeric($value) && $value >= 0) {
|
||||
$oid = '.1.3.6.1.4.1.2011.5.25.31.1.1.3.1.7.' . $index;
|
||||
$descr = $vrp_oids['entPhysicalName'][$index];
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'current',
|
||||
$device,
|
||||
$oid,
|
||||
$index,
|
||||
'vrp',
|
||||
$descr,
|
||||
1000,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
70,
|
||||
75,
|
||||
$value
|
||||
);
|
||||
}
|
||||
foreach ($data as $index => $value) {
|
||||
if (is_numeric($value) && $value >= 0) {
|
||||
$oid = '.1.3.6.1.4.1.2011.5.25.31.1.1.3.1.7.' . $index;
|
||||
$descr = $pre_cache['vrp_oids']['entPhysicalName'][$index];
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'current',
|
||||
$device,
|
||||
$oid,
|
||||
$index,
|
||||
'vrp',
|
||||
$descr,
|
||||
1000,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
70,
|
||||
75,
|
||||
$value
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
echo 'dBm: ';
|
||||
|
||||
// Include all discovery modules
|
||||
$include_dir = 'includes/discovery/sensors/dbm';
|
||||
require 'includes/include-dir.inc.php';
|
||||
|
||||
d_echo($valid['sensor']['dbm']);
|
||||
|
||||
check_valid_sensors($device, 'dbm', $valid['sensor']);
|
||||
|
||||
echo "\n";
|
||||
@@ -9,55 +9,53 @@
|
||||
* option) any later version. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'comware') {
|
||||
echo 'Comware ';
|
||||
|
||||
echo 'Comware ';
|
||||
|
||||
// Based on 10G_BASE_LR_SFP, as HP does not provide threshold values through snmp
|
||||
// Alarm thresholds:
|
||||
// RX power(dBm) TX power(dBm)
|
||||
// 2.50 3.50
|
||||
// -12.30 -11.20
|
||||
// Based on 10G_BASE_LR_SFP, as HP does not provide threshold values through snmp
|
||||
// Alarm thresholds:
|
||||
// RX power(dBm) TX power(dBm)
|
||||
// 2.50 3.50
|
||||
// -12.30 -11.20
|
||||
|
||||
$multiplier = 1;
|
||||
$divisor = 100;
|
||||
foreach ($comware_oids as $index => $entry) {
|
||||
if (is_numeric($entry['hh3cTransceiverCurRXPower']) && $entry['hh3cTransceiverCurRXPower'] != 2147483647) {
|
||||
$oid = '.1.3.6.1.4.1.25506.2.70.1.1.1.12.' . $index;
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", array(
|
||||
$index,
|
||||
$device['device_id']
|
||||
));
|
||||
$limit_low = -30;
|
||||
$warn_limit_low = -12.3;
|
||||
$limit = 2.5;
|
||||
$warn_limit = -3;
|
||||
$current = $entry['hh3cTransceiverCurRXPower'] / $divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
foreach ($dbquery as $dbindex => $dbresult) {
|
||||
$descr = $dbresult['ifDescr'] . ' Rx Power';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'rx-' . $index, 'comware', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
$multiplier = 1;
|
||||
$divisor = 100;
|
||||
foreach ($pre_cache['comware_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['hh3cTransceiverCurRXPower']) && $entry['hh3cTransceiverCurRXPower'] != 2147483647) {
|
||||
$oid = '.1.3.6.1.4.1.25506.2.70.1.1.1.12.' . $index;
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", array(
|
||||
$index,
|
||||
$device['device_id']
|
||||
));
|
||||
$limit_low = -30;
|
||||
$warn_limit_low = -12.3;
|
||||
$limit = 2.5;
|
||||
$warn_limit = -3;
|
||||
$current = $entry['hh3cTransceiverCurRXPower'] / $divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
foreach ($dbquery as $dbindex => $dbresult) {
|
||||
$descr = $dbresult['ifDescr'] . ' Rx Power';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'rx-' . $index, 'comware', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_numeric($entry['hh3cTransceiverCurTXPower']) && $entry['hh3cTransceiverCurTXPower'] != 2147483647) {
|
||||
$oid = '.1.3.6.1.4.1.25506.2.70.1.1.1.9.' . $index;
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", array(
|
||||
$index,
|
||||
$device['device_id']
|
||||
));
|
||||
$limit_low = -30;
|
||||
$warn_limit_low = -11.2;
|
||||
$limit = 3.5;
|
||||
$warn_limit = -3;
|
||||
$current = $entry['hh3cTransceiverCurTXPower'] / $divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
foreach ($dbquery as $dbindex => $dbresult) {
|
||||
$descr = $dbresult['ifDescr'] . ' Tx Power';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-' . $index, 'comware', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
if (is_numeric($entry['hh3cTransceiverCurTXPower']) && $entry['hh3cTransceiverCurTXPower'] != 2147483647) {
|
||||
$oid = '.1.3.6.1.4.1.25506.2.70.1.1.1.9.' . $index;
|
||||
$dbquery = dbFetchRows("SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ? AND `ifAdminStatus` = 'up'", array(
|
||||
$index,
|
||||
$device['device_id']
|
||||
));
|
||||
$limit_low = -30;
|
||||
$warn_limit_low = -11.2;
|
||||
$limit = 3.5;
|
||||
$warn_limit = -3;
|
||||
$current = $entry['hh3cTransceiverCurTXPower'] / $divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
foreach ($dbquery as $dbindex => $dbresult) {
|
||||
$descr = $dbresult['ifDescr'] . ' Tx Power';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-' . $index, 'comware', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +1,35 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'datacom') {
|
||||
echo 'Datacom';
|
||||
echo 'Datacom';
|
||||
|
||||
$multiplier = 1;
|
||||
$divisor = 100;
|
||||
foreach ($datacom_oids as $index => $entry) {
|
||||
if (is_numeric(str_replace('dBm', '', $entry['ddTransceiversRxPower']))) {
|
||||
$oid = '.1.3.6.1.4.1.3709.3.5.201.1.28.1.1.4.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Rx Power';
|
||||
/* Basic default values */
|
||||
$limit_low = -30;
|
||||
$warn_limit_low = -12.3;
|
||||
$limit = 2.5;
|
||||
$warn_limit = -3;
|
||||
$current = $entry['ddTransceiversRxPower'];
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'rx-' . $index, 'datacom', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
$multiplier = 1;
|
||||
$divisor = 100;
|
||||
foreach ($pre_cache['datacom_oids'] as $index => $entry) {
|
||||
if (is_numeric(str_replace('dBm', '', $entry['ddTransceiversRxPower']))) {
|
||||
$oid = '.1.3.6.1.4.1.3709.3.5.201.1.28.1.1.4.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Rx Power';
|
||||
/* Basic default values */
|
||||
$limit_low = -30;
|
||||
$warn_limit_low = -12.3;
|
||||
$limit = 2.5;
|
||||
$warn_limit = -3;
|
||||
$current = $entry['ddTransceiversRxPower'];
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'rx-' . $index, 'datacom', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
|
||||
if (is_numeric(str_replace('dBm', '', $entry['ddTransceiversTxPower']))) {
|
||||
$oid = '.1.3.6.1.4.1.3709.3.5.201.1.28.1.1.5.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Tx Power';
|
||||
/* Basic default values */
|
||||
$limit_low = -30;
|
||||
$warn_limit_low = -12.3;
|
||||
$limit = 2.5;
|
||||
$warn_limit = -3;
|
||||
$current = $entry['ddTransceiversTxPower'];
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-' . $index, 'datacom', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
if (is_numeric(str_replace('dBm', '', $entry['ddTransceiversTxPower']))) {
|
||||
$oid = '.1.3.6.1.4.1.3709.3.5.201.1.28.1.1.5.' . $index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Tx Power';
|
||||
/* Basic default values */
|
||||
$limit_low = -30;
|
||||
$warn_limit_low = -12.3;
|
||||
$limit = 2.5;
|
||||
$warn_limit = -3;
|
||||
$current = $entry['ddTransceiversTxPower'];
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-' . $index, 'datacom', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,36 +10,34 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'junos' || $device['os_group'] == 'junos') {
|
||||
echo 'JunOS ';
|
||||
echo 'JunOS ';
|
||||
|
||||
$multiplier = 1;
|
||||
$divisor = 100;
|
||||
foreach ($junos_oids as $index => $entry) {
|
||||
if (is_numeric($entry['jnxDomCurrentRxLaserPower']) && $entry['jnxDomCurrentRxLaserPower'] != 0 && $entry['jnxDomCurrentTxLaserOutputPower'] != 0) {
|
||||
$oid = '.1.3.6.1.4.1.2636.3.60.1.1.1.1.5.'.$index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Rx Power';
|
||||
$limit_low = $entry['jnxDomCurrentRxLaserPowerLowAlarmThreshold']/$divisor;
|
||||
$warn_limit_low = $entry['jnxDomCurrentRxLaserPowerLowWarningThreshold']/$divisor;
|
||||
$limit = $entry['jnxDomCurrentRxLaserPowerHighAlarmThreshold']/$divisor;
|
||||
$warn_limit = $entry['jnxDomCurrentRxLaserPowerHighWarningThreshold']/$divisor;
|
||||
$current = $entry['jnxDomCurrentRxLaserPower'];
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'rx-'.$index, 'junos', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
$multiplier = 1;
|
||||
$divisor = 100;
|
||||
foreach ($pre_cache['junos_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['jnxDomCurrentRxLaserPower']) && $entry['jnxDomCurrentRxLaserPower'] != 0 && $entry['jnxDomCurrentTxLaserOutputPower'] != 0) {
|
||||
$oid = '.1.3.6.1.4.1.2636.3.60.1.1.1.1.5.'.$index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Rx Power';
|
||||
$limit_low = $entry['jnxDomCurrentRxLaserPowerLowAlarmThreshold']/$divisor;
|
||||
$warn_limit_low = $entry['jnxDomCurrentRxLaserPowerLowWarningThreshold']/$divisor;
|
||||
$limit = $entry['jnxDomCurrentRxLaserPowerHighAlarmThreshold']/$divisor;
|
||||
$warn_limit = $entry['jnxDomCurrentRxLaserPowerHighWarningThreshold']/$divisor;
|
||||
$current = $entry['jnxDomCurrentRxLaserPower'];
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'rx-'.$index, 'junos', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
|
||||
if (is_numeric($entry['jnxDomCurrentTxLaserOutputPower']) && $entry['jnxDomCurrentTxLaserOutputPower'] && $entry['jnxDomCurrentRxLaserPower']) {
|
||||
$oid = '.1.3.6.1.4.1.2636.3.60.1.1.1.1.7.'.$index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Tx Power';
|
||||
$limit_low = $entry['jnxDomCurrentTxLaserOutputPowerLowAlarmThreshold']/$divisor;
|
||||
$warn_limit_low = $entry['jnxDomCurrentTxLaserOutputPowerLowWarningThreshold']/$divisor;
|
||||
$limit = $entry['jnxDomCurrentModuleTemperatureHighAlarmThreshold']/$divisor;
|
||||
$warn_limit = $entry['jnxDomCurrentModuleTemperatureHighWarningThreshold']/$divisor;
|
||||
$current = $entry['jnxDomCurrentTxLaserOutputPower'];
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-'.$index, 'junos', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
if (is_numeric($entry['jnxDomCurrentTxLaserOutputPower']) && $entry['jnxDomCurrentTxLaserOutputPower'] && $entry['jnxDomCurrentRxLaserPower']) {
|
||||
$oid = '.1.3.6.1.4.1.2636.3.60.1.1.1.1.7.'.$index;
|
||||
$descr = dbFetchCell('SELECT `ifDescr` FROM `ports` WHERE `ifIndex`= ? AND `device_id` = ?', array($index, $device['device_id'])) . ' Tx Power';
|
||||
$limit_low = $entry['jnxDomCurrentTxLaserOutputPowerLowAlarmThreshold']/$divisor;
|
||||
$warn_limit_low = $entry['jnxDomCurrentTxLaserOutputPowerLowWarningThreshold']/$divisor;
|
||||
$limit = $entry['jnxDomCurrentModuleTemperatureHighAlarmThreshold']/$divisor;
|
||||
$warn_limit = $entry['jnxDomCurrentModuleTemperatureHighWarningThreshold']/$divisor;
|
||||
$current = $entry['jnxDomCurrentTxLaserOutputPower'];
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-'.$index, 'junos', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $current, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,36 +9,34 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'pbn' || $device['os_group'] == 'pbn') {
|
||||
echo 'PBN ';
|
||||
echo 'PBN ';
|
||||
|
||||
$multiplier = 1;
|
||||
$divisor = 1;
|
||||
foreach ($pbn_oids as $index => $entry) {
|
||||
if (is_numeric($entry['rxPower']) && ($entry['rxPower'] !== '-65535')) {
|
||||
$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;
|
||||
$limit = -2/$divisor;
|
||||
$warn_limit = -3/$divisor;
|
||||
$value = $entry['rxPower']/$divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'rx-'.$index, 'pbn', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
$multiplier = 1;
|
||||
$divisor = 1;
|
||||
foreach ($pre_cache['pbn_oids'] as $index => $entry) {
|
||||
if (is_numeric($entry['rxPower']) && ($entry['rxPower'] !== '-65535')) {
|
||||
$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;
|
||||
$limit = -2/$divisor;
|
||||
$warn_limit = -3/$divisor;
|
||||
$value = $entry['rxPower']/$divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'rx-'.$index, 'pbn', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
|
||||
if (is_numeric($entry['txPower']) && ($entry['txPower'] !== '-65535')) {
|
||||
$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;
|
||||
$limit = -2/$divisor;
|
||||
$warn_limit = -3/$divisor;
|
||||
$value = $entry['txPower']/$divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-'.$index, 'pbn', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
if (is_numeric($entry['txPower']) && ($entry['txPower'] !== '-65535')) {
|
||||
$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;
|
||||
$limit = -2/$divisor;
|
||||
$warn_limit = -3/$divisor;
|
||||
$value = $entry['txPower']/$divisor;
|
||||
$entPhysicalIndex = $index;
|
||||
$entPhysicalIndex_measured = 'ports';
|
||||
discover_sensor($valid['sensor'], 'dbm', $device, $oid, 'tx-'.$index, 'pbn', $descr, $divisor, $multiplier, $limit_low, $warn_limit_low, $warn_limit, $limit, $value, 'snmp', $entPhysicalIndex, $entPhysicalIndex_measured);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,57 +23,55 @@
|
||||
* @author Neil Lathwood <[email protected]>
|
||||
*/
|
||||
|
||||
if ($device['os'] === 'vrp') {
|
||||
echo 'Huawei VRP ';
|
||||
$data = $vrp_oids['hwEntityOpticalRxPower'];
|
||||
echo 'Huawei VRP ';
|
||||
$data = $pre_cache['vrp_oids']['hwEntityOpticalRxPower'];
|
||||
|
||||
foreach ($data as $index => $value) {
|
||||
if (is_numeric($value) && $value >= 0) {
|
||||
$value = uw_to_dbm($value);
|
||||
$oid = '.1.3.6.1.4.1.2011.5.25.31.1.1.3.1.8.' . $index;
|
||||
$descr = $vrp_oids['entPhysicalName'][$index] . ' Rx';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'dbm',
|
||||
$device,
|
||||
$oid,
|
||||
'rx-' . $index,
|
||||
'vrp',
|
||||
$descr,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
70,
|
||||
75,
|
||||
$value
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$data = $vrp_oids['hwEntityOpticalTxPower'];
|
||||
|
||||
foreach ($data as $index => $value) {
|
||||
if (is_numeric($value) && $value >= 0) {
|
||||
$value = uw_to_dbm($value);
|
||||
$oid = '.1.3.6.1.4.1.2011.5.25.31.1.1.3.1.9.' . $index;
|
||||
$descr = $vrp_oids['entPhysicalName'][$index] . ' Tx';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'dbm',
|
||||
$device,
|
||||
$oid,
|
||||
'tx-' . $index,
|
||||
'vrp',
|
||||
$descr,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
70,
|
||||
75,
|
||||
$value
|
||||
);
|
||||
}
|
||||
foreach ($data as $index => $value) {
|
||||
if (is_numeric($value) && $value >= 0) {
|
||||
$value = uw_to_dbm($value);
|
||||
$oid = '.1.3.6.1.4.1.2011.5.25.31.1.1.3.1.8.' . $index;
|
||||
$descr = $pre_cache['vrp_oids']['entPhysicalName'][$index] . ' Rx';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'dbm',
|
||||
$device,
|
||||
$oid,
|
||||
'rx-' . $index,
|
||||
'vrp',
|
||||
$descr,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
70,
|
||||
75,
|
||||
$value
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$data = $pre_cache['vrp_oids']['hwEntityOpticalTxPower'];
|
||||
|
||||
foreach ($data as $index => $value) {
|
||||
if (is_numeric($value) && $value >= 0) {
|
||||
$value = uw_to_dbm($value);
|
||||
$oid = '.1.3.6.1.4.1.2011.5.25.31.1.1.3.1.9.' . $index;
|
||||
$descr = $pre_cache['vrp_oids']['entPhysicalName'][$index] . ' Tx';
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'dbm',
|
||||
$device,
|
||||
$oid,
|
||||
'tx-' . $index,
|
||||
'vrp',
|
||||
$descr,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
70,
|
||||
75,
|
||||
$value
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
echo 'Fanspeeds : ';
|
||||
|
||||
// Include all discovery modules
|
||||
$include_dir = 'includes/discovery/sensors/fanspeeds';
|
||||
require 'includes/include-dir.inc.php';
|
||||
|
||||
d_echo($valid['sensor']['fanspeed']);
|
||||
|
||||
check_valid_sensors($device, 'fanspeed', $valid['sensor']);
|
||||
|
||||
echo "\n";
|
||||
@@ -1,24 +1,21 @@
|
||||
<?php
|
||||
|
||||
// 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', '');
|
||||
d_echo($oids."\n");
|
||||
$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) {
|
||||
echo 'Areca ';
|
||||
if ($oids) {
|
||||
echo 'Areca ';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
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;
|
||||
$current = snmp_get($device, $oid, '-Oqv', '');
|
||||
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'areca', trim($descr, '"'), '1', '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
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;
|
||||
$current = snmp_get($device, $oid, '-Oqv', '');
|
||||
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'areca', trim($descr, '"'), '1', '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
}//end if
|
||||
}
|
||||
|
||||
@@ -10,20 +10,18 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if (strstr($device['hardware'], 'Dell')) {
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'coolingDeviceTable', array(), 'MIB-Dell-10892');
|
||||
$cur_oid = '.1.3.6.1.4.1.674.10892.1.700.12.1.6.';
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'coolingDeviceTable', array(), 'MIB-Dell-10892');
|
||||
$cur_oid = '.1.3.6.1.4.1.674.10892.1.700.12.1.6.';
|
||||
|
||||
if (is_array($temp)) {
|
||||
foreach ($temp as $index => $entry) {
|
||||
$descr = $temp[$index]['coolingDeviceLocationName'];
|
||||
$value = $temp[$index]['coolingDeviceReading'];
|
||||
$lowlimit = $temp[$index]['coolingDeviceLowerCriticalThreshold'];
|
||||
$low_warn_limit = $temp[$index]['coolingDeviceLowerNonCriticalThreshold'];
|
||||
$warnlimit = $temp[$index]['coolingDeviceUpperNonCriticalThreshold'];
|
||||
$limit = $temp[$index]['coolingDeviceUpperCriticalThreshold'];
|
||||
if (is_array($temp)) {
|
||||
foreach ($temp as $index => $entry) {
|
||||
$descr = $temp[$index]['coolingDeviceLocationName'];
|
||||
$value = $temp[$index]['coolingDeviceReading'];
|
||||
$lowlimit = $temp[$index]['coolingDeviceLowerCriticalThreshold'];
|
||||
$low_warn_limit = $temp[$index]['coolingDeviceLowerNonCriticalThreshold'];
|
||||
$warnlimit = $temp[$index]['coolingDeviceUpperNonCriticalThreshold'];
|
||||
$limit = $temp[$index]['coolingDeviceUpperCriticalThreshold'];
|
||||
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $cur_oid . $index, $index, 'dell', $descr, '0', '1', $lowlimit, $low_warn_limit, $warnlimit, $limit, $value, 'snmp', $index);
|
||||
}
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $cur_oid . $index, $index, 'dell', $descr, '0', '1', $lowlimit, $low_warn_limit, $warnlimit, $limit, $value, 'snmp', $index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,27 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'drac') {
|
||||
$oids = snmp_walk($device, 'coolingDevicechassisIndex.1', '-OsqnU', 'IDRAC-MIB-SMIv2');
|
||||
d_echo($oids."\n");
|
||||
$oids = snmp_walk($device, 'coolingDevicechassisIndex.1', '-OsqnU', 'IDRAC-MIB-SMIv2');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo 'Dell iDRAC';
|
||||
}
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo 'Dell iDRAC';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$kind) = explode(' ', $data);
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
$fan_oid = ".1.3.6.1.4.1.674.10892.5.4.700.12.1.6.1.$index";
|
||||
$descr_oid = "coolingDeviceLocationName.1.$index";
|
||||
$limit_oid = "coolingDeviceLowerCriticalThreshold.1.$index";
|
||||
$descr = trim(snmp_get($device, $descr_oid, '-Oqv', 'IDRAC-MIB-SMIv2'), '"');
|
||||
$descr = preg_replace('/(Board | MOD )/', '', $descr);
|
||||
$current = snmp_get($device, $fan_oid, '-Oqv', 'IDRAC-MIB-SMIv2');
|
||||
$low_limit = snmp_get($device, $limit_oid, '-Oqv', 'IDRAC-MIB-SMIv2');
|
||||
$divisor = '1';
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $fan_oid, $index, 'drac', $descr, $divisor, '1', $low_limit, null, null, null, $current);
|
||||
}
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$kind) = explode(' ', $data);
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
$fan_oid = ".1.3.6.1.4.1.674.10892.5.4.700.12.1.6.1.$index";
|
||||
$descr_oid = "coolingDeviceLocationName.1.$index";
|
||||
$limit_oid = "coolingDeviceLowerCriticalThreshold.1.$index";
|
||||
$descr = trim(snmp_get($device, $descr_oid, '-Oqv', 'IDRAC-MIB-SMIv2'), '"');
|
||||
$descr = preg_replace('/(Board | MOD )/', '', $descr);
|
||||
$current = snmp_get($device, $fan_oid, '-Oqv', 'IDRAC-MIB-SMIv2');
|
||||
$low_limit = snmp_get($device, $limit_oid, '-Oqv', 'IDRAC-MIB-SMIv2');
|
||||
$divisor = '1';
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $fan_oid, $index, 'drac', $descr, $divisor, '1', $low_limit, null, null, null, $current);
|
||||
}
|
||||
}//end if
|
||||
}
|
||||
|
||||
@@ -1,42 +1,40 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'equallogic') {
|
||||
$oids = snmp_walk($device, 'eqlMemberHealthDetailsFanName', '-OQn', 'EQLMEMBER-MIB', 'equallogic');
|
||||
$oids = snmp_walk($device, 'eqlMemberHealthDetailsFanName', '-OQn', 'EQLMEMBER-MIB', 'equallogic');
|
||||
|
||||
/*
|
||||
.1.3.6.1.4.1.12740.2.1.7.1.2.1.329840783.1 = Power Cooling Module 0 Fan 0
|
||||
.1.3.6.1.4.1.12740.2.1.7.1.2.1.329840783.2 = Power Cooling Module 0 Fan 1
|
||||
.1.3.6.1.4.1.12740.2.1.7.1.2.1.329840783.3 = Power Cooling Module 1 Fan 0
|
||||
.1.3.6.1.4.1.12740.2.1.7.1.2.1.329840783.4 = Power Cooling Module 1 Fan 1
|
||||
**/
|
||||
/*
|
||||
.1.3.6.1.4.1.12740.2.1.7.1.2.1.329840783.1 = Power Cooling Module 0 Fan 0
|
||||
.1.3.6.1.4.1.12740.2.1.7.1.2.1.329840783.2 = Power Cooling Module 0 Fan 1
|
||||
.1.3.6.1.4.1.12740.2.1.7.1.2.1.329840783.3 = Power Cooling Module 1 Fan 0
|
||||
.1.3.6.1.4.1.12740.2.1.7.1.2.1.329840783.4 = Power Cooling Module 1 Fan 1
|
||||
**/
|
||||
|
||||
d_echo($oids."\n");
|
||||
if (!empty($oids)) {
|
||||
echo 'EQLCONTROLLER-MIB ';
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if (!empty($data)) {
|
||||
list($oid,$descr) = explode(' = ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$num_index = $split_oid[(count($split_oid) - 1)];
|
||||
$index = $num_index;
|
||||
$part_oid = $split_oid[(count($split_oid) - 2)];
|
||||
$num_index = $part_oid.'.'.$num_index;
|
||||
$base_oid = '.1.3.6.1.4.1.12740.2.1.7.1.3.1.';
|
||||
$oid = $base_oid.$num_index;
|
||||
$extra = snmp_get_multi($device, "eqlMemberHealthDetailsFanValue.1.$num_index eqlMemberHealthDetailsFanCurrentState.1.$num_index eqlMemberHealthDetailsFanHighCriticalThreshold.1.$num_index eqlMemberHealthDetailsFanHighWarningThreshold.1.$num_index eqlMemberHealthDetailsFanLowCriticalThreshold.1.$num_index eqlMemberHealthDetailsFanLowWarningThreshold.1.$num_index", '-OQUs', 'EQLMEMBER-MIB', 'equallogic');
|
||||
$keys = array_keys($extra);
|
||||
$temperature = $extra[$keys[0]]['eqlMemberHealthDetailsFanValue'];
|
||||
$low_limit = $extra[$keys[0]]['eqlMemberHealthDetailsFanLowCriticalThreshold'];
|
||||
$low_warn = $extra[$keys[0]]['eqlMemberHealthDetailsFanLowWarningThreshold'];
|
||||
$high_limit = $extra[$keys[0]]['eqlMemberHealthDetailsFanHighCriticalThreshold'];
|
||||
$high_warn = $extra[$keys[0]]['eqlMemberHealthDetailsFanHighWarningThreshold'];
|
||||
$index = (100 + $index);
|
||||
d_echo($oids."\n");
|
||||
if (!empty($oids)) {
|
||||
echo 'EQLCONTROLLER-MIB ';
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if (!empty($data)) {
|
||||
list($oid,$descr) = explode(' = ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$num_index = $split_oid[(count($split_oid) - 1)];
|
||||
$index = $num_index;
|
||||
$part_oid = $split_oid[(count($split_oid) - 2)];
|
||||
$num_index = $part_oid.'.'.$num_index;
|
||||
$base_oid = '.1.3.6.1.4.1.12740.2.1.7.1.3.1.';
|
||||
$oid = $base_oid.$num_index;
|
||||
$extra = snmp_get_multi($device, "eqlMemberHealthDetailsFanValue.1.$num_index eqlMemberHealthDetailsFanCurrentState.1.$num_index eqlMemberHealthDetailsFanHighCriticalThreshold.1.$num_index eqlMemberHealthDetailsFanHighWarningThreshold.1.$num_index eqlMemberHealthDetailsFanLowCriticalThreshold.1.$num_index eqlMemberHealthDetailsFanLowWarningThreshold.1.$num_index", '-OQUs', 'EQLMEMBER-MIB', 'equallogic');
|
||||
$keys = array_keys($extra);
|
||||
$temperature = $extra[$keys[0]]['eqlMemberHealthDetailsFanValue'];
|
||||
$low_limit = $extra[$keys[0]]['eqlMemberHealthDetailsFanLowCriticalThreshold'];
|
||||
$low_warn = $extra[$keys[0]]['eqlMemberHealthDetailsFanLowWarningThreshold'];
|
||||
$high_limit = $extra[$keys[0]]['eqlMemberHealthDetailsFanHighCriticalThreshold'];
|
||||
$high_warn = $extra[$keys[0]]['eqlMemberHealthDetailsFanHighWarningThreshold'];
|
||||
$index = (100 + $index);
|
||||
|
||||
if ($extra[$keys[0]]['eqlMemberHealthDetailsFanCurrentState'] != 'unknown') {
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'snmp', $descr, 1, 1, $low_limit, $low_warn, $high_limit, $high_warn, $temperature);
|
||||
}
|
||||
}//end if
|
||||
}//end foreach
|
||||
}//end if
|
||||
if ($extra[$keys[0]]['eqlMemberHealthDetailsFanCurrentState'] != 'unknown') {
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'snmp', $descr, 1, 1, $low_limit, $low_warn, $high_limit, $high_warn, $temperature);
|
||||
}
|
||||
}//end if
|
||||
}//end foreach
|
||||
}//end if
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'xos') {
|
||||
echo(" EXTREME-BASE-MIB ");
|
||||
|
||||
// Fan Speed
|
||||
$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) {
|
||||
// fix index to a proper int
|
||||
preg_match('/^.*\.([^\.]*)$/', "$index", $matches);
|
||||
$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";
|
||||
$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
|
||||
$high_limit = round_Nth(($value * 1.5), 100);
|
||||
$high_warn_limit = round_Nth(($value * 1.25), 100);
|
||||
$low_warn_limit = round_Nth(($value * 0.75), 100);
|
||||
$low_limit = round_Nth(($value * 0.5), 100);
|
||||
if (is_numeric($value)) {
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'extreme-fanspeed', $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// EOF
|
||||
@@ -1,28 +1,26 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'f5') {
|
||||
$oids = snmp_walk($device, 'sysChassisFanSpeed', '-OsqU', 'F5-BIGIP-SYSTEM-MIB');
|
||||
$oids = snmp_walk($device, 'sysChassisFanSpeed', '-OsqU', 'F5-BIGIP-SYSTEM-MIB');
|
||||
|
||||
if ($oids) {
|
||||
d_echo($oids."\n");
|
||||
echo 'sysChassisFanSpeed ';
|
||||
if ($oids) {
|
||||
d_echo($oids."\n");
|
||||
echo 'sysChassisFanSpeed ';
|
||||
|
||||
$divisor = 1;
|
||||
$type = 'f5';
|
||||
$divisor = 1;
|
||||
$type = 'f5';
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid, $fanspeed) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$split_count = (count($split_oid) - 1);
|
||||
$index = $split_oid[$split_count];
|
||||
$descr = 'Fan Speed ' . $index;
|
||||
$oid = '.1.3.6.1.4.1.3375.2.1.3.2.1.2.1.3.' . $index;
|
||||
$fanspeed = $fanspeed / $divisor;
|
||||
if ($fanspeed >= 0) {
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $fanspeed);
|
||||
}
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid, $fanspeed) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$split_count = (count($split_oid) - 1);
|
||||
$index = $split_oid[$split_count];
|
||||
$descr = 'Fan Speed ' . $index;
|
||||
$oid = '.1.3.6.1.4.1.3375.2.1.3.2.1.2.1.3.' . $index;
|
||||
$fanspeed = $fanspeed / $divisor;
|
||||
if ($fanspeed >= 0) {
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $fanspeed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,22 +10,20 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'ibm-amm') {
|
||||
$descr_prefix = 'Blower ';
|
||||
$oids = array(
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.20.0', // BLADE-MIB:blower1speedRPM
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.21.0', // BLADE-MIB:blower2speedRPM
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.22.0', // BLADE-MIB:blower3speedRPM
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.23.0', // BLADE-MIB:blower4speedRPM
|
||||
);
|
||||
$descr_prefix = 'Blower ';
|
||||
$oids = array(
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.20.0', // BLADE-MIB:blower1speedRPM
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.21.0', // BLADE-MIB:blower2speedRPM
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.22.0', // BLADE-MIB:blower3speedRPM
|
||||
'.1.3.6.1.4.1.2.3.51.2.2.3.23.0', // BLADE-MIB:blower4speedRPM
|
||||
);
|
||||
|
||||
echo 'BLADE-MIB ';
|
||||
foreach ($oids as $index => $oid) {
|
||||
$value = trim(snmp_get($device, $oid, '-Oqv'), '"');
|
||||
echo 'BLADE-MIB ';
|
||||
foreach ($oids as $index => $oid) {
|
||||
$value = trim(snmp_get($device, $oid, '-Oqv'), '"');
|
||||
|
||||
if (is_numeric($value)) {
|
||||
$descr = $descr_prefix . ($index + 1);
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'snmp', $descr, 1, 1, null, null, null, null, $value);
|
||||
}
|
||||
if (is_numeric($value)) {
|
||||
$descr = $descr_prefix . ($index + 1);
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'snmp', $descr, 1, 1, null, null, null, null, $value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
include_once $config['install_dir'] . '/includes/discovery/sensors/fanspeeds/supermicro.inc.php';
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
// LMSensors Fanspeeds
|
||||
if ($device['os'] == 'linux' || $device['os'] == 'pktj' || $device['os'] == 'cumulus') {
|
||||
$oids = snmp_walk($device, 'lmFanSensorsDevice', '-OsqnU', 'LM-SENSORS-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo 'LM-SENSORS ';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
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;
|
||||
$current = snmp_get($device, $oid, '-Oqv', 'LM-SENSORS-MIB');
|
||||
$descr = trim(str_ireplace('fan-', '', $descr));
|
||||
if ($current !== false && $current >= 0) {
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'lmsensors', $descr, '1', '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
}//end if
|
||||
@@ -23,19 +23,16 @@
|
||||
* @author Tony Murray <[email protected]>
|
||||
*/
|
||||
|
||||
// Netonix Fan Speeds
|
||||
if ($device['os'] == 'netonix') {
|
||||
echo 'Netonix: ';
|
||||
// NETONIX-SWITCH-MIB::fanTable .1.3.6.1.4.1.46242.2
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'fanTable', array(), 'NETONIX-SWITCH-MIB', 'netonix');
|
||||
if (is_array($oids)) {
|
||||
foreach ($oids as $index => $entry) {
|
||||
if (is_numeric($entry['fanSpeed']) && is_numeric($index)) {
|
||||
$descr = "Fan ".$index;
|
||||
$oid = '.1.3.6.1.4.1.46242.2.1.2.'.$index;
|
||||
$current = $entry['fanSpeed'];
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, $device['os'], $descr, '1', '1', '0', '0', null, null, $current);
|
||||
}
|
||||
echo 'Netonix: ';
|
||||
// NETONIX-SWITCH-MIB::fanTable .1.3.6.1.4.1.46242.2
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'fanTable', array(), 'NETONIX-SWITCH-MIB', 'netonix');
|
||||
if (is_array($oids)) {
|
||||
foreach ($oids as $index => $entry) {
|
||||
if (is_numeric($entry['fanSpeed']) && is_numeric($index)) {
|
||||
$descr = "Fan ".$index;
|
||||
$oid = '.1.3.6.1.4.1.46242.2.1.2.'.$index;
|
||||
$current = $entry['fanSpeed'];
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, $device['os'], $descr, '1', '1', '0', '0', null, null, $current);
|
||||
}
|
||||
}
|
||||
}//end if
|
||||
}
|
||||
|
||||
@@ -11,22 +11,19 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
|
||||
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 = trim($oids);
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data and $data[37] == "2") {
|
||||
$value_oid = ".1.3.6.1.4.1.1588.2.1.1.1.1.22.1.4.".$data[35];
|
||||
$descr_oid = ".1.3.6.1.4.1.1588.2.1.1.1.1.22.1.5.".$data[35];
|
||||
$value = snmp_get($device, $value_oid, '-Oqv');
|
||||
$descr = snmp_get($device, $descr_oid, '-Oqv');
|
||||
if (!strstr($descr, 'No') and !strstr($value, 'No')) {
|
||||
$descr = str_replace('"', '', $descr);
|
||||
$descr = trim($descr);
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $value_oid, $data[35], 'nos', $descr, '1', '1', null, null, '80', '100', $value);
|
||||
}
|
||||
$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);
|
||||
if ($data and $data[37] == "2") {
|
||||
$value_oid = ".1.3.6.1.4.1.1588.2.1.1.1.1.22.1.4.".$data[35];
|
||||
$descr_oid = ".1.3.6.1.4.1.1588.2.1.1.1.1.22.1.5.".$data[35];
|
||||
$value = snmp_get($device, $value_oid, '-Oqv');
|
||||
$descr = snmp_get($device, $descr_oid, '-Oqv');
|
||||
if (!strstr($descr, 'No') and !strstr($value, 'No')) {
|
||||
$descr = str_replace('"', '', $descr);
|
||||
$descr = trim($descr);
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $value_oid, $data[35], 'nos', $descr, '1', '1', null, null, '80', '100', $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,24 +10,21 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'qnap') {
|
||||
echo 'QNAP: ';
|
||||
echo 'QNAP: ';
|
||||
|
||||
$fan_descr_oid = '.1.3.6.1.4.1.24681.1.2.15.1.2';
|
||||
$fan_speed_oid = '.1.3.6.1.4.1.24681.1.2.15.1.3';
|
||||
$descr_oid = '24681.1.2.15.1.2.';
|
||||
$speed_oid = '24681.1.2.15.1.3.';
|
||||
$fan_descr_oid = '.1.3.6.1.4.1.24681.1.2.15.1.2';
|
||||
$fan_speed_oid = '.1.3.6.1.4.1.24681.1.2.15.1.3';
|
||||
$descr_oid = '24681.1.2.15.1.2.';
|
||||
$speed_oid = '24681.1.2.15.1.3.';
|
||||
|
||||
$fans_descr = snmpwalk_cache_multi_oid($device, $fan_descr_oid, array());
|
||||
$fans_speed = snmpwalk_cache_multi_oid($device, $fan_speed_oid, array());
|
||||
|
||||
$fans_descr = snmpwalk_cache_multi_oid($device, $fan_descr_oid, array());
|
||||
$fans_speed = snmpwalk_cache_multi_oid($device, $fan_speed_oid, array());
|
||||
|
||||
if (is_array($fans_speed) && !empty($fans_speed)) {
|
||||
foreach ($fans_speed as $index => $entry) {
|
||||
$index = str_replace($speed_oid, '', $index);
|
||||
$fan_speed = $entry['enterprises'];
|
||||
$fan_serial = str_replace('"', '', $fans_descr[$descr_oid . $index]['enterprises']);
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $fan_speed_oid . '.' . $index, $index, 'snmp', $fan_serial, '1', '1', null, null, null, null, $fan_speed);
|
||||
}
|
||||
if (is_array($fans_speed) && !empty($fans_speed)) {
|
||||
foreach ($fans_speed as $index => $entry) {
|
||||
$index = str_replace($speed_oid, '', $index);
|
||||
$fan_speed = $entry['enterprises'];
|
||||
$fan_serial = str_replace('"', '', $fans_descr[$descr_oid . $index]['enterprises']);
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $fan_speed_oid . '.' . $index, $index, 'snmp', $fan_serial, '1', '1', null, null, null, null, $fan_speed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'routeros') {
|
||||
$descr_prefix = 'fan ';
|
||||
$oids = array(
|
||||
'.1.3.6.1.4.1.14988.1.1.3.17.0', // MIKROTIK-MIB::mtxrHlFanSpeed1.0
|
||||
'.1.3.6.1.4.1.14988.1.1.3.18.0', // MIKROTIK-MIB::mtxrHlFanSpeed2.0
|
||||
);
|
||||
echo 'MIKROTIK-MIB ';
|
||||
$descr_prefix = 'fan ';
|
||||
$oids = array(
|
||||
'.1.3.6.1.4.1.14988.1.1.3.17.0', // MIKROTIK-MIB::mtxrHlFanSpeed1.0
|
||||
'.1.3.6.1.4.1.14988.1.1.3.18.0', // MIKROTIK-MIB::mtxrHlFanSpeed2.0
|
||||
);
|
||||
|
||||
echo 'MIKROTIK-MIB ';
|
||||
foreach ($oids as $index => $oid) {
|
||||
$value = trim(snmp_get($device, $oid, '-Oqv'), '"');
|
||||
foreach ($oids as $index => $oid) {
|
||||
$value = trim(snmp_get($device, $oid, '-Oqv'), '"');
|
||||
|
||||
if (is_numeric($value)) {
|
||||
$descr = $descr_prefix . ($index + 1);
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'snmp', $descr, 1, 1, null, null, null, null, $value);
|
||||
}
|
||||
if (is_numeric($value)) {
|
||||
$descr = $descr_prefix . ($index + 1);
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'snmp', $descr, 1, 1, null, null, null, null, $value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
<?php
|
||||
// BlueCoat ProxySG Fanspeeds
|
||||
if ($device['os'] == 'sgos') {
|
||||
echo 'ProxySG ';
|
||||
$fan_index = 0;
|
||||
for ($index = 21; $index < 39; $index++) { //Proxy SG Fan OID end in 21-38
|
||||
$fanstatus_oid = ".1.3.6.1.4.1.3417.2.1.1.1.1.1.6.$index";
|
||||
$fanstatus = snmp_get($device, $fanstatus_oid, '-Oqv', 'BLUECOAT-SG-SENSOR-MIB');
|
||||
if ($fanstatus != "notInstalled") {
|
||||
$fan_oid = ".1.3.6.1.4.1.3417.2.1.1.1.1.1.5.$index";
|
||||
$descr_oid = ".1.3.6.1.4.1.3417.2.1.1.1.1.1.9.$index";
|
||||
$limit_oid = ".1.3.6.1.4.1.10876.2.1.1.1.1.6.$index";
|
||||
$descr = snmp_get($device, $descr_oid, '-Oqv', 'BLUECOAT-SG-SENSOR-MIB');
|
||||
$current = snmp_get($device, $fan_oid, '-Oqv', 'BLUECOAT-SG-SENSOR-MIB');
|
||||
$divisor = '1';
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $fan_oid, $fan_index, 'sgos', $descr, 1, '1', null, null, null, null, $current);
|
||||
}
|
||||
$fan_index++;
|
||||
}//end for
|
||||
}//end if
|
||||
|
||||
echo 'ProxySG ';
|
||||
$fan_index = 0;
|
||||
for ($index = 21; $index < 39; $index++) { //Proxy SG Fan OID end in 21-38
|
||||
$fanstatus_oid = ".1.3.6.1.4.1.3417.2.1.1.1.1.1.6.$index";
|
||||
$fanstatus = snmp_get($device, $fanstatus_oid, '-Oqv', 'BLUECOAT-SG-SENSOR-MIB');
|
||||
if ($fanstatus != "notInstalled") {
|
||||
$fan_oid = ".1.3.6.1.4.1.3417.2.1.1.1.1.1.5.$index";
|
||||
$descr_oid = ".1.3.6.1.4.1.3417.2.1.1.1.1.1.9.$index";
|
||||
$limit_oid = ".1.3.6.1.4.1.10876.2.1.1.1.1.6.$index";
|
||||
$descr = snmp_get($device, $descr_oid, '-Oqv', 'BLUECOAT-SG-SENSOR-MIB');
|
||||
$current = snmp_get($device, $fan_oid, '-Oqv', 'BLUECOAT-SG-SENSOR-MIB');
|
||||
$divisor = '1';
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $fan_oid, $fan_index, 'sgos', $descr, 1, '1', null, null, null, null, $current);
|
||||
}
|
||||
$fan_index++;
|
||||
}//end for
|
||||
|
||||
@@ -1,40 +1,37 @@
|
||||
<?php
|
||||
|
||||
// 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');
|
||||
d_echo($oids."\n");
|
||||
$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);
|
||||
if ($oids) {
|
||||
echo 'Supermicro ';
|
||||
}
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo 'Supermicro ';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$kind) = explode(' ', $data);
|
||||
$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";
|
||||
$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');
|
||||
// $divisor = snmp_get($device, $divisor_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
||||
// ^ This returns an incorrect precision. At least using the raw value... I think. -TL
|
||||
$divisor = '1';
|
||||
$monitor = snmp_get($device, $monitor_oid, '-Oqv', 'SUPERMICRO-HEALTH-MIB');
|
||||
$descr = str_replace(' Fan Speed', '', $descr);
|
||||
$descr = str_replace(' Speed', '', $descr);
|
||||
if ($monitor == 'true') {
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $fan_oid, $index, 'supermicro', $descr, $divisor, '1', $low_limit, null, null, null, $current);
|
||||
}
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$kind) = explode(' ', $data);
|
||||
$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";
|
||||
$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');
|
||||
// $divisor = snmp_get($device, $divisor_oid, "-Oqv", "SUPERMICRO-HEALTH-MIB");
|
||||
// ^ This returns an incorrect precision. At least using the raw value... I think. -TL
|
||||
$divisor = '1';
|
||||
$monitor = snmp_get($device, $monitor_oid, '-Oqv', 'SUPERMICRO-HEALTH-MIB');
|
||||
$descr = str_replace(' Fan Speed', '', $descr);
|
||||
$descr = str_replace(' Speed', '', $descr);
|
||||
if ($monitor == 'true') {
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $fan_oid, $index, 'supermicro', $descr, $divisor, '1', $low_limit, null, null, null, $current);
|
||||
}
|
||||
}//end if
|
||||
}//end foreach
|
||||
}//end if
|
||||
}
|
||||
}//end if
|
||||
}//end foreach
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
$oids = snmp_walk($device, 'lmFanSensorsDevice', '-OsqnU', 'LM-SENSORS-MIB');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo 'LM-SENSORS ';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
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;
|
||||
$current = snmp_get($device, $oid, '-Oqv', 'LM-SENSORS-MIB');
|
||||
$descr = trim(str_ireplace('fan-', '', $descr));
|
||||
if ($current !== false && $current >= 0) {
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'lmsensors', $descr, '1', '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
include_once $config['install_dir'] . '/includes/discovery/sensors/fanspeeds/supermicro.inc.php';
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
echo(" EXTREME-BASE-MIB ");
|
||||
|
||||
// Fan Speed
|
||||
$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) {
|
||||
// fix index to a proper int
|
||||
preg_match('/^.*\.([^\.]*)$/', "$index", $matches);
|
||||
$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";
|
||||
$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
|
||||
$high_limit = round_Nth(($value * 1.5), 100);
|
||||
$high_warn_limit = round_Nth(($value * 1.25), 100);
|
||||
$low_warn_limit = round_Nth(($value * 0.75), 100);
|
||||
$low_limit = round_Nth(($value * 0.5), 100);
|
||||
if (is_numeric($value)) {
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'extreme-fanspeed', $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $value);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
echo 'Frequencies: ';
|
||||
|
||||
// Include all discovery modules
|
||||
$include_dir = 'includes/discovery/sensors/frequencies';
|
||||
require 'includes/include-dir.inc.php';
|
||||
|
||||
d_echo($valid['sensor']['frequency']);
|
||||
|
||||
check_valid_sensors($device, 'frequency', $valid['sensor']);
|
||||
|
||||
echo "\n";
|
||||
@@ -1,76 +1,73 @@
|
||||
<?php
|
||||
|
||||
// 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', '');
|
||||
d_echo($oids."\n");
|
||||
$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) {
|
||||
echo 'APC In ';
|
||||
if ($oids) {
|
||||
echo 'APC In ';
|
||||
}
|
||||
|
||||
$divisor = 1;
|
||||
$type = 'apc';
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
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;
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
$divisor = 1;
|
||||
$type = 'apc';
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
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;
|
||||
$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', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids) {
|
||||
echo ' APC Out ';
|
||||
}
|
||||
|
||||
$divisor = 1;
|
||||
$type = 'apc';
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
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;
|
||||
$descr = 'Output Feed';
|
||||
if (count(explode("\n", $oids)) > 1) {
|
||||
$descr .= " $index";
|
||||
}
|
||||
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $oid, "4.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', '');
|
||||
d_echo($oids."\n");
|
||||
$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) {
|
||||
echo ' APC Out ';
|
||||
}
|
||||
if ($oids) {
|
||||
echo ' APC In ';
|
||||
list($oid,$current) = explode(' ', $oids);
|
||||
$divisor = 1;
|
||||
$type = 'apc';
|
||||
$index = '3.2.4.0';
|
||||
$descr = 'Input';
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$divisor = 1;
|
||||
$type = 'apc';
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
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;
|
||||
$descr = 'Output Feed';
|
||||
if (count(explode("\n", $oids)) > 1) {
|
||||
$descr .= " $index";
|
||||
}
|
||||
$oids = snmp_get($device, '.1.3.6.1.4.1.318.1.1.1.4.2.2.0', '-OsqnU', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $oid, "4.2.1.4.$index", $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
|
||||
$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) {
|
||||
echo ' APC In ';
|
||||
list($oid,$current) = explode(' ', $oids);
|
||||
$divisor = 1;
|
||||
$type = 'apc';
|
||||
$index = '3.2.4.0';
|
||||
$descr = 'Input';
|
||||
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', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
if ($oids) {
|
||||
echo ' APC Out ';
|
||||
list($oid,$current) = explode(' ', $oids);
|
||||
$divisor = 1;
|
||||
$type = 'apc';
|
||||
$index = '4.2.2.0';
|
||||
$descr = 'Output';
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
}//end if
|
||||
if ($oids) {
|
||||
echo ' APC Out ';
|
||||
list($oid,$current) = explode(' ', $oids);
|
||||
$divisor = 1;
|
||||
$type = 'apc';
|
||||
$index = '4.2.2.0';
|
||||
$descr = 'Output';
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
@@ -1,62 +1,57 @@
|
||||
<?php
|
||||
|
||||
// XUPS
|
||||
if ($device['os'] == 'eatonups') {
|
||||
echo 'XUPS-MIB ';
|
||||
echo 'XUPS-MIB ';
|
||||
|
||||
// XUPS-MIB::xupsInputFrequency.0 = INTEGER: 500
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsInputFrequency', array(), 'XUPS-MIB');
|
||||
// XUPS-MIB::xupsInputFrequency.0 = INTEGER: 500
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsInputFrequency', array(), 'XUPS-MIB');
|
||||
|
||||
foreach ($oids as $freq_id => $data) {
|
||||
$freq_oid = ".1.3.6.1.4.1.534.1.3.1.$freq_id";
|
||||
$descr = 'Input';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $freq_id";
|
||||
}
|
||||
$divisor = 10;
|
||||
$current = $data['xupsInputFrequency'] / $divisor;
|
||||
$type = 'xups';
|
||||
$index = '3.1.'.$freq_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
foreach ($oids as $freq_id => $data) {
|
||||
$freq_oid = ".1.3.6.1.4.1.534.1.3.1.$freq_id";
|
||||
$descr = 'Input';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $freq_id";
|
||||
}
|
||||
$divisor = 10;
|
||||
$current = $data['xupsInputFrequency'] / $divisor;
|
||||
$type = 'xups';
|
||||
$index = '3.1.'.$freq_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
// XUPS-MIB::xupsOutputFrequency.0 = INTEGER: 500
|
||||
$oids = snmpwalk_cache_oid($device, 'xupsOutputFrequency', array(), 'XUPS-MIB');
|
||||
// XUPS-MIB::xupsOutputFrequency.0 = INTEGER: 500
|
||||
$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";
|
||||
$descr = 'Output';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $freq_id";
|
||||
}
|
||||
$divisor = 10;
|
||||
$current = $data['xupsOutputFrequency'] / $divisor;
|
||||
foreach ($oids as $freq_id => $data) {
|
||||
$freq_oid = ".1.3.6.1.4.1.534.1.4.2.$freq_id";
|
||||
$descr = 'Output';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $freq_id";
|
||||
}
|
||||
$divisor = 10;
|
||||
$current = $data['xupsOutputFrequency'] / $divisor;
|
||||
$type = 'xups';
|
||||
$index = '4.2.'.$freq_id;
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
// XUPS-MIB::xupsBypassFrequency.0 = INTEGER: 500
|
||||
$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";
|
||||
$descr = 'Bypass';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $freq_id";
|
||||
}
|
||||
$divisor = 10;
|
||||
$current = $data['xupsBypassFrequency'] / $divisor;
|
||||
if ($current != '') {
|
||||
// Bypass is not always available in SNMP
|
||||
$current /= $divisor;
|
||||
$type = 'xups';
|
||||
$index = '4.2.'.$freq_id;
|
||||
$index = '5.1.'.$freq_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
|
||||
// XUPS-MIB::xupsBypassFrequency.0 = INTEGER: 500
|
||||
$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";
|
||||
$descr = 'Bypass';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $freq_id";
|
||||
}
|
||||
$divisor = 10;
|
||||
$current = $data['xupsBypassFrequency'] / $divisor;
|
||||
if ($current != '') {
|
||||
// Bypass is not always available in SNMP
|
||||
$current /= $divisor;
|
||||
$type = 'xups';
|
||||
$index = '5.1.'.$freq_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
}//end if
|
||||
}
|
||||
|
||||
@@ -1,37 +1,34 @@
|
||||
<?php
|
||||
|
||||
// IPOMANII-MIB
|
||||
if ($device['os'] == 'ipoman') {
|
||||
echo ' IPOMANII-MIB ';
|
||||
echo 'IPOMANII-MIB: ';
|
||||
|
||||
if (!is_array($cache['ipoman'])) {
|
||||
d_echo('outletConfigDesc ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigDesc', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
d_echo('outletConfigLocation ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigLocation', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
d_echo('inletConfigDesc ');
|
||||
$cache['ipoman']['in'] = snmpwalk_cache_multi_oid($device, 'inletConfigDesc', $cache['ipoman']['in'], 'IPOMANII-MIB');
|
||||
if (!is_array($cache['ipoman'])) {
|
||||
d_echo('outletConfigDesc ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigDesc', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
d_echo('outletConfigLocation ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigLocation', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
d_echo('inletConfigDesc ');
|
||||
$cache['ipoman']['in'] = snmpwalk_cache_multi_oid($device, 'inletConfigDesc', $cache['ipoman']['in'], 'IPOMANII-MIB');
|
||||
}
|
||||
|
||||
$oids = array();
|
||||
|
||||
d_echo('inletConfigFrequencyHigh ');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'inletConfigFrequencyHigh', $oids, 'IPOMANII-MIB');
|
||||
d_echo('inletConfigFrequencyLow ');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'inletConfigFrequencyLow', $oids, 'IPOMANII-MIB');
|
||||
d_echo('inletStatusFrequency ');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'inletStatusFrequency', $oids, 'IPOMANII-MIB');
|
||||
|
||||
if (is_array($oids)) {
|
||||
foreach ($oids as $index => $entry) {
|
||||
$freq_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.1.3.1.4.'.$index;
|
||||
$divisor = 10;
|
||||
$descr = (trim($cache['ipoman']['in'][$index]['inletConfigDesc'], '"') != '' ? trim($cache['ipoman']['in'][$index]['inletConfigDesc'], '"') : "Inlet $index");
|
||||
$current = ($entry['inletStatusFrequency'] / 10);
|
||||
$low_limit = $entry['inletConfigFrequencyLow'];
|
||||
$high_limit = $entry['inletConfigFrequencyHigh'];
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, 'ipoman', $descr, $divisor, '1', $low_limit, null, null, $high_limit, $current);
|
||||
// FIXME: iPoMan 1201 also says it has 2 inlets, at least until firmware 1.06 - wtf?
|
||||
}
|
||||
|
||||
$oids = array();
|
||||
|
||||
d_echo('inletConfigFrequencyHigh ');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'inletConfigFrequencyHigh', $oids, 'IPOMANII-MIB');
|
||||
d_echo('inletConfigFrequencyLow ');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'inletConfigFrequencyLow', $oids, 'IPOMANII-MIB');
|
||||
d_echo('inletStatusFrequency ');
|
||||
$oids = snmpwalk_cache_multi_oid($device, 'inletStatusFrequency', $oids, 'IPOMANII-MIB');
|
||||
|
||||
if (is_array($oids)) {
|
||||
foreach ($oids as $index => $entry) {
|
||||
$freq_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.1.3.1.4.'.$index;
|
||||
$divisor = 10;
|
||||
$descr = (trim($cache['ipoman']['in'][$index]['inletConfigDesc'], '"') != '' ? trim($cache['ipoman']['in'][$index]['inletConfigDesc'], '"') : "Inlet $index");
|
||||
$current = ($entry['inletStatusFrequency'] / 10);
|
||||
$low_limit = $entry['inletConfigFrequencyLow'];
|
||||
$high_limit = $entry['inletConfigFrequencyHigh'];
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, 'ipoman', $descr, $divisor, '1', $low_limit, null, null, $high_limit, $current);
|
||||
// FIXME: iPoMan 1201 also says it has 2 inlets, at least until firmware 1.06 - wtf?
|
||||
}
|
||||
}
|
||||
}//end if
|
||||
}
|
||||
|
||||
@@ -1,53 +1,50 @@
|
||||
<?php
|
||||
|
||||
// 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'));
|
||||
d_echo($oids."\n");
|
||||
echo 'MGE ';
|
||||
$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));
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$freq_oid = ".1.3.6.1.4.1.705.1.7.2.1.3.$i";
|
||||
$descr = 'Output';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$current = snmp_get($device, $freq_oid, '-Oqv');
|
||||
if (!$current) {
|
||||
$freq_oid .= '.0';
|
||||
$current = snmp_get($device, $freq_oid, '-Oqv');
|
||||
}
|
||||
|
||||
$current /= 10;
|
||||
$type = 'mge-ups';
|
||||
$divisor = 10;
|
||||
$index = $i;
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
$numPhase = count(explode("\n", $oids));
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$freq_oid = ".1.3.6.1.4.1.705.1.7.2.1.3.$i";
|
||||
$descr = 'Output';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$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));
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$freq_oid = ".1.3.6.1.4.1.705.1.6.2.1.3.$i";
|
||||
$descr = 'Input';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$current = snmp_get($device, $freq_oid, '-Oqv');
|
||||
if (!$current) {
|
||||
$freq_oid .= '.0';
|
||||
$current = snmp_get($device, $freq_oid, '-Oqv');
|
||||
}
|
||||
|
||||
$current /= 10;
|
||||
$type = 'mge-ups';
|
||||
$divisor = 10;
|
||||
$index = (100 + $i);
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
$current = snmp_get($device, $freq_oid, '-Oqv');
|
||||
if (!$current) {
|
||||
$freq_oid .= '.0';
|
||||
$current = snmp_get($device, $freq_oid, '-Oqv');
|
||||
}
|
||||
}//end if
|
||||
|
||||
$current /= 10;
|
||||
$type = 'mge-ups';
|
||||
$divisor = 10;
|
||||
$index = $i;
|
||||
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'));
|
||||
d_echo($oids."\n");
|
||||
|
||||
$numPhase = count(explode("\n", $oids));
|
||||
for ($i = 1; $i <= $numPhase; $i++) {
|
||||
$freq_oid = ".1.3.6.1.4.1.705.1.6.2.1.3.$i";
|
||||
$descr = 'Input';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$current = snmp_get($device, $freq_oid, '-Oqv');
|
||||
if (!$current) {
|
||||
$freq_oid .= '.0';
|
||||
$current = snmp_get($device, $freq_oid, '-Oqv');
|
||||
}
|
||||
|
||||
$current /= 10;
|
||||
$type = 'mge-ups';
|
||||
$divisor = 10;
|
||||
$index = (100 + $i);
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
@@ -23,68 +23,66 @@
|
||||
* @author Tony Murray <[email protected]>
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'netagent2') {
|
||||
$in_frequency_oid = '.1.3.6.1.4.1.935.1.1.1.3.2.4.0';
|
||||
$in_frequency = snmp_get($device, $in_frequency_oid, '-Oqv');
|
||||
$in_frequency_oid = '.1.3.6.1.4.1.935.1.1.1.3.2.4.0';
|
||||
$in_frequency = snmp_get($device, $in_frequency_oid, '-Oqv');
|
||||
|
||||
if (!empty($in_frequency) || $in_frequency == 0) {
|
||||
$type = 'netagent2';
|
||||
$index = 0;
|
||||
$limit = 60;
|
||||
$warnlimit = 51;
|
||||
$lowlimit = 0;
|
||||
$lowwarnlimit = 49;
|
||||
$divisor = 10;
|
||||
$frequency = $in_frequency / $divisor;
|
||||
$descr = 'Input frequency';
|
||||
if (!empty($in_frequency) || $in_frequency == 0) {
|
||||
$type = 'netagent2';
|
||||
$index = 0;
|
||||
$limit = 60;
|
||||
$warnlimit = 51;
|
||||
$lowlimit = 0;
|
||||
$lowwarnlimit = 49;
|
||||
$divisor = 10;
|
||||
$frequency = $in_frequency / $divisor;
|
||||
$descr = 'Input frequency';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'frequency',
|
||||
$device,
|
||||
$in_frequency_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
$lowlimit,
|
||||
$lowwarnlimit,
|
||||
$warnlimit,
|
||||
$limit,
|
||||
$frequency
|
||||
);
|
||||
}
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'frequency',
|
||||
$device,
|
||||
$in_frequency_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
$lowlimit,
|
||||
$lowwarnlimit,
|
||||
$warnlimit,
|
||||
$limit,
|
||||
$frequency
|
||||
);
|
||||
}
|
||||
|
||||
$out_frequency_oid = '.1.3.6.1.4.1.935.1.1.1.4.2.2.0';
|
||||
$out_frequency = snmp_get($device, $frequency_oid, '-Oqv');
|
||||
$out_frequency_oid = '.1.3.6.1.4.1.935.1.1.1.4.2.2.0';
|
||||
$out_frequency = snmp_get($device, $frequency_oid, '-Oqv');
|
||||
|
||||
if (!empty($out_frequency) || $out_frequency == 0) {
|
||||
$type = 'netagent2';
|
||||
$index = 1;
|
||||
$limit = 60;
|
||||
$warnlimit = 51;
|
||||
$lowlimit = 0;
|
||||
$lowwarnlimit = 49;
|
||||
$divisor = 10;
|
||||
$frequency = $out_frequency / $divisor;
|
||||
$descr = 'Output frequency';
|
||||
if (!empty($out_frequency) || $out_frequency == 0) {
|
||||
$type = 'netagent2';
|
||||
$index = 1;
|
||||
$limit = 60;
|
||||
$warnlimit = 51;
|
||||
$lowlimit = 0;
|
||||
$lowwarnlimit = 49;
|
||||
$divisor = 10;
|
||||
$frequency = $out_frequency / $divisor;
|
||||
$descr = 'Output frequency';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'frequency',
|
||||
$device,
|
||||
$out_frequency_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
$lowlimit,
|
||||
$lowwarnlimit,
|
||||
$warnlimit,
|
||||
$limit,
|
||||
$frequency
|
||||
);
|
||||
}
|
||||
}//end if
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'frequency',
|
||||
$device,
|
||||
$out_frequency_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
$lowlimit,
|
||||
$lowwarnlimit,
|
||||
$warnlimit,
|
||||
$limit,
|
||||
$frequency
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'netvision') {
|
||||
$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);
|
||||
$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);
|
||||
|
||||
$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);
|
||||
}
|
||||
$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);
|
||||
|
||||
@@ -1,38 +1,35 @@
|
||||
<?php
|
||||
|
||||
// XUPS
|
||||
if ($device['os'] == 'powerware') {
|
||||
echo 'XUPS-MIB ';
|
||||
echo 'XUPS-MIB ';
|
||||
|
||||
// I'm not sure if there is provision for frequency of multiple phases in this MIB -TL
|
||||
// XUPS-MIB::xupsInputFrequency.0 = INTEGER: 500
|
||||
$freq_oid = '.1.3.6.1.4.1.534.1.3.1.0';
|
||||
$descr = 'Input';
|
||||
$divisor = 10;
|
||||
$current = (snmp_get($device, $freq_oid, '-Oqv') / $divisor);
|
||||
// I'm not sure if there is provision for frequency of multiple phases in this MIB -TL
|
||||
// XUPS-MIB::xupsInputFrequency.0 = INTEGER: 500
|
||||
$freq_oid = '.1.3.6.1.4.1.534.1.3.1.0';
|
||||
$descr = 'Input';
|
||||
$divisor = 10;
|
||||
$current = (snmp_get($device, $freq_oid, '-Oqv') / $divisor);
|
||||
$type = 'xups';
|
||||
$index = '3.1.0';
|
||||
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';
|
||||
$descr = 'Output';
|
||||
$divisor = 10;
|
||||
$current = (snmp_get($device, $freq_oid, '-Oqv') / $divisor);
|
||||
$type = 'xups';
|
||||
$index = '4.2.0';
|
||||
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';
|
||||
$descr = 'Bypass';
|
||||
$divisor = 10;
|
||||
$current = snmp_get($device, $freq_oid, '-Oqv');
|
||||
if ($current != '') {
|
||||
// Bypass is not always available in SNMP
|
||||
$current /= $divisor;
|
||||
$type = 'xups';
|
||||
$index = '3.1.0';
|
||||
$index = '5.1.0';
|
||||
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';
|
||||
$descr = 'Output';
|
||||
$divisor = 10;
|
||||
$current = (snmp_get($device, $freq_oid, '-Oqv') / $divisor);
|
||||
$type = 'xups';
|
||||
$index = '4.2.0';
|
||||
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';
|
||||
$descr = 'Bypass';
|
||||
$divisor = 10;
|
||||
$current = snmp_get($device, $freq_oid, '-Oqv');
|
||||
if ($current != '') {
|
||||
// Bypass is not always available in SNMP
|
||||
$current /= $divisor;
|
||||
$type = 'xups';
|
||||
$index = '5.1.0';
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
}//end if
|
||||
}
|
||||
|
||||
@@ -1,27 +1,25 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'raritan') {
|
||||
// Check Inlets
|
||||
$inlet_oids = snmp_walk($device, 'inletLabel', '-Osqn', 'PDU2-MIB');
|
||||
$inlet_oids = trim($inlet_oids);
|
||||
if ($inlet_oids) {
|
||||
echo 'PDU Inlet ';
|
||||
}
|
||||
// Check Inlets
|
||||
$inlet_oids = snmp_walk($device, 'inletLabel', '-Osqn', 'PDU2-MIB');
|
||||
$inlet_oids = trim($inlet_oids);
|
||||
if ($inlet_oids) {
|
||||
echo 'PDU Inlet ';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $inlet_oids) as $inlet_data) {
|
||||
$inlet_data = trim($inlet_data);
|
||||
if ($inlet_data) {
|
||||
list($inlet_oid,$inlet_descr) = explode(' ', $inlet_data, 2);
|
||||
$inlet_split_oid = explode('.', $inlet_oid);
|
||||
$inlet_index = $inlet_split_oid[(count($inlet_split_oid) - 2)].'.'.$inlet_split_oid[(count($inlet_split_oid) - 1)];
|
||||
foreach (explode("\n", $inlet_oids) as $inlet_data) {
|
||||
$inlet_data = trim($inlet_data);
|
||||
if ($inlet_data) {
|
||||
list($inlet_oid,$inlet_descr) = explode(' ', $inlet_data, 2);
|
||||
$inlet_split_oid = explode('.', $inlet_oid);
|
||||
$inlet_index = $inlet_split_oid[(count($inlet_split_oid) - 2)].'.'.$inlet_split_oid[(count($inlet_split_oid) - 1)];
|
||||
|
||||
$inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.$inlet_index.23";
|
||||
$inlet_divisor = pow(10, snmp_get($device, "inletSensorDecimalDigits.$inlet_index.frequency", '-Ovq', 'PDU2-MIB'));
|
||||
$inlet_frequency = (snmp_get($device, "measurementsInletSensorValue.$inlet_index.frequency", '-Ovq', 'PDU2-MIB') / $inlet_divisor);
|
||||
$inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.$inlet_index.23";
|
||||
$inlet_divisor = pow(10, snmp_get($device, "inletSensorDecimalDigits.$inlet_index.frequency", '-Ovq', 'PDU2-MIB'));
|
||||
$inlet_frequency = (snmp_get($device, "measurementsInletSensorValue.$inlet_index.frequency", '-Ovq', 'PDU2-MIB') / $inlet_divisor);
|
||||
|
||||
if ($inlet_frequency >= 0) {
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $inlet_oid, $inlet_index, 'raritan', $inlet_descr, $inlet_divisor, 1, null, null, null, null, $inlet_frequency);
|
||||
}
|
||||
if ($inlet_frequency >= 0) {
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $inlet_oid, $inlet_index, 'raritan', $inlet_descr, $inlet_divisor, 1, null, null, null, null, $inlet_frequency);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,40 @@
|
||||
<?php
|
||||
|
||||
// RFC1628 UPS
|
||||
if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modules_compat']['rfc1628'][$device['os']]) {
|
||||
echo 'RFC1628 ';
|
||||
echo 'RFC1628 ';
|
||||
|
||||
$oids = trim(snmp_walk($device, '.1.3.6.1.2.1.33.1.3.2.0', '-OsqnU'));
|
||||
d_echo($oids."\n");
|
||||
$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";
|
||||
$descr = 'Input';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$current = (snmp_get($device, $freq_oid, '-Oqv') / 10);
|
||||
$type = 'rfc1628';
|
||||
$divisor = get_device_divisor($device, $_tmp_serial, 'frequencies');
|
||||
|
||||
$index = '3.2.0.'.$i;
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
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";
|
||||
$descr = 'Input';
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
|
||||
$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';
|
||||
$divisor = get_device_divisor($device, $_tmp_serial, 'frequencies');
|
||||
$current = (snmp_get($device, $freq_oid, '-Oqv') / 10);
|
||||
$type = 'rfc1628';
|
||||
$divisor = get_device_divisor($device, $pre_cache['poweralert_serial'], 'frequencies');
|
||||
|
||||
$index = '4.2.0';
|
||||
$index = '3.2.0.'.$i;
|
||||
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';
|
||||
$descr = 'Bypass';
|
||||
$current = (snmp_get($device, $freq_oid, '-Oqv') / 10);
|
||||
$type = 'rfc1628';
|
||||
$divisor = get_device_divisor($device, $_tmp_serial, 'frequencies');
|
||||
$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';
|
||||
$divisor = get_device_divisor($device, $pre_cache['poweralert_serial'], 'frequencies');
|
||||
|
||||
$index = '5.1.0';
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}//end if
|
||||
$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';
|
||||
$descr = 'Bypass';
|
||||
$current = (snmp_get($device, $freq_oid, '-Oqv') / 10);
|
||||
$type = 'rfc1628';
|
||||
$divisor = get_device_divisor($device, $pre_cache['poweralert_serial'], 'frequencies');
|
||||
|
||||
$index = '5.1.0';
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $freq_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
|
||||
@@ -23,49 +23,46 @@
|
||||
* @author Tony Murray <[email protected]>
|
||||
*/
|
||||
|
||||
$output_oid = '.1.3.6.1.4.1.13891.101.4.2.0';
|
||||
$output_current = snmp_get($device, $output_oid, '-Oqv');
|
||||
|
||||
if ($device['os'] == 'sinetica') {
|
||||
$output_oid = '.1.3.6.1.4.1.13891.101.4.2.0';
|
||||
$output_current = snmp_get($device, $output_oid, '-Oqv');
|
||||
if (!empty($output_current) || $output_current == 0) {
|
||||
$divisor = 10;
|
||||
$current = $output_current / $divisor;
|
||||
$descr = 'Output';
|
||||
$type = 'sinetica';
|
||||
$index = '4.2.0';
|
||||
|
||||
if (!empty($output_current) || $output_current == 0) {
|
||||
$divisor = 10;
|
||||
$current = $output_current / $divisor;
|
||||
$descr = 'Output';
|
||||
$type = 'sinetica';
|
||||
$index = '4.2.0';
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $output_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $output_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
$bypass_oid = '.1.3.6.1.4.1.13891.101.5.1.0';
|
||||
$bypass_current = snmp_get($device, $bypass_oid, '-Oqv');
|
||||
|
||||
if (!empty($bypass_current) || $bypass_current == 0) {
|
||||
$divisor = 10;
|
||||
$current = $bypass_current / $divisor;
|
||||
$descr = 'Bypass';
|
||||
$type = 'sinetica';
|
||||
$index = '5.1.0';
|
||||
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $bypass_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.3.3.1.2', array());
|
||||
|
||||
foreach ($oids as $oid => $data) {
|
||||
$current_id = substr($oid, strrpos($oid, '.') + 1);
|
||||
|
||||
$current_oid = ".$oid";
|
||||
$descr = 'Input';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $current_id";
|
||||
}
|
||||
$divisor = 10;
|
||||
$current = current($data) / $divisor;
|
||||
$type = 'sinetica';
|
||||
$index = '3.3.1.2.'.$current_id;
|
||||
|
||||
$bypass_oid = '.1.3.6.1.4.1.13891.101.5.1.0';
|
||||
$bypass_current = snmp_get($device, $bypass_oid, '-Oqv');
|
||||
|
||||
if (!empty($bypass_current) || $bypass_current == 0) {
|
||||
$divisor = 10;
|
||||
$current = $bypass_current / $divisor;
|
||||
$descr = 'Bypass';
|
||||
$type = 'sinetica';
|
||||
$index = '5.1.0';
|
||||
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $bypass_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.3.3.1.2', array());
|
||||
|
||||
foreach ($oids as $oid => $data) {
|
||||
$current_id = substr($oid, strrpos($oid, '.') + 1);
|
||||
|
||||
$current_oid = ".$oid";
|
||||
$descr = 'Input';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $current_id";
|
||||
}
|
||||
$divisor = 10;
|
||||
$current = current($data) / $divisor;
|
||||
$type = 'sinetica';
|
||||
$index = '3.3.1.2.'.$current_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
}//end if
|
||||
discover_sensor($valid['sensor'], 'frequency', $device, $current_oid, $index, $type, $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
echo 'Humidity : ';
|
||||
|
||||
// Include all discovery modules
|
||||
$include_dir = 'includes/discovery/sensors/humidity';
|
||||
require 'includes/include-dir.inc.php';
|
||||
|
||||
d_echo($valid['sensor']['humidity']);
|
||||
|
||||
check_valid_sensors($device, 'humidity', $valid['sensor']);
|
||||
|
||||
echo "\n";
|
||||
@@ -1,38 +1,36 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'akcp' || $device['os'] == 'minkelsrms') {
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.3854.1.2.2.1.16.1.4', '-Osqn', '');
|
||||
d_echo($oids."\n");
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.3854.1.2.2.1.16.1.4', '-Osqn', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo 'AKCP ';
|
||||
}
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo 'AKCP ';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$status) = explode(' ', $data, 2);
|
||||
if ($status == 2) {
|
||||
// 2 = normal, 0 = not connected
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
$descr_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.1.$index";
|
||||
$oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.3.$index";
|
||||
$warnlimit_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.7.$index";
|
||||
$limit_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.8.$index";
|
||||
$warnlowlimit_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.9.$index";
|
||||
$lowlimit_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.10.$index";
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$status) = explode(' ', $data, 2);
|
||||
if ($status == 2) {
|
||||
// 2 = normal, 0 = not connected
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
$descr_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.1.$index";
|
||||
$oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.3.$index";
|
||||
$warnlimit_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.7.$index";
|
||||
$limit_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.8.$index";
|
||||
$warnlowlimit_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.9.$index";
|
||||
$lowlimit_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.10.$index";
|
||||
|
||||
$descr = trim(snmp_get($device, $descr_oid, '-Oqv', ''), '"');
|
||||
$humidity = snmp_get($device, $oid, '-Oqv', '');
|
||||
$warnlimit = snmp_get($device, $warnlimit_oid, '-Oqv', '');
|
||||
$limit = snmp_get($device, $limit_oid, '-Oqv', '');
|
||||
$lowlimit = snmp_get($device, $lowlimit_oid, '-Oqv', '');
|
||||
$warnlowlimit = snmp_get($device, $warnlowlimit_oid, '-Oqv', '');
|
||||
$descr = trim(snmp_get($device, $descr_oid, '-Oqv', ''), '"');
|
||||
$humidity = snmp_get($device, $oid, '-Oqv', '');
|
||||
$warnlimit = snmp_get($device, $warnlimit_oid, '-Oqv', '');
|
||||
$limit = snmp_get($device, $limit_oid, '-Oqv', '');
|
||||
$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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,18 +23,16 @@
|
||||
* @author Neil Lathwood <[email protected]>
|
||||
*/
|
||||
|
||||
if ($device['os'] === 'aos-emu2') {
|
||||
foreach ($emu2_temp as $id => $temp) {
|
||||
if (isset($temp['emsProbeStatusProbeHumidity']) && $temp['emsProbeStatusProbeHumidity'] > 0) {
|
||||
$index = $temp['emsProbeStatusProbeIndex'];
|
||||
$oid = '.1.3.6.1.4.1.318.1.1.10.3.13.1.1.6.' . $index;
|
||||
$descr = $temp['emsProbeStatusProbeName'];
|
||||
$low_limit = $temp['emsProbeStatusProbeMinHumidityThresh'];
|
||||
$low_warn_limit = $temp['emsProbeStatusProbeLowHumidityThresh'];
|
||||
$high_limit = $temp['emsProbeStatusProbeMaxHumidityThresh'];
|
||||
$high_warn_limit = $temp['emsProbeStatusProbeHighHumidityThresh'];
|
||||
$current = $temp['emsProbeStatusProbeHumidity'];
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $oid, $index, 'aos-emu2', $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
foreach ($emu2_temp as $id => $temp) {
|
||||
if (isset($temp['emsProbeStatusProbeHumidity']) && $temp['emsProbeStatusProbeHumidity'] > 0) {
|
||||
$index = $temp['emsProbeStatusProbeIndex'];
|
||||
$oid = '.1.3.6.1.4.1.318.1.1.10.3.13.1.1.6.' . $index;
|
||||
$descr = $temp['emsProbeStatusProbeName'];
|
||||
$low_limit = $temp['emsProbeStatusProbeMinHumidityThresh'];
|
||||
$low_warn_limit = $temp['emsProbeStatusProbeLowHumidityThresh'];
|
||||
$high_limit = $temp['emsProbeStatusProbeMaxHumidityThresh'];
|
||||
$high_warn_limit = $temp['emsProbeStatusProbeHighHumidityThresh'];
|
||||
$current = $temp['emsProbeStatusProbeHumidity'];
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $oid, $index, 'aos-emu2', $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,44 +1,41 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'apc') {
|
||||
// Environmental monitoring on UPSes etc
|
||||
// FIXME emConfigProbesTable may also be used? But not filled out on my device...
|
||||
$apc_env_data = snmpwalk_cache_oid($device, 'iemConfigProbesTable', array(), 'PowerNet-MIB');
|
||||
$apc_env_data = snmpwalk_cache_oid($device, 'iemStatusProbesTable', $apc_env_data, 'PowerNet-MIB');
|
||||
// Environmental monitoring on UPSes etc
|
||||
// FIXME emConfigProbesTable may also be used? But not filled out on my device...
|
||||
$apc_env_data = snmpwalk_cache_oid($device, 'iemConfigProbesTable', array(), 'PowerNet-MIB');
|
||||
$apc_env_data = snmpwalk_cache_oid($device, 'iemStatusProbesTable', $apc_env_data, 'PowerNet-MIB');
|
||||
|
||||
foreach (array_keys($apc_env_data) as $index) {
|
||||
$descr = $apc_env_data[$index]['iemStatusProbeName'];
|
||||
$current = $apc_env_data[$index]['iemStatusProbeCurrentHumid'];
|
||||
$sensorType = 'apc';
|
||||
$oid = '.1.3.6.1.4.1.318.1.1.10.2.3.2.1.6.'.$index;
|
||||
$low_limit = ($apc_env_data[$index]['iemConfigProbeMinHumidEnable'] != 'disabled' ? $apc_env_data[$index]['iemConfigProbeMinHumidThreshold'] : null);
|
||||
$low_warn_limit = ($apc_env_data[$index]['iemConfigProbeLowHumidEnable'] != 'disabled' ? $apc_env_data[$index]['iemConfigProbeLowHumidThreshold'] : null);
|
||||
$high_warn_limit = ($apc_env_data[$index]['iemConfigProbeHighHumidEnable'] != 'disabled' ? $apc_env_data[$index]['iemConfigProbeHighHumidThreshold'] : null);
|
||||
$high_limit = ($apc_env_data[$index]['iemConfigProbeMaxHumidEnable'] != 'disabled' ? $apc_env_data[$index]['iemConfigProbeMaxHumidThreshold'] : null);
|
||||
foreach (array_keys($apc_env_data) as $index) {
|
||||
$descr = $apc_env_data[$index]['iemStatusProbeName'];
|
||||
$current = $apc_env_data[$index]['iemStatusProbeCurrentHumid'];
|
||||
$sensorType = 'apc';
|
||||
$oid = '.1.3.6.1.4.1.318.1.1.10.2.3.2.1.6.'.$index;
|
||||
$low_limit = ($apc_env_data[$index]['iemConfigProbeMinHumidEnable'] != 'disabled' ? $apc_env_data[$index]['iemConfigProbeMinHumidThreshold'] : null);
|
||||
$low_warn_limit = ($apc_env_data[$index]['iemConfigProbeLowHumidEnable'] != 'disabled' ? $apc_env_data[$index]['iemConfigProbeLowHumidThreshold'] : null);
|
||||
$high_warn_limit = ($apc_env_data[$index]['iemConfigProbeHighHumidEnable'] != 'disabled' ? $apc_env_data[$index]['iemConfigProbeHighHumidThreshold'] : null);
|
||||
$high_limit = ($apc_env_data[$index]['iemConfigProbeMaxHumidEnable'] != 'disabled' ? $apc_env_data[$index]['iemConfigProbeMaxHumidThreshold'] : null);
|
||||
|
||||
if ($current > 0) {
|
||||
// Humidity = 0 -> Sensor not available
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $oid, $index, $sensorType, $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
|
||||
$apc_env_data = snmpwalk_cache_oid($device, 'emsProbeStatus', array(), 'PowerNet-MIB');
|
||||
|
||||
foreach (array_keys($apc_env_data) as $index) {
|
||||
if ($apc_env_data[$index]['emsProbeStatusProbeCommStatus'] != 'commsNeverDiscovered') {
|
||||
$descr = $apc_env_data[$index]['emsProbeStatusProbeName'];
|
||||
$current = $apc_env_data[$index]['emsProbeStatusProbeHumidity'];
|
||||
$sensorType = 'apc';
|
||||
$oid = '.1.3.6.1.4.1.318.1.1.10.3.13.1.1.6.' . $index;
|
||||
$low_limit = $apc_env_data[$index]['emsProbeStatusProbeMinHumidityThresh'];
|
||||
$low_warn_limit = $apc_env_data[$index]['emsProbeStatusProbeLowHumidityThresh'];
|
||||
$high_warn_limit = $apc_env_data[$index]['emsProbeStatusProbeHighHumidityThresh'];
|
||||
$high_limit = $apc_env_data[$index]['emsProbeStatusProbeMaxHumidityThresh'];
|
||||
|
||||
if ($current > 0) {
|
||||
// Humidity = 0 -> Sensor not available
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $oid, $index, $sensorType, $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$apc_env_data = snmpwalk_cache_oid($device, 'emsProbeStatus', array(), 'PowerNet-MIB');
|
||||
|
||||
foreach (array_keys($apc_env_data) as $index) {
|
||||
if ($apc_env_data[$index]['emsProbeStatusProbeCommStatus'] != 'commsNeverDiscovered') {
|
||||
$descr = $apc_env_data[$index]['emsProbeStatusProbeName'];
|
||||
$current = $apc_env_data[$index]['emsProbeStatusProbeHumidity'];
|
||||
$sensorType = 'apc';
|
||||
$oid = '.1.3.6.1.4.1.318.1.1.10.3.13.1.1.6.' . $index;
|
||||
$low_limit = $apc_env_data[$index]['emsProbeStatusProbeMinHumidityThresh'];
|
||||
$low_warn_limit = $apc_env_data[$index]['emsProbeStatusProbeLowHumidityThresh'];
|
||||
$high_warn_limit = $apc_env_data[$index]['emsProbeStatusProbeHighHumidityThresh'];
|
||||
$high_limit = $apc_env_data[$index]['emsProbeStatusProbeMaxHumidityThresh'];
|
||||
|
||||
if ($current > 0) {
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $oid, $index, $sensorType, $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
}
|
||||
}//end if
|
||||
}
|
||||
|
||||
@@ -10,14 +10,12 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'hwg-ste2') {
|
||||
d_echo('HWg STE2 Humidity ');
|
||||
$oid = '.1.3.6.1.4.1.21796.4.9.3.1.4.1';
|
||||
$sensorType = 'ste2_humidity';
|
||||
$descr = 'Input 1 Humidity';
|
||||
$humidity = snmp_get($device, $oid, '-Osqnv');
|
||||
d_echo('HWg STE2 Humidity ');
|
||||
$oid = '.1.3.6.1.4.1.21796.4.9.3.1.4.1';
|
||||
$sensorType = 'ste2_humidity';
|
||||
$descr = 'Input 1 Humidity';
|
||||
$humidity = snmp_get($device, $oid, '-Osqnv');
|
||||
|
||||
if ($humidity !== false) {
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $oid, '1', $sensorType, $descr, '1', '1', null, null, null, null, $humidity);
|
||||
}
|
||||
if ($humidity !== false) {
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $oid, '1', $sensorType, $descr, '1', '1', null, null, null, null, $humidity);
|
||||
}
|
||||
|
||||
@@ -2,21 +2,19 @@
|
||||
|
||||
// FIXME: EMD "stack" support
|
||||
// FIXME: What to do with IPOMANII-MIB::ipmEnvEmdConfigHumiOffset.0 ?
|
||||
if ($device['os'] == 'ipoman') {
|
||||
echo ' IPOMANII-MIB ';
|
||||
$emd_installed = snmp_get($device, 'IPOMANII-MIB::ipmEnvEmdStatusEmdType.0', ' -Oqv');
|
||||
echo ' IPOMANII-MIB ';
|
||||
$emd_installed = snmp_get($device, 'IPOMANII-MIB::ipmEnvEmdStatusEmdType.0', ' -Oqv');
|
||||
|
||||
if ($emd_installed == 'eMD-HT') {
|
||||
$descr = snmp_get($device, 'IPOMANII-MIB::ipmEnvEmdConfigHumiName.0', '-Oqv');
|
||||
$current = (snmp_get($device, 'IPOMANII-MIB::ipmEnvEmdStatusHumidity.0', '-Oqv') / 10);
|
||||
$high_limit = snmp_get($device, 'IPOMANII-MIB::ipmEnvEmdConfigHumiHighSetPoint.0', '-Oqv');
|
||||
$low_limit = snmp_get($device, 'IPOMANII-MIB::ipmEnvEmdConfigHumiLowSetPoint.0', '-Oqv');
|
||||
if ($emd_installed == 'eMD-HT') {
|
||||
$descr = snmp_get($device, 'IPOMANII-MIB::ipmEnvEmdConfigHumiName.0', '-Oqv');
|
||||
$current = (snmp_get($device, 'IPOMANII-MIB::ipmEnvEmdStatusHumidity.0', '-Oqv') / 10);
|
||||
$high_limit = snmp_get($device, 'IPOMANII-MIB::ipmEnvEmdConfigHumiHighSetPoint.0', '-Oqv');
|
||||
$low_limit = snmp_get($device, 'IPOMANII-MIB::ipmEnvEmdConfigHumiLowSetPoint.0', '-Oqv');
|
||||
|
||||
if ($descr != '' && is_numeric($current) && $current > '0') {
|
||||
$current_oid = '.1.3.6.1.4.1.2468.1.4.2.1.5.1.1.3.0';
|
||||
$descr = trim(str_replace('"', '', $descr));
|
||||
if ($descr != '' && is_numeric($current) && $current > '0') {
|
||||
$current_oid = '.1.3.6.1.4.1.2468.1.4.2.1.5.1.1.3.0';
|
||||
$descr = trim(str_replace('"', '', $descr));
|
||||
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $current_oid, '1', 'ipoman', $descr, '10', '1', $low_limit, null, null, $high_limit, $current);
|
||||
}
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $current_oid, '1', 'ipoman', $descr, '10', '1', $low_limit, null, null, $high_limit, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,61 +1,58 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'mgeups') {
|
||||
// blatently copyied from APC
|
||||
echo 'MGE UPS External ';
|
||||
echo 'MGE UPS External ';
|
||||
|
||||
// Environmental monitoring on UPSes etc
|
||||
// FIXME upsmgConfigEnvironmentTable and upsmgEnvironmentSensorTable are used but there are others ...
|
||||
$mge_env_data = snmpwalk_cache_oid($device, 'upsmgConfigEnvironmentTable', array(), 'MG-SNMP-UPS-MIB');
|
||||
$mge_env_data = snmpwalk_cache_oid($device, 'upsmgEnvironmentSensorTable', $mge_env_data, 'MG-SNMP-UPS-MIB');
|
||||
// Environmental monitoring on UPSes etc
|
||||
// FIXME upsmgConfigEnvironmentTable and upsmgEnvironmentSensorTable are used but there are others ...
|
||||
$mge_env_data = snmpwalk_cache_oid($device, 'upsmgConfigEnvironmentTable', array(), 'MG-SNMP-UPS-MIB');
|
||||
$mge_env_data = snmpwalk_cache_oid($device, 'upsmgEnvironmentSensorTable', $mge_env_data, 'MG-SNMP-UPS-MIB');
|
||||
|
||||
/*
|
||||
upsmgConfigSensorIndex.1 = 1
|
||||
upsmgConfigSensorName.1 = "Environment sensor"
|
||||
upsmgConfigTemperatureLow.1 = 5
|
||||
upsmgConfigTemperatureHigh.1 = 40
|
||||
upsmgConfigTemperatureHysteresis.1 = 2
|
||||
upsmgConfigHumidityLow.1 = 5
|
||||
upsmgConfigHumidityHigh.1 = 90
|
||||
upsmgConfigHumidityHysteresis.1 = 5
|
||||
upsmgConfigInput1Name.1 = "Input #1"
|
||||
upsmgConfigInput1ClosedLabel.1 = "closed"
|
||||
upsmgConfigInput1OpenLabel.1 = "open"
|
||||
upsmgConfigInput2Name.1 = "Input #2"
|
||||
upsmgConfigInput2ClosedLabel.1 = "closed"
|
||||
upsmgConfigInput2OpenLabel.1 = "open"
|
||||
/**
|
||||
upsmgConfigSensorIndex.1 = 1
|
||||
upsmgConfigSensorName.1 = "Environment sensor"
|
||||
upsmgConfigTemperatureLow.1 = 5
|
||||
upsmgConfigTemperatureHigh.1 = 40
|
||||
upsmgConfigTemperatureHysteresis.1 = 2
|
||||
upsmgConfigHumidityLow.1 = 5
|
||||
upsmgConfigHumidityHigh.1 = 90
|
||||
upsmgConfigHumidityHysteresis.1 = 5
|
||||
upsmgConfigInput1Name.1 = "Input #1"
|
||||
upsmgConfigInput1ClosedLabel.1 = "closed"
|
||||
upsmgConfigInput1OpenLabel.1 = "open"
|
||||
upsmgConfigInput2Name.1 = "Input #2"
|
||||
upsmgConfigInput2ClosedLabel.1 = "closed"
|
||||
upsmgConfigInput2OpenLabel.1 = "open"
|
||||
|
||||
upsmgEnvironmentIndex.1 = 1
|
||||
upsmgEnvironmentComFailure.1 = no
|
||||
upsmgEnvironmentTemperature.1 = 287
|
||||
upsmgEnvironmentTemperatureLow.1 = no
|
||||
upsmgEnvironmentTemperatureHigh.1 = no
|
||||
upsmgEnvironmentHumidity.1 = 17
|
||||
upsmgEnvironmentHumidityLow.1 = no
|
||||
upsmgEnvironmentHumidityHigh.1 = no
|
||||
upsmgEnvironmentInput1State.1 = open
|
||||
upsmgEnvironmentInput2State.1 = open
|
||||
*/
|
||||
upsmgEnvironmentIndex.1 = 1
|
||||
upsmgEnvironmentComFailure.1 = no
|
||||
upsmgEnvironmentTemperature.1 = 287
|
||||
upsmgEnvironmentTemperatureLow.1 = no
|
||||
upsmgEnvironmentTemperatureHigh.1 = no
|
||||
upsmgEnvironmentHumidity.1 = 17
|
||||
upsmgEnvironmentHumidityLow.1 = no
|
||||
upsmgEnvironmentHumidityHigh.1 = no
|
||||
upsmgEnvironmentInput1State.1 = open
|
||||
upsmgEnvironmentInput2State.1 = open
|
||||
**/
|
||||
|
||||
foreach (array_keys($mge_env_data) as $index) {
|
||||
$descr = $mge_env_data[$index]['upsmgConfigSensorName'];
|
||||
$current = $mge_env_data[$index]['upsmgEnvironmentHumidity'];
|
||||
$sensorType = 'mge';
|
||||
$oid = '.1.3.6.1.4.1.705.1.8.7.1.6.'.$index;
|
||||
$low_limit = $mge_env_data[$index]['upsmgConfigHumidityLow'];
|
||||
$high_limit = $mge_env_data[$index]['upsmgConfigHumidityHigh'];
|
||||
$hysteresis = $mge_env_data[$index]['upsmgConfigHumidityHysteresis'];
|
||||
foreach (array_keys($mge_env_data) as $index) {
|
||||
$descr = $mge_env_data[$index]['upsmgConfigSensorName'];
|
||||
$current = $mge_env_data[$index]['upsmgEnvironmentHumidity'];
|
||||
$sensorType = 'mge';
|
||||
$oid = '.1.3.6.1.4.1.705.1.8.7.1.6.'.$index;
|
||||
$low_limit = $mge_env_data[$index]['upsmgConfigHumidityLow'];
|
||||
$high_limit = $mge_env_data[$index]['upsmgConfigHumidityHigh'];
|
||||
$hysteresis = $mge_env_data[$index]['upsmgConfigHumidityHysteresis'];
|
||||
|
||||
// FIXME warninglevels might need some other calculation in stead of hysteresis
|
||||
$low_warn_limit = ($low_limit + $hysteresis);
|
||||
$high_warn_limit = ($high_limit - $hysteresis);
|
||||
// FIXME warninglevels might need some other calculation in stead of hysteresis
|
||||
$low_warn_limit = ($low_limit + $hysteresis);
|
||||
$high_warn_limit = ($high_limit - $hysteresis);
|
||||
|
||||
d_echo("low_limit : $low_limit\nlow_warn_limit : $low_warn_limit\nhigh_warn_limit : $high_warn_limit\nhigh_limit : $high_limit\n");
|
||||
d_echo("low_limit : $low_limit\nlow_warn_limit : $low_warn_limit\nhigh_warn_limit : $high_warn_limit\nhigh_limit : $high_limit\n");
|
||||
|
||||
if ($current != 0) {
|
||||
// Humidity = 0 -> Sensor not available
|
||||
// FIXME true for MGE as wel as APC?
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $oid, $index, $sensorType, $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
}//end foreach
|
||||
}//end if
|
||||
if ($current != 0) {
|
||||
// Humidity = 0 -> Sensor not available
|
||||
// FIXME true for MGE as wel as APC?
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $oid, $index, $sensorType, $descr, '1', '1', $low_limit, $low_warn_limit, $high_warn_limit, $high_limit, $current);
|
||||
}
|
||||
}//end foreach
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.3854.1.2.2.1.16.1.4', '-Osqn', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo 'AKCP ';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$status) = explode(' ', $data, 2);
|
||||
if ($status == 2) {
|
||||
// 2 = normal, 0 = not connected
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
$descr_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.1.$index";
|
||||
$oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.3.$index";
|
||||
$warnlimit_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.7.$index";
|
||||
$limit_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.8.$index";
|
||||
$warnlowlimit_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.9.$index";
|
||||
$lowlimit_oid = ".1.3.6.1.4.1.3854.1.2.2.1.17.1.10.$index";
|
||||
|
||||
$descr = trim(snmp_get($device, $descr_oid, '-Oqv', ''), '"');
|
||||
$humidity = snmp_get($device, $oid, '-Oqv', '');
|
||||
$warnlimit = snmp_get($device, $warnlimit_oid, '-Oqv', '');
|
||||
$limit = snmp_get($device, $limit_oid, '-Oqv', '');
|
||||
$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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,26 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'netbotz') {
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.5528.100.4.1.2.1.4', '-Osqn', '');
|
||||
d_echo($oids."\n");
|
||||
$oids = snmp_walk($device, '.1.3.6.1.4.1.5528.100.4.1.2.1.4', '-Osqn', '');
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo 'Netbotz ';
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$humidity_id = $split_oid[(count($split_oid) - 1)];
|
||||
// tempHumidSensorHumidValue
|
||||
$humidity_oid = '.1.3.6.1.4.1.5528.100.4.1.2.1.8.'.$humidity_id;
|
||||
$humidity = snmp_get($device, "$humidity_oid", '-Ovq', '');
|
||||
$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);
|
||||
}
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo 'Netbotz ';
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$humidity_id = $split_oid[(count($split_oid) - 1)];
|
||||
// tempHumidSensorHumidValue
|
||||
$humidity_oid = '.1.3.6.1.4.1.5528.100.4.1.2.1.8.'.$humidity_id;
|
||||
$humidity = snmp_get($device, "$humidity_oid", '-Ovq', '');
|
||||
$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);
|
||||
}
|
||||
|
||||
unset($data);
|
||||
}
|
||||
|
||||
unset($oids);
|
||||
unset($data);
|
||||
}
|
||||
|
||||
unset($oids);
|
||||
|
||||
@@ -1,59 +1,48 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'pcoweb') {
|
||||
echo ' pCOWeb ';
|
||||
echo 'pCOWeb: ';
|
||||
|
||||
$humidities = array(
|
||||
array(
|
||||
'mib' => 'CAREL-ug40cdz-MIB::roomRH.0',
|
||||
'descr' => 'Room Relative Humidity',
|
||||
'oid' => '.1.3.6.1.4.1.9839.2.1.2.6.0',
|
||||
'precision' => '10',
|
||||
),
|
||||
array(
|
||||
'mib' => 'CAREL-ug40cdz-MIB::dehumPband.0',
|
||||
'descr' => 'Dehumidification Prop. Band',
|
||||
'oid' => '.1.3.6.1.4.1.9839.2.1.3.12.0',
|
||||
'precision' => '1',
|
||||
),
|
||||
array(
|
||||
'mib' => 'CAREL-ug40cdz-MIB::humidPband.0',
|
||||
'descr' => 'Humidification Prop. Band',
|
||||
'oid' => '.1.3.6.1.4.1.9839.2.1.3.13.0',
|
||||
'precision' => '1',
|
||||
),
|
||||
array(
|
||||
'mib' => 'CAREL-ug40cdz-MIB::dehumSetp.0',
|
||||
'descr' => 'Dehumidification Set Point',
|
||||
'oid' => '.1.3.6.1.4.1.9839.2.1.3.16.0',
|
||||
'precision' => '1',
|
||||
),
|
||||
array(
|
||||
'mib' => 'CAREL-ug40cdz-MIB::humidSetp.0',
|
||||
'descr' => 'Humidification Set Point',
|
||||
'oid' => '.1.3.6.1.4.1.9839.2.1.3.17.0',
|
||||
'precision' => '1',
|
||||
),
|
||||
);
|
||||
$humidities = array(
|
||||
array(
|
||||
'mib' => 'CAREL-ug40cdz-MIB::roomRH.0',
|
||||
'descr' => 'Room Relative Humidity',
|
||||
'oid' => '.1.3.6.1.4.1.9839.2.1.2.6.0',
|
||||
'precision' => '10',
|
||||
),
|
||||
array(
|
||||
'mib' => 'CAREL-ug40cdz-MIB::dehumPband.0',
|
||||
'descr' => 'Dehumidification Prop. Band',
|
||||
'oid' => '.1.3.6.1.4.1.9839.2.1.3.12.0',
|
||||
'precision' => '1',
|
||||
),
|
||||
array(
|
||||
'mib' => 'CAREL-ug40cdz-MIB::humidPband.0',
|
||||
'descr' => 'Humidification Prop. Band',
|
||||
'oid' => '.1.3.6.1.4.1.9839.2.1.3.13.0',
|
||||
'precision' => '1',
|
||||
),
|
||||
array(
|
||||
'mib' => 'CAREL-ug40cdz-MIB::dehumSetp.0',
|
||||
'descr' => 'Dehumidification Set Point',
|
||||
'oid' => '.1.3.6.1.4.1.9839.2.1.3.16.0',
|
||||
'precision' => '1',
|
||||
),
|
||||
array(
|
||||
'mib' => 'CAREL-ug40cdz-MIB::humidSetp.0',
|
||||
'descr' => 'Humidification Set Point',
|
||||
'oid' => '.1.3.6.1.4.1.9839.2.1.3.17.0',
|
||||
'precision' => '1',
|
||||
),
|
||||
);
|
||||
|
||||
foreach ($humidities as $humidity) {
|
||||
$current = (snmp_get($device, $humidity['mib'], '-OqvU') / $humidity['precision']);
|
||||
foreach ($humidities as $humidity) {
|
||||
$current = (snmp_get($device, $humidity['mib'], '-OqvU') / $humidity['precision']);
|
||||
|
||||
$high_limit = null;
|
||||
$low_limit = null;
|
||||
$high_limit = null;
|
||||
$low_limit = null;
|
||||
|
||||
if (is_numeric($current) && $current != 0) {
|
||||
$index = implode('.', array_slice(explode('.', $humidity['oid']), -5));
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $humidity['oid'], $index, 'pcoweb', $humidity['descr'], $humidity['precision'], '1', $low_limit, null, null, $high_limit, $current);
|
||||
}
|
||||
if (is_numeric($current) && $current != 0) {
|
||||
$index = implode('.', array_slice(explode('.', $humidity['oid']), -5));
|
||||
discover_sensor($valid['sensor'], 'humidity', $device, $humidity['oid'], $index, 'pcoweb', $humidity['descr'], $humidity['precision'], '1', $low_limit, null, null, $high_limit, $current);
|
||||
}
|
||||
|
||||
/*
|
||||
FIXME
|
||||
|
||||
hhAlarmThrsh.0 = INTEGER: 80 rH%
|
||||
lhAlarmThrsh.0 = INTEGER: 30 rH%
|
||||
smDehumSetp.0 = INTEGER: 75 rH%
|
||||
smHumidSetp.0 = INTEGER: 35 rH%
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -1,39 +1,37 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'sentry3') {
|
||||
$oids = snmp_walk($device, 'tempHumidSensorHumidValue', '-Osqn', 'Sentry3-MIB');
|
||||
$divisor = '1';
|
||||
$multiplier = '1';
|
||||
d_echo($oids."\n");
|
||||
$oids = snmp_walk($device, 'tempHumidSensorHumidValue', '-Osqn', 'Sentry3-MIB');
|
||||
$divisor = '1';
|
||||
$multiplier = '1';
|
||||
d_echo($oids."\n");
|
||||
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo 'ServerTech Sentry ';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
|
||||
// tempHumidSensorHumidValue
|
||||
$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');
|
||||
$high_warn_limit = '0';
|
||||
$high_limit = snmp_get($device, "tempHumidSensorHumidHighThresh.1.$index", '-Ovq', 'Sentry3-MIB');
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
unset($data);
|
||||
}
|
||||
|
||||
unset($oids);
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo 'ServerTech Sentry ';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
list($oid,$descr) = explode(' ', $data, 2);
|
||||
$split_oid = explode('.', $oid);
|
||||
$index = $split_oid[(count($split_oid) - 1)];
|
||||
|
||||
// tempHumidSensorHumidValue
|
||||
$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');
|
||||
$high_warn_limit = '0';
|
||||
$high_limit = snmp_get($device, "tempHumidSensorHumidHighThresh.1.$index", '-Ovq', 'Sentry3-MIB');
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
unset($data);
|
||||
}
|
||||
|
||||
unset($oids);
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<?php
|
||||
echo 'Load: ';
|
||||
|
||||
// Include all discovery modules
|
||||
$include_dir = 'includes/discovery/sensors/load';
|
||||
require 'includes/include-dir.inc.php';
|
||||
|
||||
d_echo($valid['sensor']['load']);
|
||||
|
||||
check_valid_sensors($device, 'load', $valid['sensor']);
|
||||
|
||||
echo "\n";
|
||||
@@ -1,42 +1,40 @@
|
||||
<?php
|
||||
|
||||
// APC
|
||||
if ($device['os'] == 'apc') {
|
||||
echo 'APC Load ';
|
||||
// UPS
|
||||
$oid_array = array(
|
||||
array(
|
||||
'HighPrecOid' => 'upsHighPrecOutputLoad',
|
||||
'AdvOid' => 'upsAdvOutputLoad',
|
||||
'type' => 'apc',
|
||||
'index' => 0,
|
||||
'descr' => 'Load',
|
||||
'divisor' => 10,
|
||||
'mib' => '+PowerNet-MIB',
|
||||
),
|
||||
);
|
||||
foreach ($oid_array as $item) {
|
||||
$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 = '.1.3.6.1.4.1.318.1.1.1.4.3.3';
|
||||
$current = $oids;
|
||||
$item['divisor'] = 1;
|
||||
} else {
|
||||
$current_oid = '.1.3.6.1.4.1.318.1.1.1.4.3.3';
|
||||
$value = explode(" ", $oids);
|
||||
$current = $value[1]/$item['divisor'];
|
||||
echo 'APC Load ';
|
||||
|
||||
$oid_array = array(
|
||||
array(
|
||||
'HighPrecOid' => 'upsHighPrecOutputLoad',
|
||||
'AdvOid' => 'upsAdvOutputLoad',
|
||||
'type' => 'apc',
|
||||
'index' => 0,
|
||||
'descr' => 'Load',
|
||||
'divisor' => 10,
|
||||
'mib' => '+PowerNet-MIB',
|
||||
),
|
||||
);
|
||||
|
||||
foreach ($oid_array as $item) {
|
||||
$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 = '.1.3.6.1.4.1.318.1.1.1.4.3.3';
|
||||
$current = $oids;
|
||||
$item['divisor'] = 1;
|
||||
} else {
|
||||
$current_oid = '.1.3.6.1.4.1.318.1.1.1.4.3.3';
|
||||
$value = explode(" ", $oids);
|
||||
$current = $value[1]/$item['divisor'];
|
||||
}
|
||||
|
||||
if (!empty($oids)) {
|
||||
d_echo($oids);
|
||||
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo $item['type'].' '.$item['mib'].' UPS';
|
||||
}
|
||||
|
||||
if (!empty($oids)) {
|
||||
d_echo($oids);
|
||||
|
||||
$oids = trim($oids);
|
||||
if ($oids) {
|
||||
echo $item['type'].' '.$item['mib'].' UPS';
|
||||
}
|
||||
|
||||
discover_sensor($valid['sensor'], 'load', $device, $current_oid.'.'.$item['index'], $current_oid.'.'.$item['index'], $item['type'], $item['descr'], $item['divisor'], 1, null, null, null, null, $current);
|
||||
}
|
||||
}//end foreach
|
||||
}//end if
|
||||
discover_sensor($valid['sensor'], 'load', $device, $current_oid.'.'.$item['index'], $current_oid.'.'.$item['index'], $item['type'], $item['descr'], $item['divisor'], 1, null, null, null, null, $current);
|
||||
}
|
||||
}//end foreach
|
||||
|
||||
@@ -11,26 +11,24 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'dsm') {
|
||||
echo 'DSM UPS Load';
|
||||
echo 'DSM UPS Load';
|
||||
|
||||
// UPS Device Manufacturer, example return : SNMPv2-SMI::enterprises.6574.4.1.2.0 = STRING: "American Power Conversion"
|
||||
$ups_device_manufacturer_oid = '.1.3.6.1.4.1.6574.4.1.2.0';
|
||||
$ups_device_manufacturer = str_replace('"', '', snmp_get($device, $ups_device_manufacturer_oid, '-Oqv'));
|
||||
// Too long name for APC
|
||||
if ($ups_device_manufacturer == 'American Power Conversion') {
|
||||
$ups_device_manufacturer = 'APC';
|
||||
}
|
||||
// UPS Device Manufacturer, example return : SNMPv2-SMI::enterprises.6574.4.1.2.0 = STRING: "American Power Conversion"
|
||||
$ups_device_manufacturer_oid = '.1.3.6.1.4.1.6574.4.1.2.0';
|
||||
$ups_device_manufacturer = str_replace('"', '', snmp_get($device, $ups_device_manufacturer_oid, '-Oqv'));
|
||||
// Too long name for APC
|
||||
if ($ups_device_manufacturer == 'American Power Conversion') {
|
||||
$ups_device_manufacturer = 'APC';
|
||||
}
|
||||
|
||||
// UPS Device Model, example return : SNMPv2-SMI::enterprises.6574.4.1.1.0 = STRING: "Back-UPS RS 900G"
|
||||
$ups_device_model_oid = '.1.3.6.1.4.1.6574.4.1.1.0';
|
||||
$ups_device_model = str_replace('"', '', snmp_get($device, $ups_device_model_oid, '-Oqv'));
|
||||
// UPS Device Model, example return : SNMPv2-SMI::enterprises.6574.4.1.1.0 = STRING: "Back-UPS RS 900G"
|
||||
$ups_device_model_oid = '.1.3.6.1.4.1.6574.4.1.1.0';
|
||||
$ups_device_model = str_replace('"', '', snmp_get($device, $ups_device_model_oid, '-Oqv'));
|
||||
|
||||
|
||||
// UPS Load Value, example return : SNMPv2-SMI::enterprises.6574.4.2.12.1.0 = Opaque: Float: 4.000000
|
||||
$ups_load_oid = '.1.3.6.1.4.1.6574.4.2.12.1.0';
|
||||
$ups_load = snmp_get($device, $ups_load_oid, '-Oqv');
|
||||
if (is_numeric($ups_load)) {
|
||||
discover_sensor($valid['sensor'], 'load', $device, $ups_load_oid, 0, 'snmp', $ups_device_manufacturer.' '.$ups_device_model.' - UPS Load', '1', '1', 0, null, null, 100, intval($ups_load));
|
||||
}
|
||||
}//end if
|
||||
// UPS Load Value, example return : SNMPv2-SMI::enterprises.6574.4.2.12.1.0 = Opaque: Float: 4.000000
|
||||
$ups_load_oid = '.1.3.6.1.4.1.6574.4.2.12.1.0';
|
||||
$ups_load = snmp_get($device, $ups_load_oid, '-Oqv');
|
||||
if (is_numeric($ups_load)) {
|
||||
discover_sensor($valid['sensor'], 'load', $device, $ups_load_oid, 0, 'snmp', $ups_device_manufacturer.' '.$ups_device_model.' - UPS Load', '1', '1', 0, null, null, 100, intval($ups_load));
|
||||
}
|
||||
|
||||
@@ -23,36 +23,34 @@
|
||||
* @author Tony Murray <[email protected]>
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'netagent2') {
|
||||
$load_oid = '.1.3.6.1.4.1.935.1.1.1.4.2.3.0';
|
||||
$output_load = snmp_get($device, $load_oid, '-Oqv');
|
||||
$load_oid = '.1.3.6.1.4.1.935.1.1.1.4.2.3.0';
|
||||
$output_load = snmp_get($device, $load_oid, '-Oqv');
|
||||
|
||||
if (!empty($output_load) || $output_load == 0) {
|
||||
$type = 'netagent2';
|
||||
$index = 0;
|
||||
$limit = 100;
|
||||
$warnlimit = 80;
|
||||
$lowlimit = 0;
|
||||
$lowwarnlimit = null;
|
||||
$divisor = 1;
|
||||
$load = $output_load / $divisor;
|
||||
$descr = 'Output load';
|
||||
if (!empty($output_load) || $output_load == 0) {
|
||||
$type = 'netagent2';
|
||||
$index = 0;
|
||||
$limit = 100;
|
||||
$warnlimit = 80;
|
||||
$lowlimit = 0;
|
||||
$lowwarnlimit = null;
|
||||
$divisor = 1;
|
||||
$load = $output_load / $divisor;
|
||||
$descr = 'Output load';
|
||||
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'load',
|
||||
$device,
|
||||
$load_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
$lowlimit,
|
||||
$lowwarnlimit,
|
||||
$warnlimit,
|
||||
$limit,
|
||||
$load
|
||||
);
|
||||
}
|
||||
}//end if
|
||||
discover_sensor(
|
||||
$valid['sensor'],
|
||||
'load',
|
||||
$device,
|
||||
$load_oid,
|
||||
$index,
|
||||
$type,
|
||||
$descr,
|
||||
$divisor,
|
||||
'1',
|
||||
$lowlimit,
|
||||
$lowwarnlimit,
|
||||
$warnlimit,
|
||||
$limit,
|
||||
$load
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,26 +1,23 @@
|
||||
<?php
|
||||
|
||||
// RFC1628 UPS
|
||||
if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modules_compat']['rfc1628'][$device['os']]) {
|
||||
echo 'RFC1628 ';
|
||||
echo 'RFC1628 ';
|
||||
|
||||
$oids = snmp_walk($device, '.1.3.6.1.2.1.33.1.4.4.1.5', '-Osqn', 'UPS-MIB');
|
||||
d_echo($oids."\n");
|
||||
$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);
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
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 = snmp_get($device, $current_oid, '-O vq');
|
||||
$descr = 'Percentage load'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($current_id + 1));
|
||||
$type = 'rfc1628';
|
||||
$index = (500 + $current_id);
|
||||
$oids = trim($oids);
|
||||
foreach (explode("\n", $oids) as $data) {
|
||||
$data = trim($data);
|
||||
if ($data) {
|
||||
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 = snmp_get($device, $current_oid, '-O vq');
|
||||
$descr = 'Percentage load'.(count(explode("\n", $oids)) == 1 ? '' : ' '.($current_id + 1));
|
||||
$type = 'rfc1628';
|
||||
$index = (500 + $current_id);
|
||||
|
||||
discover_sensor($valid['sensor'], 'load', $device, $current_oid, $index, $type, $descr, '1', '1', null, null, null, null, $current);
|
||||
}
|
||||
discover_sensor($valid['sensor'], 'load', $device, $current_oid, $index, $type, $descr, '1', '1', null, null, null, null, $current);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,22 +23,19 @@
|
||||
* @author Tony Murray <[email protected]>
|
||||
*/
|
||||
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.4.4.1.5', array());
|
||||
|
||||
if ($device['os'] == 'sinetica') {
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.4.4.1.5', array());
|
||||
foreach ($oids as $oid => $data) {
|
||||
$current_id = substr($oid, strrpos($oid, '.') + 1);
|
||||
|
||||
foreach ($oids as $oid => $data) {
|
||||
$current_id = substr($oid, strrpos($oid, '.') + 1);
|
||||
|
||||
$current_oid = ".$oid";
|
||||
$descr = 'Output';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " $current_id";
|
||||
}
|
||||
$current = current($data);
|
||||
$type = 'sinetica';
|
||||
$index = '4.4.1.5.' . $current_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'load', $device, $current_oid, $index, $type, $descr, 1, 1, null, null, null, null, $current);
|
||||
$current_oid = ".$oid";
|
||||
$descr = 'Output';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " $current_id";
|
||||
}
|
||||
$current = current($data);
|
||||
$type = 'sinetica';
|
||||
$index = '4.4.1.5.' . $current_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'load', $device, $current_oid, $index, $type, $descr, 1, 1, null, null, null, null, $current);
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
echo 'Power: ';
|
||||
|
||||
// Include all discovery modules
|
||||
$include_dir = 'includes/discovery/sensors/power';
|
||||
require 'includes/include-dir.inc.php';
|
||||
|
||||
d_echo($valid['sensor']['power']);
|
||||
|
||||
check_valid_sensors($device, 'power', $valid['sensor']);
|
||||
|
||||
echo "\n";
|
||||
@@ -11,36 +11,32 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'cimc') {
|
||||
// Let's add some power sensors.
|
||||
$pwr_board = snmpwalk_array_num($device, '.1.3.6.1.4.1.9.9.719.1.9.14');
|
||||
$pwr_board = snmpwalk_array_num($device, '.1.3.6.1.4.1.9.9.719.1.9.14');
|
||||
|
||||
/*
|
||||
* False == OID not found - this is not an error.
|
||||
* null == timeout or something else that caused an error.
|
||||
*/
|
||||
if (is_null($pwr_board)) {
|
||||
echo "Error\n";
|
||||
} else {
|
||||
// No Error, lets process things.
|
||||
$index = 1;
|
||||
/*
|
||||
* False == OID not found - this is not an error.
|
||||
* null == timeout or something else that caused an error.
|
||||
*/
|
||||
if (is_null($pwr_board)) {
|
||||
echo "Error\n";
|
||||
} else {
|
||||
$index = 1;
|
||||
|
||||
// Board Input Power
|
||||
$oid = '.1.3.6.1.4.1.9.9.719.1.9.14.1.4';
|
||||
$description = "MB Input Power";
|
||||
d_echo($oid." - ".$description." - ".$pwr_board[$oid][$index]."\n");
|
||||
discover_sensor($valid['sensor'], 'power', $device, $oid.".".$index, 'mb-input-power', 'cimc', $description, '1', '1', null, null, null, null, $temp_board[$oid][$index]);
|
||||
// Board Input Power
|
||||
$oid = '.1.3.6.1.4.1.9.9.719.1.9.14.1.4';
|
||||
$description = "MB Input Power";
|
||||
d_echo($oid." - ".$description." - ".$pwr_board[$oid][$index]."\n");
|
||||
discover_sensor($valid['sensor'], 'power', $device, $oid.".".$index, 'mb-input-power', 'cimc', $description, '1', '1', null, null, null, null, $temp_board[$oid][$index]);
|
||||
|
||||
// Board Input Current
|
||||
$oid = '.1.3.6.1.4.1.9.9.719.1.9.14.1.8';
|
||||
$description = "MB Input Current";
|
||||
d_echo($oid." - ".$description." - ".$pwr_board[$oid][$index]."\n");
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid.".".$index, 'mb-input-current', 'cimc', $description, '1', '1', null, null, null, null, $temp_board[$oid][$index]);
|
||||
// Board Input Current
|
||||
$oid = '.1.3.6.1.4.1.9.9.719.1.9.14.1.8';
|
||||
$description = "MB Input Current";
|
||||
d_echo($oid." - ".$description." - ".$pwr_board[$oid][$index]."\n");
|
||||
discover_sensor($valid['sensor'], 'current', $device, $oid.".".$index, 'mb-input-current', 'cimc', $description, '1', '1', null, null, null, null, $temp_board[$oid][$index]);
|
||||
|
||||
// Board Input Voltage
|
||||
$oid = '.1.3.6.1.4.1.9.9.719.1.9.14.1.12';
|
||||
$description = "MB Input Voltage";
|
||||
d_echo($oid." - ".$description." - ".$pwr_board[$oid][$index]."\n");
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $oid.".".$index, 'mb-input-voltage', 'cimc', $description, '1', '1', null, null, null, null, $temp_board[$oid][$index]);
|
||||
}
|
||||
// Board Input Voltage
|
||||
$oid = '.1.3.6.1.4.1.9.9.719.1.9.14.1.12';
|
||||
$description = "MB Input Voltage";
|
||||
d_echo($oid." - ".$description." - ".$pwr_board[$oid][$index]."\n");
|
||||
discover_sensor($valid['sensor'], 'voltage', $device, $oid.".".$index, 'mb-input-voltage', 'cimc', $description, '1', '1', null, null, null, null, $temp_board[$oid][$index]);
|
||||
}
|
||||
|
||||
@@ -10,19 +10,17 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'ciscosb') {
|
||||
echo 'CiscoSB: ';
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'rlPethPsePortEntry', array(), 'CISCOSB-POE-MIB');
|
||||
if (is_array($temp)) {
|
||||
$cur_oid = '.1.3.6.1.4.1.9.6.1.101.108.1.1.5.';
|
||||
$divisor = '1000';
|
||||
foreach ($temp as $index => $entry) {
|
||||
if (is_numeric($temp[$index]['rlPethPsePortOutputPower']) && $temp[$index]['rlPethPsePortOutputPower'] > 0) {
|
||||
$port_descr = get_port_by_index_cache($device, str_replace('1.', '', $index));
|
||||
$descr = $port_descr['ifDescr'] . ' PoE';
|
||||
$highlimit = $temp[$index]['rlPethPsePortOperPowerLimit'] / $divisor;
|
||||
discover_sensor($valid['sensor'], 'power', $device, $cur_oid . $index, $index, 'ciscosb', $descr, $divisor, '1', null, null, null, $highlimit, $temp[$index]['rlPethPsePortOutputPower'] / $divisor, 'snmp', $index);
|
||||
}
|
||||
echo 'CiscoSB: ';
|
||||
$temp = snmpwalk_cache_multi_oid($device, 'rlPethPsePortEntry', array(), 'CISCOSB-POE-MIB');
|
||||
if (is_array($temp)) {
|
||||
$cur_oid = '.1.3.6.1.4.1.9.6.1.101.108.1.1.5.';
|
||||
$divisor = '1000';
|
||||
foreach ($temp as $index => $entry) {
|
||||
if (is_numeric($temp[$index]['rlPethPsePortOutputPower']) && $temp[$index]['rlPethPsePortOutputPower'] > 0) {
|
||||
$port_descr = get_port_by_index_cache($device, str_replace('1.', '', $index));
|
||||
$descr = $port_descr['ifDescr'] . ' PoE';
|
||||
$highlimit = $temp[$index]['rlPethPsePortOperPowerLimit'] / $divisor;
|
||||
discover_sensor($valid['sensor'], 'power', $device, $cur_oid . $index, $index, 'ciscosb', $descr, $divisor, '1', null, null, null, $highlimit, $temp[$index]['rlPethPsePortOutputPower'] / $divisor, 'snmp', $index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,12 +10,10 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'dell-ups') {
|
||||
echo 'Dell UPS: ';
|
||||
$temp = snmp_get($device, "physicalOutputPresentConsumption.0", "-Ovqe", "DELL-SNMP-UPS-MIB");
|
||||
if (is_numeric($temp) && !is_null($temp)) {
|
||||
$oid = '.1.3.6.1.4.1.674.10902.2.120.2.6.0';
|
||||
$descr = 'System Consumption';
|
||||
discover_sensor($valid['sensor'], 'power', $device, $oid, '0', 'dell-ups', $descr, '1', '1', null, null, null, null, $temp);
|
||||
}
|
||||
echo 'Dell UPS: ';
|
||||
$temp = snmp_get($device, "physicalOutputPresentConsumption.0", "-Ovqe", "DELL-SNMP-UPS-MIB");
|
||||
if (is_numeric($temp) && !is_null($temp)) {
|
||||
$oid = '.1.3.6.1.4.1.674.10902.2.120.2.6.0';
|
||||
$descr = 'System Consumption';
|
||||
discover_sensor($valid['sensor'], 'power', $device, $oid, '0', 'dell-ups', $descr, '1', '1', null, null, null, null, $temp);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
@@ -12,21 +11,18 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'dsm') {
|
||||
echo 'DSM UPS Power';
|
||||
echo 'DSM UPS Power';
|
||||
|
||||
// UPS Device Manufacturer, example return : SNMPv2-SMI::enterprises.6574.4.1.2.0 = STRING: "American Power Conversion"
|
||||
$ups_device_manufacturer_oid = '.1.3.6.1.4.1.6574.4.1.2.0';
|
||||
$ups_device_manufacturer = str_replace('"', '', snmp_get($device, $ups_device_manufacturer_oid, '-Oqv'));
|
||||
// UPS Device Model, example return : SNMPv2-SMI::enterprises.6574.4.1.1.0 = STRING: "Back-UPS RS 900G"
|
||||
$ups_device_model_oid = '.1.3.6.1.4.1.6574.4.1.1.0';
|
||||
$ups_device_model = str_replace('"', '', snmp_get($device, $ups_device_model_oid, '-Oqv'));
|
||||
// UPS Device Manufacturer, example return : SNMPv2-SMI::enterprises.6574.4.1.2.0 = STRING: "American Power Conversion"
|
||||
$ups_device_manufacturer_oid = '.1.3.6.1.4.1.6574.4.1.2.0';
|
||||
$ups_device_manufacturer = str_replace('"', '', snmp_get($device, $ups_device_manufacturer_oid, '-Oqv'));
|
||||
// UPS Device Model, example return : SNMPv2-SMI::enterprises.6574.4.1.1.0 = STRING: "Back-UPS RS 900G"
|
||||
$ups_device_model_oid = '.1.3.6.1.4.1.6574.4.1.1.0';
|
||||
$ups_device_model = str_replace('"', '', snmp_get($device, $ups_device_model_oid, '-Oqv'));
|
||||
|
||||
|
||||
// UPS Info Real Power Nominal, example return : SNMPv2-SMI::enterprises.6574.4.2.21.2.0 = Opaque: Float: 540.000000
|
||||
$ups_real_power_nominal_oid = '.1.3.6.1.4.1.6574.4.2.21.2.0';
|
||||
$ups_real_power_nominal = snmp_get($device, $ups_real_power_nominal_oid, '-Oqv');
|
||||
if (is_numeric($ups_real_power_nominal)) {
|
||||
discover_sensor($valid['sensor'], 'power', $device, $ups_real_power_nominal_oid, 'UPSRealPowerNominal', $ups_device_manufacturer.' '.$ups_device_model, 'UPS Real Power Nominal', '1', '1', null, null, null, null, $ups_real_power_nominal);
|
||||
}
|
||||
// UPS Info Real Power Nominal, example return : SNMPv2-SMI::enterprises.6574.4.2.21.2.0 = Opaque: Float: 540.000000
|
||||
$ups_real_power_nominal_oid = '.1.3.6.1.4.1.6574.4.2.21.2.0';
|
||||
$ups_real_power_nominal = snmp_get($device, $ups_real_power_nominal_oid, '-Oqv');
|
||||
if (is_numeric($ups_real_power_nominal)) {
|
||||
discover_sensor($valid['sensor'], 'power', $device, $ups_real_power_nominal_oid, 'UPSRealPowerNominal', $ups_device_manufacturer.' '.$ups_device_model, 'UPS Real Power Nominal', '1', '1', null, null, null, null, $ups_real_power_nominal);
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
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
|
||||
$value = snmp_get($device, $oid, '-Oqv', 'EXTREME-BASE-MIB');
|
||||
$divisor = "1000";
|
||||
|
||||
if (is_numeric($value)) {
|
||||
$value = ($value / $divisor); // Nasty hack to divide the first value by 1000 since the divisor only works for polling after the sensor has been added
|
||||
discover_sensor($valid['sensor'], 'power', $device, $oid, '1', 'extreme-power', $descr, $divisor, 1, null, null, null, null, $value); // No limits have been specified since all equipment is different and will use different amount of Watts
|
||||
}
|
||||
}
|
||||
// EOF
|
||||
@@ -1,26 +1,25 @@
|
||||
<?php
|
||||
if ($device['os'] == 'hpblmos') {
|
||||
$sensor_type = 'hpblmos_psu_usage';
|
||||
$psu_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.16';
|
||||
$psu_usage_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.10.';
|
||||
$psu_max_usage_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.9.';
|
||||
|
||||
$psus = trim(snmp_walk($device, $psu_oid, '-Osqn'));
|
||||
$sensor_type = 'hpblmos_psu_usage';
|
||||
$psu_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.16';
|
||||
$psu_usage_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.10.';
|
||||
$psu_max_usage_oid = '.1.3.6.1.4.1.232.22.2.5.1.1.1.9.';
|
||||
|
||||
foreach (explode("\n", $psus) as $psu) {
|
||||
$psu = trim($psu);
|
||||
if ($psu) {
|
||||
list($oid, $presence) = explode(' ', $psu, 2);
|
||||
if ($presence != 2) {
|
||||
$split_oid = explode('.', $oid);
|
||||
$current_id = $split_oid[(count($split_oid) - 1)];
|
||||
$current_oid = $psu_usage_oid.$current_id;
|
||||
$psu_max_oid = $psu_max_usage_oid.$current_id;
|
||||
$descr = 'PSU '.$current_id.' output';
|
||||
$value = snmp_get($device, $current_oid, '-Oqv');
|
||||
$max_value = snmp_get($device, $psu_max_oid, '-Oqv');
|
||||
discover_sensor($valid['sensor'], 'power', $device, $current_oid, $current_id, $sensor_type, $descr, 1, 1, null, null, null, $max_value, $value);
|
||||
}
|
||||
$psus = trim(snmp_walk($device, $psu_oid, '-Osqn'));
|
||||
|
||||
foreach (explode("\n", $psus) as $psu) {
|
||||
$psu = trim($psu);
|
||||
if ($psu) {
|
||||
list($oid, $presence) = explode(' ', $psu, 2);
|
||||
if ($presence != 2) {
|
||||
$split_oid = explode('.', $oid);
|
||||
$current_id = $split_oid[(count($split_oid) - 1)];
|
||||
$current_oid = $psu_usage_oid.$current_id;
|
||||
$psu_max_oid = $psu_max_usage_oid.$current_id;
|
||||
$descr = 'PSU '.$current_id.' output';
|
||||
$value = snmp_get($device, $current_oid, '-Oqv');
|
||||
$max_value = snmp_get($device, $psu_max_oid, '-Oqv');
|
||||
discover_sensor($valid['sensor'], 'power', $device, $current_oid, $current_id, $sensor_type, $descr, 1, 1, null, null, null, $max_value, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,48 +1,45 @@
|
||||
<?php
|
||||
|
||||
// IPOMANII-MIB
|
||||
if ($device['os'] == 'ipoman') {
|
||||
echo ' IPOMANII-MIB ';
|
||||
echo ' IPOMANII-MIB ';
|
||||
|
||||
// Inlet Disabled due to the fact thats it's Kwh instead of just Watt
|
||||
if (!is_array($cache['ipoman'])) {
|
||||
d_echo('outletConfigDesc ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigDesc', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
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");
|
||||
// Inlet Disabled due to the fact thats it's Kwh instead of just Watt
|
||||
if (!is_array($cache['ipoman'])) {
|
||||
d_echo('outletConfigDesc ');
|
||||
$cache['ipoman']['out'] = snmpwalk_cache_multi_oid($device, 'outletConfigDesc', $cache['ipoman']['out'], 'IPOMANII-MIB');
|
||||
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");
|
||||
}
|
||||
|
||||
// $oids_in = array();
|
||||
$oids_out = array();
|
||||
|
||||
// echo("inletStatusWH ");
|
||||
// $oids_in = snmpwalk_cache_multi_oid($device, "inletStatusWH", $oids_in, "IPOMANII-MIB");
|
||||
d_echo('outletStatusWH ');
|
||||
$oids_out = snmpwalk_cache_multi_oid($device, 'outletStatusWH', $oids_out, 'IPOMANII-MIB');
|
||||
|
||||
// if (is_array($oids_in))
|
||||
// {
|
||||
// foreach ($oids_in as $index => $entry)
|
||||
// {
|
||||
// $cur_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.1.3.1.5.' . $index;
|
||||
// $divisor = 10;
|
||||
// $descr = (trim($cache['ipoman']['in'][$index]['inletConfigDesc'],'"') != '' ? trim($cache['ipoman']['in'][$index]['inletConfigDesc'],'"') : "Inlet $index");
|
||||
// $power = $entry['inletStatusWH'] / $divisor;
|
||||
//
|
||||
// discover_sensor($valid['sensor'], 'power', $device, $cur_oid, '1.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', NULL, NULL, NULL, NULL, $power);
|
||||
// // FIXME: iPoMan 1201 also says it has 2 inlets, at least until firmware 1.06 - wtf?
|
||||
// }
|
||||
// }
|
||||
if (is_array($oids_out)) {
|
||||
foreach ($oids_out as $index => $entry) {
|
||||
$cur_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.2.3.1.5.'.$index;
|
||||
$divisor = 10;
|
||||
$descr = (trim($cache['ipoman']['out'][$index]['outletConfigDesc'], '"') != '' ? trim($cache['ipoman']['out'][$index]['outletConfigDesc'], '"') : "Output $index");
|
||||
$power = ($entry['outletStatusWH'] / $divisor);
|
||||
|
||||
discover_sensor($valid['sensor'], 'power', $device, $cur_oid, '2.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', null, null, null, null, $power);
|
||||
}
|
||||
|
||||
// $oids_in = array();
|
||||
$oids_out = array();
|
||||
|
||||
// echo("inletStatusWH ");
|
||||
// $oids_in = snmpwalk_cache_multi_oid($device, "inletStatusWH", $oids_in, "IPOMANII-MIB");
|
||||
d_echo('outletStatusWH ');
|
||||
$oids_out = snmpwalk_cache_multi_oid($device, 'outletStatusWH', $oids_out, 'IPOMANII-MIB');
|
||||
|
||||
// if (is_array($oids_in))
|
||||
// {
|
||||
// foreach ($oids_in as $index => $entry)
|
||||
// {
|
||||
// $cur_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.1.3.1.5.' . $index;
|
||||
// $divisor = 10;
|
||||
// $descr = (trim($cache['ipoman']['in'][$index]['inletConfigDesc'],'"') != '' ? trim($cache['ipoman']['in'][$index]['inletConfigDesc'],'"') : "Inlet $index");
|
||||
// $power = $entry['inletStatusWH'] / $divisor;
|
||||
//
|
||||
// discover_sensor($valid['sensor'], 'power', $device, $cur_oid, '1.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', NULL, NULL, NULL, NULL, $power);
|
||||
// // FIXME: iPoMan 1201 also says it has 2 inlets, at least until firmware 1.06 - wtf?
|
||||
// }
|
||||
// }
|
||||
if (is_array($oids_out)) {
|
||||
foreach ($oids_out as $index => $entry) {
|
||||
$cur_oid = '.1.3.6.1.4.1.2468.1.4.2.1.3.2.3.1.5.'.$index;
|
||||
$divisor = 10;
|
||||
$descr = (trim($cache['ipoman']['out'][$index]['outletConfigDesc'], '"') != '' ? trim($cache['ipoman']['out'][$index]['outletConfigDesc'], '"') : "Output $index");
|
||||
$power = ($entry['outletStatusWH'] / $divisor);
|
||||
|
||||
discover_sensor($valid['sensor'], 'power', $device, $cur_oid, '2.3.1.3.'.$index, 'ipoman', $descr, $divisor, '1', null, null, null, null, $power);
|
||||
}
|
||||
}
|
||||
}//end if
|
||||
}
|
||||
|
||||
@@ -23,16 +23,13 @@
|
||||
* @author Tony Murray <[email protected]>
|
||||
*/
|
||||
|
||||
echo 'Netonix: ';
|
||||
|
||||
if ($device['os'] == 'netonix') {
|
||||
echo 'Netonix: ';
|
||||
$power_oid = '.1.3.6.1.4.1.46242.6.0'; // NETONIX-SWITCH-MIB::totalPowerConsumption
|
||||
$power_value = snmp_get($device, $power_oid, '-Oqv');
|
||||
$descr = 'Total Consumption';
|
||||
$divisor = 10;
|
||||
|
||||
$power_oid = '.1.3.6.1.4.1.46242.6.0'; // NETONIX-SWITCH-MIB::totalPowerConsumption
|
||||
$power_value = snmp_get($device, $power_oid, '-Oqv');
|
||||
$descr = 'Total Consumption';
|
||||
$divisor = 10;
|
||||
|
||||
if (is_numeric($power_value) && $power_value > 0) {
|
||||
discover_sensor($valid['sensor'], 'power', $device, $power_oid, 0, $device['os'], $descr, $divisor, 1, null, null, null, null, $power_value / $divisor);
|
||||
}
|
||||
if (is_numeric($power_value) && $power_value > 0) {
|
||||
discover_sensor($valid['sensor'], 'power', $device, $power_oid, 0, $device['os'], $descr, $divisor, 1, null, null, null, null, $power_value / $divisor);
|
||||
}
|
||||
|
||||
@@ -1,27 +1,25 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'raritan') {
|
||||
// Check Inlets
|
||||
$inlet_oids = snmp_walk($device, 'inletLabel', '-Osqn', 'PDU2-MIB');
|
||||
$inlet_oids = trim($inlet_oids);
|
||||
if ($inlet_oids) {
|
||||
echo 'PDU Inlet ';
|
||||
}
|
||||
// Check Inlets
|
||||
$inlet_oids = snmp_walk($device, 'inletLabel', '-Osqn', 'PDU2-MIB');
|
||||
$inlet_oids = trim($inlet_oids);
|
||||
if ($inlet_oids) {
|
||||
echo 'PDU Inlet ';
|
||||
}
|
||||
|
||||
foreach (explode("\n", $inlet_oids) as $inlet_data) {
|
||||
$inlet_data = trim($inlet_data);
|
||||
if ($inlet_data) {
|
||||
list($inlet_oid,$inlet_descr) = explode(' ', $inlet_data, 2);
|
||||
$inlet_split_oid = explode('.', $inlet_oid);
|
||||
$inlet_index = $inlet_split_oid[(count($inlet_split_oid) - 2)].'.'.$inlet_split_oid[(count($inlet_split_oid) - 1)];
|
||||
foreach (explode("\n", $inlet_oids) as $inlet_data) {
|
||||
$inlet_data = trim($inlet_data);
|
||||
if ($inlet_data) {
|
||||
list($inlet_oid,$inlet_descr) = explode(' ', $inlet_data, 2);
|
||||
$inlet_split_oid = explode('.', $inlet_oid);
|
||||
$inlet_index = $inlet_split_oid[(count($inlet_split_oid) - 2)].'.'.$inlet_split_oid[(count($inlet_split_oid) - 1)];
|
||||
|
||||
$inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.$inlet_index.5";
|
||||
$inlet_divisor = pow(10, snmp_get($device, "inletSensorDecimalDigits.$inlet_index.activePower", '-Ovq', 'PDU2-MIB'));
|
||||
$inlet_power = (snmp_get($device, "measurementsInletSensorValue.$inlet_index.activePower", '-Ovq', 'PDU2-MIB') / $inlet_divisor);
|
||||
$inlet_oid = ".1.3.6.1.4.1.13742.6.5.2.3.1.4.$inlet_index.5";
|
||||
$inlet_divisor = pow(10, snmp_get($device, "inletSensorDecimalDigits.$inlet_index.activePower", '-Ovq', 'PDU2-MIB'));
|
||||
$inlet_power = (snmp_get($device, "measurementsInletSensorValue.$inlet_index.activePower", '-Ovq', 'PDU2-MIB') / $inlet_divisor);
|
||||
|
||||
if ($inlet_power >= 0) {
|
||||
discover_sensor($valid['sensor'], 'power', $device, $inlet_oid, $inlet_index, 'raritan', $inlet_descr, $inlet_divisor, 1, null, null, null, null, $inlet_power);
|
||||
}
|
||||
if ($inlet_power >= 0) {
|
||||
discover_sensor($valid['sensor'], 'power', $device, $inlet_oid, $inlet_index, 'raritan', $inlet_descr, $inlet_divisor, 1, null, null, null, null, $inlet_power);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,57 +1,54 @@
|
||||
<?php
|
||||
|
||||
// RFC1628 UPS
|
||||
if (isset($config['modules_compat']['rfc1628'][$device['os']]) && $config['modules_compat']['rfc1628'][$device['os']]) {
|
||||
echo("RFC1628 ");
|
||||
echo("RFC1628 ");
|
||||
|
||||
$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++) {
|
||||
$current_oid = ".1.3.6.1.2.1.33.1.4.4.1.4.$i";
|
||||
$descr = "Output";
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
$current = snmp_get($device, $current_oid, "-Oqv");
|
||||
$type = "rfc1628";
|
||||
$precision = 1;
|
||||
$index = 300+$i;
|
||||
|
||||
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.4.3.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.4.4.1.4.$i";
|
||||
$descr = "Output";
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
$current = snmp_get($device, $current_oid, "-Oqv");
|
||||
$type = "rfc1628";
|
||||
$precision = 1;
|
||||
$index = 300+$i;
|
||||
|
||||
$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";
|
||||
$descr = "Input";
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
$current = snmp_get($device, $current_oid, "-Oqv");
|
||||
$type = "rfc1628";
|
||||
$precision = 1;
|
||||
$index = 100+$i;
|
||||
|
||||
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"));
|
||||
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.4.$i";
|
||||
$descr = "Bypass";
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
$current = snmp_get($device, $current_oid, "-Oqv");
|
||||
$type = "rfc1628";
|
||||
$precision = 1;
|
||||
$index = 200+$i;
|
||||
|
||||
discover_sensor($valid['sensor'], 'power', $device, $current_oid, $index, $type, $descr, '1', '1', null, null, null, null, $current);
|
||||
}
|
||||
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"));
|
||||
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";
|
||||
$descr = "Input";
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
$current = snmp_get($device, $current_oid, "-Oqv");
|
||||
$type = "rfc1628";
|
||||
$precision = 1;
|
||||
$index = 100+$i;
|
||||
|
||||
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"));
|
||||
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.4.$i";
|
||||
$descr = "Bypass";
|
||||
if ($numPhase > 1) {
|
||||
$descr .= " Phase $i";
|
||||
}
|
||||
$current = snmp_get($device, $current_oid, "-Oqv");
|
||||
$type = "rfc1628";
|
||||
$precision = 1;
|
||||
$index = 200+$i;
|
||||
|
||||
discover_sensor($valid['sensor'], 'power', $device, $current_oid, $index, $type, $descr, '1', '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
<?php
|
||||
|
||||
if ($device['os'] == 'routeros') {
|
||||
echo 'MIKROTIK-MIB ';
|
||||
// Power Usage
|
||||
$descr = "Power Usage";
|
||||
$oid = ".1.3.6.1.4.1.14988.1.1.3.12.0"; // MIKROTIK-MIB::mtxrHlPower
|
||||
$value = snmp_get($device, $oid, '-Oqv');
|
||||
$divisor = "10";
|
||||
echo 'MIKROTIK-MIB ';
|
||||
// Power Usage
|
||||
$descr = "Power Usage";
|
||||
$oid = ".1.3.6.1.4.1.14988.1.1.3.12.0"; // MIKROTIK-MIB::mtxrHlPower
|
||||
$value = snmp_get($device, $oid, '-Oqv');
|
||||
$divisor = "10";
|
||||
|
||||
if (is_numeric($value)) {
|
||||
discover_sensor($valid['sensor'], 'power', $device, $oid, '1', 'power', $descr, $divisor, 1, null, null, null, null, $value / $divisor);
|
||||
}
|
||||
if (is_numeric($value)) {
|
||||
discover_sensor($valid['sensor'], 'power', $device, $oid, '1', 'power', $descr, $divisor, 1, null, null, null, null, $value / $divisor);
|
||||
}
|
||||
|
||||
@@ -23,22 +23,20 @@
|
||||
* @author Tony Murray <[email protected]>
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'sinetica') {
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.4.4.1.4', array());
|
||||
$oids = snmpwalk_cache_oid_num($device, '.1.3.6.1.4.1.13891.101.4.4.1.4', array());
|
||||
|
||||
foreach ($oids as $oid => $data) {
|
||||
$current_id = substr($oid, strrpos($oid, '.') + 1);
|
||||
foreach ($oids as $oid => $data) {
|
||||
$current_id = substr($oid, strrpos($oid, '.') + 1);
|
||||
|
||||
$current_oid = ".$oid";
|
||||
$descr = 'Output';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $current_id";
|
||||
}
|
||||
$divisor = 10;
|
||||
$current = current($data) / $divisor;
|
||||
$type = 'sinetica';
|
||||
$index = '4.4.1.4.' . $current_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'power', $device, $current_oid, $index, $type, $descr, $divisor, 1, null, null, null, null, $current);
|
||||
$current_oid = ".$oid";
|
||||
$descr = 'Output';
|
||||
if (count($oids) > 1) {
|
||||
$descr .= " Phase $current_id";
|
||||
}
|
||||
$divisor = 10;
|
||||
$current = current($data) / $divisor;
|
||||
$type = 'sinetica';
|
||||
$index = '4.4.1.4.' . $current_id;
|
||||
|
||||
discover_sensor($valid['sensor'], 'power', $device, $current_oid, $index, $type, $descr, $divisor, 1, null, null, null, null, $current);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
echo(" EXTREME-BASE-MIB ");
|
||||
// Power Usage
|
||||
$descr = "Power Usage";
|
||||
$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";
|
||||
|
||||
if (is_numeric($value)) {
|
||||
$value = ($value / $divisor); // Nasty hack to divide the first value by 1000 since the divisor only works for polling after the sensor has been added
|
||||
discover_sensor($valid['sensor'], 'power', $device, $oid, '1', 'extreme-power', $descr, $divisor, 1, null, null, null, null, $value); // No limits have been specified since all equipment is different and will use different amount of Watts
|
||||
}
|
||||
@@ -23,5 +23,8 @@
|
||||
* @author Neil Lathwood <[email protected]>
|
||||
*/
|
||||
|
||||
$emu2_temp_scale = snmp_get($device, 'emsStatusSysTempUnits.0', '-OQv', 'PowerNet-MIB');
|
||||
$emu2_temp = snmpwalk_cache_oid($device, 'emsProbeStatusEntry', array(), 'PowerNet-MIB');
|
||||
if ($device['os'] === 'aos-emu2') {
|
||||
$pre_cache['emu2_temp_scale'] = snmp_get($device, 'emsStatusSysTempUnits.0', '-OQv', 'PowerNet-MIB');
|
||||
$pre_cache['emu2_temp'] = snmpwalk_cache_oid($device, 'emsProbeStatusEntry', array(), 'PowerNet-MIB');
|
||||
d_echo($pre_cache);
|
||||
}
|
||||
|
||||
@@ -23,4 +23,7 @@
|
||||
* @author Neil Lathwood <[email protected]>
|
||||
*/
|
||||
|
||||
$cooling_unit_analog = snmpwalk_cache_oid($device, 'coolingUnitStatusAnalogEntry', array(), 'PowerNet-MIB');
|
||||
if ($device['os'] === 'apc') {
|
||||
$pre_cache['cooling_unit_analog'] = snmpwalk_cache_oid($device, 'coolingUnitStatusAnalogEntry', array(), 'PowerNet-MIB');
|
||||
d_echo($pre_cache);
|
||||
}
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'comware') {
|
||||
echo 'Pre-cache Comware: ';
|
||||
|
||||
$comware_oids = array();
|
||||
echo 'Caching OIDs:';
|
||||
|
||||
$comware_oids = snmpwalk_cache_multi_oid($device, 'hh3cTransceiverInfoTable', array(), 'HH3C-TRANSCEIVER-INFO-MIB');
|
||||
if ($device['os'] === 'comware') {
|
||||
$pre_cache['comware_oids'] = snmpwalk_cache_multi_oid($device, 'hh3cTransceiverInfoTable', array(), 'HH3C-TRANSCEIVER-INFO-MIB');
|
||||
d_echo($pre_cache);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user