mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-09 00:12:58 +02:00
Added base support + sensors for IBM AMM
This commit is contained in:
@@ -1666,6 +1666,17 @@ $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';
|
||||
$config['os'][$os]['over'][0]['graph'] = 'device_bits';
|
||||
$config['os'][$os]['over'][0]['text'] = 'Traffic';
|
||||
$config['os'][$os]['over'][1]['graph'] = 'device_processor';
|
||||
$config['os'][$os]['over'][1]['text'] = 'CPU Usage';
|
||||
$config['os'][$os]['over'][2]['graph'] = 'device_mempool';
|
||||
$config['os'][$os]['over'][2]['text'] = 'Memory Usage';
|
||||
|
||||
// Lenovo EMC (NAS)
|
||||
$os = 'lenovoemc';
|
||||
$config['os'][$os]['type'] = 'storage';
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (stristr($sysDescr, 'BladeCenter Advanced Management Module')) {
|
||||
$os = 'ibm-amm';
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?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', 'blower1speedRPM', 'blower1speedRPM', 'blower1speedRPM');
|
||||
d_echo($oids."\n");
|
||||
if (!empty($oids)) {
|
||||
|
||||
echo 'BLADE-MIB';
|
||||
foreach ($oids as $data) {
|
||||
|
||||
if (!empty($data)) {
|
||||
$value = snmp_get($device, $oid.'.0', '-OsqnU', 'BLADE-MIB');
|
||||
if (is_numeric($value)) {
|
||||
$descr = $data;
|
||||
discover_sensor($valid['sensor'], 'fanspeed', $device, $data, 0, 'snmp', $descr, 1, 1, null, null, null, null, $value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
<?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','blower2State','blower3State','blower4State');
|
||||
|
||||
foreach ($oids as $oid) {
|
||||
|
||||
$state = snmp_get($device, $oid.'.0', '-OsqnU', 'BLADE-MIB');
|
||||
|
||||
if (!empty($state)) {
|
||||
|
||||
$state_name = $oid;
|
||||
$state_index_id = create_state_index($state_name);
|
||||
|
||||
if ($state_index_id) {
|
||||
|
||||
$states = array(
|
||||
array($state_index_id,'uknown',0,1,3) ,
|
||||
array($state_index_id,'good',1,2,0) ,
|
||||
array($state_index_id,'warning',1,3,1) ,
|
||||
array($state_index_id,'bad',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, 0, $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','blower2ControllerState','blower3ControllerState','blower4ControllerState');
|
||||
|
||||
foreach ($oids as $oid) {
|
||||
|
||||
$state = snmp_get($device, $oid.'.0', '-OsqnU', 'BLADE-MIB');
|
||||
|
||||
if (!empty($state)) {
|
||||
|
||||
$state_name = $oid;
|
||||
$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, 0, $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 = 'mmTemp.0';
|
||||
$mmtemp = snmp_get($device, $oid, '-OsqnU', 'BLADE-MIB');
|
||||
|
||||
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, 0, 'ibm-amm', $descr, $divisor, '1', null, null, null, null, $current);
|
||||
}
|
||||
|
||||
$oid = 'frontPanelTemp.0';
|
||||
$fptemp = snmp_get($device, $oid, '-OsqnU', 'BLADE-MIB');
|
||||
|
||||
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, 0, '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