feature: Update Juniper MSS Support (#6565)

* feature: Improve Juniper MSS Support

Add the following sensors
- Processor
- Mempool
- State

* Use snmp_get_multi

* updated mibs dir
This commit is contained in:
Søren Rosiak 2017-05-16 23:22:46 +02:00 committed by Neil Lathwood
parent 4c59e6cf0a
commit c40b762e23
7 changed files with 522 additions and 0 deletions

View File

@ -2,6 +2,8 @@ os: juniper-mss
text: 'Juniper MSS'
type: appliance
icon: junos
mib_dir:
- juniper
over:
- { graph: device_bits, text: 'Device Traffic' }
discovery:

View File

@ -0,0 +1,35 @@
<?php
/*
* LibreNMS
*
* Copyright (c) 2017 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 ($device['os'] == "juniper-mss") {
d_echo('Juniper MSS : ');
$memory_pool = snmp_get_multi_oid($device, 'trpzSysCpuMemoryInstantUsage.0 trpzSysCpuMemorySize.0', '-OQUs', 'TRAPEZE-NETWORKS-SYSTEM-MIB');
$used = $memory_pool['trpzSysCpuMemoryInstantUsage.0'];
$total = $memory_pool['trpzSysCpuMemorySize.0'];
$free = ($total - $used);
$percent = (($used / $total) * 100);
$descr = 'Memory';
if (is_numeric($used)) {
discover_mempool($valid_mempool, $device, '0', "juniper-mss", $descr, "1", null, null);
}
}
unset(
$memory_pool,
$used,
$total,
$free,
$percent,
$descr
);

View File

@ -0,0 +1,20 @@
<?php
/*
* LibreNMS
*
* Copyright (c) 2017 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 ($device['os'] === 'juniper-mss') {
d_echo('Juniper MSS : ');
$descr = 'Processor';
$proc_usage = snmp_get($device, 'trpzSysCpuInstantLoad.0', '-Ovq', 'TRAPEZE-NETWORKS-SYSTEM-MIB');
if (is_numeric($proc_usage)) {
discover_processor($valid['processor'], $device, '.1.3.6.1.4.1.14525.4.8.1.1.11.1.0', '0', 'juniper-mss', $descr, '1', $proc_usage);
}
}

View File

@ -0,0 +1,50 @@
<?php
/*
* LibreNMS
*
* Copyright (c) 2017 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.
*/
$temp = snmpwalk_cache_multi_oid($device, 'trpzSysPowerSupplyTable', array(), 'TRAPEZE-NETWORKS-SYSTEM-MIB');
$cur_oid = '.1.3.6.1.4.1.14525.4.8.1.1.13.1.2.1.2.';
if (is_array($temp)) {
//Create State Index
$state_name = 'trpzSysPowerSupplyStatus';
$state_index_id = create_state_index($state_name);
//Create State Translation
if ($state_index_id !== null) {
$states = array(
array($state_index_id, 'other', 0, 1, 1),
array($state_index_id, 'unknown', 0, 2, 3),
array($state_index_id, 'ac-failed', 0, 3, 2),
array($state_index_id, 'dc-failed', 0, 4, 2),
array($state_index_id, 'ac-ok-dc-ok', 0, 5, 0)
);
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');
}
}
foreach ($temp as $index => $entry) {
$descr = $temp[$index]['trpzSysPowerSupplyDescr'];
//Discover Sensors
discover_sensor($valid['sensor'], 'state', $device, $cur_oid . $index, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp[$index]['trpzSysPowerSupplyStatus'], 'snmp', $index);
//Create Sensor To State Index
create_sensor_to_state_index($device, $state_name, $index);
}
}

View File

@ -0,0 +1,19 @@
<?php
/*
* LibreNMS
*
* Copyright (c) 2017 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.
*/
d_echo('Juniper MSS : ');
$memory_pool = snmp_get_multi_oid($device, 'trpzSysCpuMemoryInstantUsage.0 trpzSysCpuMemorySize.0', '-OQUs', 'TRAPEZE-NETWORKS-SYSTEM-MIB');
$mempool['used'] = $memory_pool['trpzSysCpuMemoryInstantUsage.0'];
$mempool['total'] = $memory_pool['trpzSysCpuMemorySize.0'];
$mempool['free'] = ($mempool['total'] - $mempool['used']);

