mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #3608 from laf/issue-3590
Added base support + sensors for IBM AMM
This commit is contained in:
@@ -1744,6 +1744,11 @@ $config['os'][$os]['text'] = 'Infoblox';
|
||||
$config['os'][$os]['type'] = 'appliance';
|
||||
$config['os'][$os]['icon'] = 'infoblox';
|
||||
|
||||
$os = 'ibm-amm';
|
||||
$config['os'][$os]['text'] = 'IBM AMM';
|
||||
$config['os'][$os]['type'] = 'appliance';
|
||||
$config['os'][$os]['icon'] = 'ibmnos';
|
||||
|
||||
// Oracle ILOM
|
||||
$os = 'oracle-ilom';
|
||||
$config['os'][$os]['text'] = 'Oracle ILOM';
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS IBM NOS information module
|
||||
*
|
||||
* Copyright (c) 2015 Søren Friis Rosiak <sorenrosiak@gmail.com>
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if (!$os) {
|
||||
if (stristr($sysDescr, 'BladeCenter Advanced Management Module')) {
|
||||
$os = 'ibm-amm';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2016 Neil Lathwood <neil@lathwood.co.uk>
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'ibm-amm') {
|
||||
|
||||
$oids = array('blower1speedRPM', 'blower2speedRPM', 'blower3speedRPM', 'blower4speedRPM');
|
||||
d_echo($oids."\n");
|
||||
if (!empty($oids)) {
|
||||
|
||||
echo 'BLADE-MIB ';
|
||||
foreach ($oids as $index => $data) {
|
||||
|
||||
if (!empty($data)) {
|
||||
$value = trim(snmp_get($device, $data.'.0', '-Oqv', 'BLADE-MIB'), '"');
|
||||
|
||||
if (is_numeric($value)) {
|
||||
$oid = 'BLADE-MIB::' . $data . '.0';
|
||||
$descr = $data;
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $oid, $index, 'snmp', $descr, 1, 1, null, null, null, null, $value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2016 Neil Lathwood <neil@lathwood.co.uk>
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'ibm-amm') {
|
||||
|
||||
$index = 1;
|
||||
$oids = array(
|
||||
'blower1State' => '.1.3.6.1.4.1.2.3.51.2.2.3.10.0',
|
||||
'blower2State' => '.1.3.6.1.4.1.2.3.51.2.2.3.11.0',
|
||||
'blower3State' => '.1.3.6.1.4.1.2.3.51.2.2.3.12.0',
|
||||
'blower4State' => '.1.3.6.1.4.1.2.3.51.2.2.3.13.0'
|
||||
);
|
||||
|
||||
foreach ($oids as $state_name => $oid) {
|
||||
|
||||
$state = snmp_get($device, $oid, '-Oqv');
|
||||
if (!empty($state)) {
|
||||
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
if ($state_index_id) {
|
||||
|
||||
$states = array(
|
||||
array($state_index_id,'unknown',0,0,3) ,
|
||||
array($state_index_id,'good',1,1,0) ,
|
||||
array($state_index_id,'warning',1,2,1) ,
|
||||
array($state_index_id,'bad',1,3,2) ,
|
||||
);
|
||||
|
||||
foreach($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}//end foreach
|
||||
|
||||
}//end if
|
||||
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $state_name, '1', '1', null, null, null, null, $state, 'snmp', $index);
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
$index++;
|
||||
|
||||
}//end if
|
||||
|
||||
}//end foreach
|
||||
|
||||
$index = 1;
|
||||
$oids = array(
|
||||
'blower1ControllerState' => '.1.3.6.1.4.1.2.3.51.2.2.3.30.0',
|
||||
'blower2ControllerState' => '.1.3.6.1.4.1.2.3.51.2.2.3.31.0',
|
||||
'blower3ControllerState' => '.1.3.6.1.4.1.2.3.51.2.2.3.32.0',
|
||||
'blower4ControllerState' => '.1.3.6.1.4.1.2.3.51.2.2.3.33.0');
|
||||
|
||||
foreach ($oids as $state_name => $oid) {
|
||||
|
||||
$state = snmp_get($device, $oid, '-Oqv');
|
||||
|
||||
if (is_numeric($state) && $state != 2) {
|
||||
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
if ($state_index_id) {
|
||||
|
||||
$states = array(
|
||||
array($state_index_id,'operational',0,0,0),
|
||||
array($state_index_id,'flashing',1,1,1),
|
||||
array($state_index_id,'notPresent',1,2,2),
|
||||
array($state_index_id,'communicationError',1,3,2),
|
||||
array($state_index_id,'unknown',1,4,2),
|
||||
);
|
||||
|
||||
foreach($states as $value) {
|
||||
$insert = array(
|
||||
'state_index_id' => $value[0],
|
||||
'state_descr' => $value[1],
|
||||
'state_draw_graph' => $value[2],
|
||||
'state_value' => $value[3],
|
||||
'state_generic_value' => $value[4]
|
||||
);
|
||||
dbInsert($insert, 'state_translations');
|
||||
}//end foreach
|
||||
|
||||
}//end if
|
||||
|
||||
discover_sensor($valid['sensor'], 'state', $device, $oid, $index, $state_name, $state_name, '1', '1', null, null, null, null, $state, 'snmp', $index);
|
||||
//Create Sensor To State Index
|
||||
create_sensor_to_state_index($device, $state_name, $index);
|
||||
$index++;
|
||||
|
||||
}//end if
|
||||
|
||||
}//end foreach
|
||||
|
||||
}//end if
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS
|
||||
*
|
||||
* Copyright (c) 2016 Neil Lathwood <neil@lathwood.co.uk>
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
if ($device['os'] == 'ibm-amm') {
|
||||
$oid = 'BLADE-MIB::mmTemp.0';
|
||||
$mmtemp = snmp_get($device, $oid, '-OsqnU');
|
||||
|
||||
preg_match('/[\d\.]+/', $mmtemp, $temp_response);
|
||||
if (!empty($temp_response[0])) {
|
||||
$mmtemp = $temp_response[0];
|
||||
}
|
||||
|
||||
d_echo($mmtemp);
|
||||
|
||||
if (!empty($mmtemp)) {
|
||||
$descr = 'Management module temperature';
|
||||
$divisor = 1;
|
||||
$current = $mmtemp;
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $oid, 'ibm-amm', $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oid = 'BLADE-MIB::frontPanelTemp.0';
|
||||
$fptemp = snmp_get($device, $oid, '-OsqnU');
|
||||
|
||||
preg_match('/[\d\.]+/', $fptemp, $temp_response);
|
||||
if (!empty($temp_response[0])) {
|
||||
$fptemp = $temp_response[0];
|
||||
}
|
||||
|
||||
d_echo($fptemp);
|
||||
|
||||
if (!empty($fptemp)) {
|
||||
$descr = 'Front panel temperature';
|
||||
$divisor = 1;
|
||||
$current = $fptemp;
|
||||
discover_sensor($valid['sensor'], 'temperature', $device, $oid, $oid, 'ibm-amm', $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
}
|
||||
+34691
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user