mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
@@ -725,7 +725,7 @@ function avtech_add_sensor($device, $sensor) {
|
||||
global $valid;
|
||||
|
||||
// set the id, must be unique
|
||||
if ($sensor['id']) {
|
||||
if (isset($sensor['id'])) {
|
||||
$id = $sensor['id'];
|
||||
}
|
||||
else {
|
||||
@@ -755,13 +755,13 @@ function avtech_add_sensor($device, $sensor) {
|
||||
d_echo('Sensor value: ' . $value . "\n");
|
||||
|
||||
// get the type
|
||||
$type = $device['type'] ? $device['type'] : 'temperature';
|
||||
$type = $sensor['type'] ? $sensor['type'] : 'temperature';
|
||||
d_echo('Sensor type: ' . $type . "\n");
|
||||
|
||||
|
||||
// set the description
|
||||
if ($sensor['descr_oid']) {
|
||||
$descr = snmp_get($device, $sensor['descr_oid'], '-OvQ');
|
||||
$descr = trim(snmp_get($device, $sensor['descr_oid'], '-OvQ'), '"');
|
||||
}
|
||||
elseif ($sensor['descr']) {
|
||||
$descr = $sensor['descr'];
|
||||
|
||||
@@ -8,21 +8,21 @@ if ($device['os'] == 'avtech') {
|
||||
$device_oid = '.1.3.6.1.4.1.20916.1.7.';
|
||||
|
||||
$internal = array(
|
||||
'id' => 1,
|
||||
'id' => 0,
|
||||
'oid' => $device_oid.'1.1.1.1.0',
|
||||
'descr_oid' => $device_oid.'1.1.2.0',
|
||||
);
|
||||
avtech_add_sensor($device, $internal);
|
||||
|
||||
$sen1 = array(
|
||||
'id' => 2,
|
||||
'id' => 1,
|
||||
'oid' => $device_oid.'1.2.1.1.0',
|
||||
'descr_oid' => $device_oid.'1.2.1.3.0',
|
||||
);
|
||||
avtech_add_sensor($device, $sen1);
|
||||
|
||||
$sen2 = array(
|
||||
'id' => 3,
|
||||
'id' => 2,
|
||||
'oid' => $device_oid.'1.2.2.1.0',
|
||||
'descr_oid' => $device_oid.'1.2.2.3.0',
|
||||
);
|
||||
@@ -33,7 +33,7 @@ if ($device['os'] == 'avtech') {
|
||||
$device_oid = '.1.3.6.1.4.1.20916.1.1.';
|
||||
|
||||
$internal = array(
|
||||
'id' => 1,
|
||||
'id' => 0,
|
||||
'oid' => $device_oid.'1.1.1.0',
|
||||
'descr' => 'Internal',
|
||||
'max_oid' => $device_oid.'3.1.0',
|
||||
@@ -42,7 +42,7 @@ if ($device['os'] == 'avtech') {
|
||||
avtech_add_sensor($device, $internal);
|
||||
|
||||
$sen1 = array(
|
||||
'id' => 2,
|
||||
'id' => 1,
|
||||
'oid' => $device_oid.'1.1.2.0',
|
||||
'descr' => 'Sensor 1',
|
||||
'max_oid' => $device_oid.'3.3.0',
|
||||
@@ -51,7 +51,7 @@ if ($device['os'] == 'avtech') {
|
||||
avtech_add_sensor($device, $sen1);
|
||||
|
||||
$sen2 = array(
|
||||
'id' => 3,
|
||||
'id' => 2,
|
||||
'oid' => $device_oid.'1.1.3.0',
|
||||
'descr' => 'Sensor 2',
|
||||
'max_oid' => $device_oid.'3.5.0',
|
||||
@@ -60,7 +60,7 @@ if ($device['os'] == 'avtech') {
|
||||
avtech_add_sensor($device, $sen2);
|
||||
|
||||
$sen3 = array(
|
||||
'id' => 4,
|
||||
'id' => 3,
|
||||
'oid' => $device_oid.'1.1.4.0',
|
||||
'descr' => 'Sensor 3',
|
||||
'max_oid' => $device_oid.'3.7.0',
|
||||
@@ -74,7 +74,7 @@ if ($device['os'] == 'avtech') {
|
||||
$divisor = 1;
|
||||
|
||||
$internal = array(
|
||||
'id' => 1,
|
||||
'id' => 0,
|
||||
'oid' => $device_oid.'1.1.1.2.0',
|
||||
'descr_oid' => $device_oid.'1.1.2.1.0',
|
||||
'divisor' => $divisor,
|
||||
@@ -82,7 +82,7 @@ if ($device['os'] == 'avtech') {
|
||||
avtech_add_sensor($device, $internal);
|
||||
|
||||
$sen1 = array(
|
||||
'id' => 2,
|
||||
'id' => 1,
|
||||
'oid' => $device_oid.'1.2.2.1.0',
|
||||
'descr_oid' => $device_oid.'1.2.1.6.0',
|
||||
'divisor' => $divisor,
|
||||
@@ -90,7 +90,7 @@ if ($device['os'] == 'avtech') {
|
||||
avtech_add_sensor($device, $sen1);
|
||||
|
||||
$sen2 = array(
|
||||
'id' => 3,
|
||||
'id' => 2,
|
||||
'oid' => $device_oid.'1.2.2.1.0',
|
||||
'descr_oid' => $device_oid.'1.2.2.6.0',
|
||||
'divisor' => $divisor,
|
||||
|
||||
Reference in New Issue
Block a user