mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added mem/cpu support for TiMOS (#6483)
This commit is contained in:
committed by
Tony Murray
parent
c31bc7d844
commit
f418a80a5e
35
includes/discovery/mempools/timos.inc.php
Normal file
35
includes/discovery/mempools/timos.inc.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* timos.inc.php
|
||||
*
|
||||
* LibreNMS mempools discovery module for TiMOS
|
||||
*
|
||||
* 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 2017 Neil Lathwood
|
||||
* @author Neil Lathwood <gh+n@laf.io>
|
||||
*/
|
||||
|
||||
if ($device['os'] === 'timos') {
|
||||
echo 'TiMOS Memory: ';
|
||||
|
||||
$used = snmp_get($device, '.1.3.6.1.4.1.6527.3.1.2.1.1.2.0', '-OvQ');
|
||||
$free = snmp_get($device, '.1.3.6.1.4.1.6527.3.1.2.1.1.4.0', '-OvQ');
|
||||
|
||||
if (is_numeric($used) && is_numeric($free)) {
|
||||
discover_mempool($valid_mempool, $device, 0, 'timos', 'Memory', '1', null, null);
|
||||
}
|
||||
}
|
34
includes/discovery/processors/timos.inc.php
Normal file
34
includes/discovery/processors/timos.inc.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* timos.inc.php
|
||||
*
|
||||
* LibreNMS processor discovery module for TiMOS
|
||||
*
|
||||
* 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 2017 Neil Lathwood
|
||||
* @author Neil Lathwood <gh+n@laf.io>
|
||||
*/
|
||||
|
||||
if ($device['os'] === 'timos') {
|
||||
echo 'TiMOS CPU: ';
|
||||
$descr = 'Processor';
|
||||
$oid = '.1.3.6.1.4.1.6527.3.1.2.1.1.1.0';
|
||||
$usage = snmp_get($device, $oid, '-Ovqn');
|
||||
if (is_numeric($usage)) {
|
||||
discover_processor($valid['processor'], $device, $oid, '0', 'timos', $descr, '1', $usage, null, null);
|
||||
}
|
||||
}
|
30
includes/polling/mempools/timos.inc.php
Normal file
30
includes/polling/mempools/timos.inc.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* timos.inc.php
|
||||
*
|
||||
* LibreNMS mempools polling module for TiMOS
|
||||
*
|
||||
* 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 2017 Neil Lathwood
|
||||
* @author Neil Lathwood <gh+n@laf.io>
|
||||
*/
|
||||
|
||||
$used = snmp_get($device, '.1.3.6.1.4.1.6527.3.1.2.1.1.2.0', '-OvQ');
|
||||
$free = snmp_get($device, '.1.3.6.1.4.1.6527.3.1.2.1.1.3.0', '-OvQ');
|
||||
$mempool['total'] = ($free + $used);
|
||||
$mempool['free'] = $free;
|
||||
$mempool['used'] = $used;
|
Reference in New Issue
Block a user