diff --git a/includes/definitions/jetstream.yaml b/includes/definitions/jetstream.yaml index f7385a1fd2..d28c8c533a 100644 --- a/includes/definitions/jetstream.yaml +++ b/includes/definitions/jetstream.yaml @@ -2,6 +2,8 @@ os: jetstream text: 'TP-Link JetStream' type: network icon: tplink +mib_dir: + - tplink discovery: - sysObjectId: - .1.3.6.1.4.1.11863.5.34 diff --git a/includes/discovery/mempools/jetstream.inc.php b/includes/discovery/mempools/jetstream.inc.php new file mode 100644 index 0000000000..940e111f5b --- /dev/null +++ b/includes/discovery/mempools/jetstream.inc.php @@ -0,0 +1,41 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2017 Neil Lathwood + * @author Neil Lathwood + */ + +if ($device['os'] === 'jetstream') { + $data = snmpwalk_cache_oid($device, 'tpSysMonitorMemoryTable', array(), 'TPLINK-SYSMONITOR-MIB', 'hp'); + foreach ($data as $index => $item) { + if (is_numeric($item['tpSysMonitorMemoryUtilization'])) { + $descr = "Memory #$index"; + discover_mempool($valid_mempool, $device, $index, 'jetstream', $descr, '1'); + } + } +} + +unset( + $data, + $descr, + $index, + $item +); diff --git a/includes/discovery/processors/jetstream.inc.php b/includes/discovery/processors/jetstream.inc.php new file mode 100644 index 0000000000..6279e4204c --- /dev/null +++ b/includes/discovery/processors/jetstream.inc.php @@ -0,0 +1,45 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2017 Neil Lathwood + * @author Neil Lathwood + */ + +if ($device['os'] === 'jetstream') { + $data = snmpwalk_cache_oid($device, 'tpSysMonitorCpuTable', array(), 'TPLINK-SYSMONITOR-MIB', 'hp'); + foreach ($data as $index => $item) { + if (is_numeric($item['tpSysMonitorCpu5Seconds'])) { + $descr = "Proc #$index"; + $oid = '.1.3.6.1.4.1.11863.6.4.1.1.1.1.2.' . $index; + $usage = $item['tpSysMonitorCpu5Seconds']; + discover_processor($valid['processor'], $device, $oid, $index, 'jetstream', $descr, 1, $usage); + } + } +} + +unset( + $data, + $descr, + $index, + $oid, + $item, + $usage +); diff --git a/includes/polling/mempools/jetstream.inc.php b/includes/polling/mempools/jetstream.inc.php new file mode 100644 index 0000000000..d086060c67 --- /dev/null +++ b/includes/polling/mempools/jetstream.inc.php @@ -0,0 +1,37 @@ +. + * + * @package LibreNMS + * @link http://librenms.org + * @copyright 2017 Neil Lathwood + * @author Neil Lathwood + */ + +if ($device['os'] === 'jetstream') { + $oid = '.1.3.6.1.4.1.11863.6.4.1.2.1.1.2.' . $mempool['mempool_index']; + $used = snmp_get($device, $oid, '-OvQ'); + $mempool['total'] = 100; + $mempool['free'] = ($mempool['total'] - $used); + $mempool['used'] = $used; +} + +unset( + $oid, + $used +); diff --git a/mibs/tplink/TPLINK-MIB b/mibs/tplink/TPLINK-MIB new file mode 100644 index 0000000000..0e722315e6 --- /dev/null +++ b/mibs/tplink/TPLINK-MIB @@ -0,0 +1,40 @@ +TPLINK-MIB DEFINITIONS ::= BEGIN + +--iso OBJECT IDENTIFIER ::= { 1 } +--org OBJECT IDENTIFIER ::= { iso 3 } +--dod OBJECT IDENTIFIER ::= { org 6 } +--internet OBJECT IDENTIFIER ::= { dod 1 } +--private OBJECT IDENTIFIER ::= { internet 4 } +--enterprises OBJECT IDENTIFIER ::= { private 1 } + + IMPORTS + enterprises + FROM RFC1155-SMI + OBJECT-IDENTITY + FROM SNMPv2-SMI; + + tplink OBJECT IDENTIFIER ::= { enterprises 11863 } + + switch OBJECT IDENTIFIER ::= { tplink 1 } + router OBJECT IDENTIFIER ::= { tplink 2 } + wireless OBJECT IDENTIFIER ::= { tplink 3 } + adsl OBJECT IDENTIFIER ::= { tplink 4 } + + + tplinkProducts OBJECT-IDENTITY + STATUS current + DESCRIPTION + "tplinkProducts is the root OBJECT IDENTIFIER from + which sysObjectID values are assigned. Actual + values are defined in TPLINK-PRODUCTS-MIB." + ::= { tplink 5 } + + tplinkMgmt OBJECT-IDENTITY + STATUS current + DESCRIPTION + "tplinkMgmt is the main subtree for new mib development." + + ::= { tplink 6 } + +END + diff --git a/mibs/tplink/TPLINK-SYSMONITOR-MIB b/mibs/tplink/TPLINK-SYSMONITOR-MIB new file mode 100644 index 0000000000..cc61061e54 --- /dev/null +++ b/mibs/tplink/TPLINK-SYSMONITOR-MIB @@ -0,0 +1,185 @@ +-- ============================================================================ +-- Copyright(c) 2008-2012 Shenzhen TP-LINK Technologies Co.,Ltd. +-- +-- FileName : tplink-sysMonitor.mib +-- Description : +-- Reference : +-- Version : 1.0 +-- History : +-- V1.0 11Dec12 Created by dengjianjun +-- Original version. +-- ============================================================================ + +TPLINK-SYSMONITOR-MIB DEFINITIONS ::= BEGIN + + IMPORTS + MODULE-IDENTITY + FROM SNMPv2-SMI + OBJECT-TYPE + FROM SNMPv2-SMI + NOTIFICATION-TYPE + FROM SNMPv2-SMI + tplinkMgmt + FROM TPLINK-MIB; + + tplinkSysMonitorMIB MODULE-IDENTITY + LAST-UPDATED + "201212110930Z" + ORGANIZATION + "TPLINK" + CONTACT-INFO + "www.tplink.com.cn" + DESCRIPTION + "Private MIB for System Monitor." + ::= { tplinkMgmt 4 } + + tplinkSysMonitorMIBObjects OBJECT IDENTIFIER ::= { tplinkSysMonitorMIB 1 } + tpSysMonitorCpu OBJECT IDENTIFIER ::= { tplinkSysMonitorMIBObjects 1 } + tpSysMonitorCpuTable OBJECT-TYPE + SYNTAX SEQUENCE OF TPSYSMONITORCPUENTRY + MAX-ACCESS + not-accessible + STATUS + current + DESCRIPTION + "Displays the CPU utilization of all UNITs." + ::= { tpSysMonitorCpu 1 } + + tpSysMonitorCpuEntry OBJECT-TYPE + SYNTAX TPSYSMONITORCPUENTRY + MAX-ACCESS + not-accessible + STATUS + current + DESCRIPTION + "An entry contains of the information of CPU utilization." + INDEX + { tpSysMonitorCpuUnitNumber } + ::= { tpSysMonitorCpuTable 1 } + + TPSYSMONITORCPUENTRY ::= + SEQUENCE + { + tpSysMonitorCpuUnitNumber + INTEGER, + tpSysMonitorCpu5Seconds + INTEGER, + tpSysMonitorCpu1Minute + INTEGER, + tpSysMonitorCpu5Minutes + INTEGER + } + + tpSysMonitorCpuUnitNumber OBJECT-TYPE + SYNTAX INTEGER + MAX-ACCESS + read-only + STATUS + current + DESCRIPTION + "Displays the UNIT number." + ::= { tpSysMonitorCpuEntry 1 } + + tpSysMonitorCpu5Seconds OBJECT-TYPE + SYNTAX INTEGER + (0..100) + MAX-ACCESS + read-only + STATUS + current + DESCRIPTION + "Displays the CPU utilization in 5 seconds." + ::= { tpSysMonitorCpuEntry 2 } + + tpSysMonitorCpu1Minute OBJECT-TYPE + SYNTAX INTEGER + (0..100) + MAX-ACCESS + read-only + STATUS + current + DESCRIPTION + "Displays the CPU utilization in 1 minute." + ::= { tpSysMonitorCpuEntry 3 } + + tpSysMonitorCpu5Minutes OBJECT-TYPE + SYNTAX INTEGER + (0..100) + MAX-ACCESS + read-only + STATUS + current + DESCRIPTION + "Displays the CPU utilization in 5 minutes." + ::= { tpSysMonitorCpuEntry 4 } + + + tpSysMonitorMemory OBJECT IDENTIFIER ::= { tplinkSysMonitorMIBObjects 2 } + tpSysMonitorMemoryTable OBJECT-TYPE + SYNTAX SEQUENCE OF TPSYSMONITORMEMORYENTRY + MAX-ACCESS + not-accessible + STATUS + current + DESCRIPTION + "Displays the memory utilization of all UNITs." + ::= { tpSysMonitorMemory 1 } + + tpSysMonitorMemoryEntry OBJECT-TYPE + SYNTAX TPSYSMONITORMEMORYENTRY + MAX-ACCESS + not-accessible + STATUS + current + DESCRIPTION + "An entry contains of the information of memory utilization." + INDEX + { tpSysMonitorMemoryUnitNumber } + ::= { tpSysMonitorMemoryTable 1 } + + TPSYSMONITORMEMORYENTRY ::= + SEQUENCE + { + tpSysMonitorMemoryUnitNumber + INTEGER, + tpSysMonitorMemoryUtilization + INTEGER + } + + tpSysMonitorMemoryUnitNumber OBJECT-TYPE + SYNTAX INTEGER + MAX-ACCESS + read-only + STATUS + current + DESCRIPTION + "Displays the UNIT number." + ::= { tpSysMonitorMemoryEntry 1 } + + tpSysMonitorMemoryUtilization OBJECT-TYPE + SYNTAX INTEGER + (0..100) + MAX-ACCESS + read-only + STATUS + current + DESCRIPTION + "Displays the memory utilization." + ::= { tpSysMonitorMemoryEntry 2 } + + + + tplinkSysMonitorNotifications OBJECT IDENTIFIER ::= { tplinkSysMonitorMIB 2 } + tpSysMonitorCpuOverLoading NOTIFICATION-TYPE + STATUS current + DESCRIPTION + "CPU utilization reached the threshold." + ::= { tplinkSysMonitorNotifications 1 } + + tpSysMonitorMemoryOverLoading NOTIFICATION-TYPE + STATUS current + DESCRIPTION + "Memory utilization reached the threshold." + ::= { tplinkSysMonitorNotifications 2 } + +END