From 5c58cc011ad5fa8a47f7242ce4cf2df317726a96 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Tue, 13 Jun 2017 08:11:09 +0100 Subject: [PATCH] newdevice: Added support for processor and memory for 3com devices (#6823) --- includes/discovery/mempools/3com.inc.php | 34 ++++++++++++++++++++++ includes/discovery/processors/3com.inc.php | 34 ++++++++++++++++++++++ includes/polling/mempools/3com.inc.php | 34 ++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 includes/discovery/mempools/3com.inc.php create mode 100644 includes/discovery/processors/3com.inc.php create mode 100644 includes/polling/mempools/3com.inc.php diff --git a/includes/discovery/mempools/3com.inc.php b/includes/discovery/mempools/3com.inc.php new file mode 100644 index 0000000000..8e3e1e49a2 --- /dev/null +++ b/includes/discovery/mempools/3com.inc.php @@ -0,0 +1,34 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2017 Neil Lathwood + * @author Neil Lathwood + */ + +if ($device['os'] === '3com') { + echo '3COM:'; + + $usage = snmp_get($device, '.1.3.6.1.4.1.43.45.1.6.1.2.1.1.3.65536', '-Ovq'); + if (is_numeric($usage)) { + $descr = 'Memory'; + discover_mempool($valid_mempool, $device, 0, '3com', $descr, '1', null, null); + } +} diff --git a/includes/discovery/processors/3com.inc.php b/includes/discovery/processors/3com.inc.php new file mode 100644 index 0000000000..363c5a91d8 --- /dev/null +++ b/includes/discovery/processors/3com.inc.php @@ -0,0 +1,34 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2017 Neil Lathwood + * @author Neil Lathwood + */ + +if ($device['os'] === '3com') { + echo '3COM:'; + + $usage = snmp_get($device, '.1.3.6.1.4.1.43.45.1.6.1.1.1.3.65536', '-Ovq'); + if (is_numeric($usage)) { + $descr = "Processor"; + discover_processor($valid['processor'], $device, ".1.3.6.1.4.1.43.45.1.6.1.1.1.3.65536", 0, '3com', $descr, '1', $usage, null, null); + } +} diff --git a/includes/polling/mempools/3com.inc.php b/includes/polling/mempools/3com.inc.php new file mode 100644 index 0000000000..5c067f059c --- /dev/null +++ b/includes/polling/mempools/3com.inc.php @@ -0,0 +1,34 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2017 Neil Lathwood + * @author Neil Lathwood + */ + +if ($device['os'] === '3com') { + echo '3COM:'; + + $tmp_data = snmp_get_multi_oid($device, '.1.3.6.1.4.1.43.45.1.6.1.2.1.1.3.65536 .1.3.6.1.4.1.43.45.1.6.1.2.1.1.2.65536'); + + $mempool['total'] = $tmp_data['.1.3.6.1.4.1.43.45.1.6.1.2.1.1.2.65536']; + $mempool['free'] = $tmp_data['.1.3.6.1.4.1.43.45.1.6.1.2.1.1.3.65536']; + $mempool['used'] = $mempool['total'] - $mempool['free']; +}