View File

@ -0,0 +1,65 @@
TRAPEZE-NETWORKS-ROOT-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY, enterprises
FROM SNMPv2-SMI;
trpzRootMib MODULE-IDENTITY
LAST-UPDATED "200805220008Z"
ORGANIZATION "Trapeze Networks"
CONTACT-INFO
"Trapeze Networks Technical Support
www.trapezenetworks.com
US: 866.TRPZ.TAC
International: 925.474.2400
support@trapezenetworks.com"
DESCRIPTION
"Trapeze Networks Root MIB
Copyright 2008 Trapeze Networks, Inc.
All rights reserved.
This Trapeze Networks SNMP Management Information Base
Specification (Specification) embodies Trapeze Networks'
confidential and proprietary intellectual property.
Trapeze Networks retains all title and ownership in
the Specification, including any revisions.
This Specification is supplied 'AS IS' and Trapeze Networks
makes no warranty, either express or implied, as to the use,
operation, condition, or performance of the Specification."
REVISION "200805220008Z"
DESCRIPTION "v3.1.1: Changed IMPORT of enterprises
from RFC1155-SMI to SNMPv2-SMI
(this will be published in 7.0 release)"
REVISION "200711280007Z"
DESCRIPTION "v3.0.0: Added subtree for
wireless Management Applications specific MIBs
(this will be published in 7.0 release)"
REVISION "200604140006Z"
DESCRIPTION "v2.0.5: Revised for 4.1 release"
REVISION "200501010000Z"
DESCRIPTION "v1: initial version, as for 4.0 and older releases"
::= { enterprises 14525 }
-- Top level Branches
trpzProducts OBJECT IDENTIFIER ::= { trpzRootMib 1 }
trpzTemporary OBJECT IDENTIFIER ::= { trpzRootMib 2 }
trpzRegistration OBJECT IDENTIFIER ::= { trpzRootMib 3 }
trpzMibs OBJECT IDENTIFIER ::= { trpzRootMib 4 }
trpzTraps OBJECT IDENTIFIER ::= { trpzRootMib 5 }
--
-- 'MgmtAppMibs' is a subtree for MIB modules
-- intended to be implemented by wireless Management Applications,
-- not by the wireless switch's SNMP agent:
--
trpzMgmtAppMibs OBJECT IDENTIFIER ::= { trpzRootMib 6 }
END

View File

@ -0,0 +1,331 @@
TRAPEZE-NETWORKS-SYSTEM-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE,
Unsigned32
FROM SNMPv2-SMI
DisplayString, TEXTUAL-CONVENTION
FROM SNMPv2-TC
trpzMibs
FROM TRAPEZE-NETWORKS-ROOT-MIB
;
trpzSystemMib MODULE-IDENTITY
LAST-UPDATED "200708140012Z"
ORGANIZATION "Trapeze Networks"
CONTACT-INFO
"Trapeze Networks Technical Support
www.trapezenetworks.com
US: 866.TRPZ.TAC
International: 925.474.2400
support@trapezenetworks.com"
DESCRIPTION
"System objects for Trapeze Networks wireless switches.
Copyright 2007 Trapeze Networks, Inc.
All rights reserved.
This Trapeze Networks SNMP Management Information Base
Specification (Specification) embodies Trapeze Networks'
confidential and proprietary intellectual property.
Trapeze Networks retains all title and ownership in
the Specification, including any revisions.
This Specification is supplied 'AS IS' and Trapeze Networks
makes no warranty, either express or implied, as to the use,
operation, condition, or performance of the Specification."
REVISION "200708140012Z"
DESCRIPTION "v3.0.1: Added new objects to support
Power Supply status.
(for 6.2 release)"
REVISION "200705040010Z"
DESCRIPTION "v2.1.0: Obsoleted two previously deprecated objects
(for 6.2 release)"
REVISION "200703140007Z"
DESCRIPTION "v2.0.0: Added new objects to support CPU load
and memory (RAM) usage details:
for last few seconds (''instant''),
minute, 5 minutes, hour, day, 3 days
(for 6.0 release)"
REVISION "200611090004Z"
DESCRIPTION "v1.0.3: Removed unused imports"
REVISION "200606060003Z"
DESCRIPTION "v1.0.2: Initial version, for 5.0 release"
::= { trpzMibs 8 }
-- Textual Conventions
TrpzSysCpuLoad ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION
"CPU load in percents"
SYNTAX Unsigned32 (0..100)
TrpzSysMemoryAmount ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION
"Memory amount in KBytes (1024 octets)"
SYNTAX Unsigned32
TrpzSysPowerSupplyStatus ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION
"The status of a Power Supply."
SYNTAX INTEGER {
other (1),
unknown (2),
ac-failed (3),
dc-failed (4),
ac-ok-dc-ok (5)
}
-- Object definitions
--
-- The System MIB Tree
--
trpzSysObjects OBJECT IDENTIFIER ::= { trpzSystemMib 1 }
trpzSysDataObjects OBJECT IDENTIFIER ::= { trpzSysObjects 1 }
trpzSysCpuMemoryUsedBytes OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS read-only
STATUS obsolete
DESCRIPTION
"CPU memory used in bytes.
Obsoleted by trpzSysCpuMemoryInstantUsage."
::= { trpzSysDataObjects 1 }
trpzSysCpuMemoryTotalBytes OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS read-only
STATUS obsolete
DESCRIPTION
"CPU total physical memory in bytes.
Obsoleted by trpzSysCpuMemorySize."
::= { trpzSysDataObjects 2 }
trpzSysFlashMemoryUsedBytes OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Flash memory used in bytes."
::= { trpzSysDataObjects 3 }
trpzSysFlashMemoryTotalBytes OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Flash memory available in bytes."
::= { trpzSysDataObjects 4 }
trpzSysCpuAverageLoad OBJECT-TYPE
SYNTAX TrpzSysCpuLoad
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"CPU load average since system startup."
::= { trpzSysDataObjects 5 }
-- Totals
trpzSysCpuMemorySize OBJECT-TYPE
SYNTAX TrpzSysMemoryAmount
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Maximum available CPU Memory (RAM) in KBytes.
This is the memory available to the Wireless Switch software.
May be less than physical RAM size."
::= { trpzSysDataObjects 6 }
-- Reserving trpzSysDataObjects 7-10 for future scalars indicating totals
trpzSysCpuLoadDetail OBJECT IDENTIFIER ::= { trpzSysDataObjects 11 }
trpzSysCpuMemoryUsageDetail OBJECT IDENTIFIER ::= { trpzSysDataObjects 12 }
trpzSysChassisComponents OBJECT IDENTIFIER ::= { trpzSysDataObjects 13 }
-- CPU load details:
trpzSysCpuInstantLoad OBJECT-TYPE
SYNTAX TrpzSysCpuLoad
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"CPU instant load (for last few seconds)."
::= { trpzSysCpuLoadDetail 1 }
trpzSysCpuLastMinuteLoad OBJECT-TYPE
SYNTAX TrpzSysCpuLoad
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"CPU load for last minute."
::= { trpzSysCpuLoadDetail 2 }
trpzSysCpuLast5MinutesLoad OBJECT-TYPE
SYNTAX TrpzSysCpuLoad
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"CPU load for last 5 minutes."
::= { trpzSysCpuLoadDetail 3 }
trpzSysCpuLastHourLoad OBJECT-TYPE
SYNTAX TrpzSysCpuLoad
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"CPU load for last hour."
::= { trpzSysCpuLoadDetail 4 }
trpzSysCpuLastDayLoad OBJECT-TYPE
SYNTAX TrpzSysCpuLoad
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"CPU load for last day."
::= { trpzSysCpuLoadDetail 5 }
trpzSysCpuLast3DaysLoad OBJECT-TYPE
SYNTAX TrpzSysCpuLoad
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"CPU load for last 3 days."
::= { trpzSysCpuLoadDetail 6 }
-- Memory usage details
trpzSysCpuMemoryInstantUsage OBJECT-TYPE
SYNTAX TrpzSysMemoryAmount
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Instant memory usage (RAM) in KBytes (for last few seconds).
Ranges between 0 and trpzSysCpuMemorySize."
::= { trpzSysCpuMemoryUsageDetail 1 }
trpzSysCpuMemoryLastMinuteUsage OBJECT-TYPE
SYNTAX TrpzSysMemoryAmount
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Memory usage (RAM) for last minute in KBytes.
Ranges between 0 and trpzSysCpuMemorySize."
::= { trpzSysCpuMemoryUsageDetail 2 }
trpzSysCpuMemoryLast5MinutesUsage OBJECT-TYPE
SYNTAX TrpzSysMemoryAmount
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Memory usage (RAM) for last 5 minutes in KBytes.
Ranges between 0 and trpzSysCpuMemorySize."
::= { trpzSysCpuMemoryUsageDetail 3 }
trpzSysCpuMemoryLastHourUsage OBJECT-TYPE
SYNTAX TrpzSysMemoryAmount
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Memory usage (RAM) for last hour in KBytes.
Ranges between 0 and trpzSysCpuMemorySize."
::= { trpzSysCpuMemoryUsageDetail 4 }
trpzSysCpuMemoryLastDayUsage OBJECT-TYPE
SYNTAX TrpzSysMemoryAmount
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Memory usage (RAM) for last day in KBytes.
Ranges between 0 and trpzSysCpuMemorySize."
::= { trpzSysCpuMemoryUsageDetail 5 }
trpzSysCpuMemoryLast3DaysUsage OBJECT-TYPE
SYNTAX TrpzSysMemoryAmount
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Memory usage (RAM) for last 3 days in KBytes.
Ranges between 0 and trpzSysCpuMemorySize."
::= { trpzSysCpuMemoryUsageDetail 6 }
-- Power Supplies Group
trpzSysChasCompPowerSupplies OBJECT IDENTIFIER ::= { trpzSysChassisComponents 1 }
trpzSysNumPowerSuppliesSupported OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The number of power supplies supported by the Wireless Switch.
This is the upper limit of the number of entries
in the power supply table, trpzSysPowerSupplyTable."
::= { trpzSysChasCompPowerSupplies 1 }
trpzSysPowerSupplyTable OBJECT-TYPE
SYNTAX SEQUENCE OF TrpzSysPowerSupplyEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"Table of power supplies actually installed on the Wireless Switch."
::= { trpzSysChasCompPowerSupplies 2 }
trpzSysPowerSupplyEntry OBJECT-TYPE
SYNTAX TrpzSysPowerSupplyEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"An entry in the trpzSysPowerSupplyTable table."
INDEX { trpzSysPowerSupplyDeviceOID }
::= { trpzSysPowerSupplyTable 1 }
TrpzSysPowerSupplyEntry ::= SEQUENCE {
trpzSysPowerSupplyDeviceOID OBJECT IDENTIFIER,
trpzSysPowerSupplyStatus TrpzSysPowerSupplyStatus,
trpzSysPowerSupplyDescr DisplayString
}
trpzSysPowerSupplyDeviceOID OBJECT-TYPE
SYNTAX OBJECT IDENTIFIER
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"OID value used to identify this chassis component
as indicated in Registration MIB."
::= { trpzSysPowerSupplyEntry 1 }
trpzSysPowerSupplyStatus OBJECT-TYPE
SYNTAX TrpzSysPowerSupplyStatus
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Status of the power supply."
::= { trpzSysPowerSupplyEntry 2 }
trpzSysPowerSupplyDescr OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..255))
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"A human interpretable description of this power supply,
for example 'Left Power Supply'."
::= { trpzSysPowerSupplyEntry 3 }
END