From bc310cffec133505da1bbfaa2b1b5f6816b1f831 Mon Sep 17 00:00:00 2001 From: cjsoftuk Date: Tue, 2 May 2023 13:12:09 +0100 Subject: [PATCH] WIP: Add support for memory monitoring on Firebrick platform (#15021) * Add support for Firebrick memory monitoring. * Add mempool testing for Firebrick. --- includes/definitions/discovery/firebrick.yaml | 6 ++ mibs/firebrick/FIREBRICK-GLOBAL-MIB | 61 +++++++++++++++++++ tests/data/firebrick_2900.json | 50 +++++++++++++++ tests/data/firebrick_6000.json | 50 +++++++++++++++ tests/snmpsim/firebrick_2900.snmprec | 6 +- tests/snmpsim/firebrick_6000.snmprec | 2 + 6 files changed, 173 insertions(+), 2 deletions(-) create mode 100644 mibs/firebrick/FIREBRICK-GLOBAL-MIB diff --git a/includes/definitions/discovery/firebrick.yaml b/includes/definitions/discovery/firebrick.yaml index 4749fc187a..6ba5091cfe 100644 --- a/includes/definitions/discovery/firebrick.yaml +++ b/includes/definitions/discovery/firebrick.yaml @@ -1,5 +1,11 @@ mib: FIREBRICK-CPU-MIB:FIREBRICK-MONITORING:FIREBRICK-L2TP-MIB:FIREBRICK-VOIP-MIB modules: + mempools: + data: + - + free: FIREBRICK-GLOBAL::fbFreeMem + total: FIREBRICK-GLOBAL::fbTotalMem + index: 0 os: sysDescr_regex: '/^(?FB[0-9]{4}).*\((?[^ ]+)/m' sensors: diff --git a/mibs/firebrick/FIREBRICK-GLOBAL-MIB b/mibs/firebrick/FIREBRICK-GLOBAL-MIB new file mode 100644 index 0000000000..452c803108 --- /dev/null +++ b/mibs/firebrick/FIREBRICK-GLOBAL-MIB @@ -0,0 +1,61 @@ +-- *------------------------------------------------ +-- * Firebrick System Global Info MIB +-- * +-- * Feb 2023, David Honour +-- * +-- * Copyright (c) 2023 by Andrews & Arnold +-- *------------------------------------------------ + +FIREBRICK-GLOBAL DEFINITIONS ::= BEGIN + +IMPORTS + MODULE-IDENTITY, + OBJECT-TYPE, + NOTIFICATION-TYPE, + Gauge32, + MODULE-COMPLIANCE, + OBJECT-GROUP, + NOTIFICATION-GROUP + FROM SNMPv2-CONF + TEXTUAL-CONVENTION, + enterprises + FROM RFC1155-SMI + DisplayString + FROM SNMPv2-TC + firebrickNewStyle + FROM FIREBRICK-MIB + ; + +fbGlobalMib MODULE-IDENTITY + LAST-UPDATED "202302170000Z" + ORGANIZATION "Andrews & Arnold Limited" + CONTACT-INFO + "Andrews & Arnold + Unit 1&2, Enterprise Court + Bracknell, Berkshire, RG12 1QS + United Kingdom + + Tel: +44 3333 400 999 + Email: support@aa.net.uk" + DESCRIPTION "System wide status" + REVISION "202302170000Z" + DESCRIPTION "Add memory usage" + ::= { firebrickNewStyle 4 } + +fbGlobalMemory OBJECT IDENTIFIER ::= { fbGlobalMib 1 } + +fbTotalMem OBJECT-TYPE + SYNTAX Gauge32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Total RAM (KiB)" + ::= { fbGlobalMemory 1 } + +fbFreeMem OBJECT-TYPE + SYNTAX Gauge32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION "Free RAM (KiB)" + ::= { fbGlobalMemory 2 } + +END diff --git a/tests/data/firebrick_2900.json b/tests/data/firebrick_2900.json index 7072112c32..779f3ccb68 100644 --- a/tests/data/firebrick_2900.json +++ b/tests/data/firebrick_2900.json @@ -2186,5 +2186,55 @@ ] }, "poller": "matches discovery" + }, + "mempools": { + "discovery": { + "mempools": [ + { + "mempool_index": "0", + "entPhysicalIndex": null, + "mempool_type": "firebrick", + "mempool_class": "system", + "mempool_precision": 1, + "mempool_descr": "Memory", + "mempool_perc": 18, + "mempool_perc_oid": null, + "mempool_used": 95232, + "mempool_used_oid": null, + "mempool_free": 429056, + "mempool_free_oid": ".1.3.6.1.4.1.24693.100.4.1.2.", + "mempool_total": 524288, + "mempool_total_oid": null, + "mempool_largestfree": null, + "mempool_lowestfree": null, + "mempool_deleted": 0, + "mempool_perc_warn": 90 + } + ] + }, + "poller": { + "mempools": [ + { + "mempool_index": "0", + "entPhysicalIndex": null, + "mempool_type": "firebrick", + "mempool_class": "system", + "mempool_precision": 1, + "mempool_descr": "Memory", + "mempool_perc": 0, + "mempool_perc_oid": null, + "mempool_used": 0, + "mempool_used_oid": null, + "mempool_free": 524288, + "mempool_free_oid": ".1.3.6.1.4.1.24693.100.4.1.2.", + "mempool_total": 524288, + "mempool_total_oid": null, + "mempool_largestfree": null, + "mempool_lowestfree": null, + "mempool_deleted": 0, + "mempool_perc_warn": 90 + } + ] + } } } diff --git a/tests/data/firebrick_6000.json b/tests/data/firebrick_6000.json index 8004bbf124..172e987ffb 100644 --- a/tests/data/firebrick_6000.json +++ b/tests/data/firebrick_6000.json @@ -1968,5 +1968,55 @@ } ] } + }, + "mempools": { + "discovery": { + "mempools": [ + { + "mempool_index": "0", + "entPhysicalIndex": null, + "mempool_type": "firebrick", + "mempool_class": "system", + "mempool_precision": 1, + "mempool_descr": "Memory", + "mempool_perc": 15, + "mempool_perc_oid": null, + "mempool_used": 316416, + "mempool_used_oid": null, + "mempool_free": 1780736, + "mempool_free_oid": ".1.3.6.1.4.1.24693.100.4.1.2.", + "mempool_total": 2097152, + "mempool_total_oid": null, + "mempool_largestfree": null, + "mempool_lowestfree": null, + "mempool_deleted": 0, + "mempool_perc_warn": 90 + } + ] + }, + "poller": { + "mempools": [ + { + "mempool_index": "0", + "entPhysicalIndex": null, + "mempool_type": "firebrick", + "mempool_class": "system", + "mempool_precision": 1, + "mempool_descr": "Memory", + "mempool_perc": 0, + "mempool_perc_oid": null, + "mempool_used": 0, + "mempool_used_oid": null, + "mempool_free": 2097152, + "mempool_free_oid": ".1.3.6.1.4.1.24693.100.4.1.2.", + "mempool_total": 2097152, + "mempool_total_oid": null, + "mempool_largestfree": null, + "mempool_lowestfree": null, + "mempool_deleted": 0, + "mempool_perc_warn": 90 + } + ] + } } } diff --git a/tests/snmpsim/firebrick_2900.snmprec b/tests/snmpsim/firebrick_2900.snmprec index 65a055b8fe..380ea51964 100644 --- a/tests/snmpsim/firebrick_2900.snmprec +++ b/tests/snmpsim/firebrick_2900.snmprec @@ -298,11 +298,13 @@ 1.3.6.1.4.1.24693.100.1.1.1.4.6|2|11933 1.3.6.1.4.1.24693.100.1.1.1.4.7|2|10515 1.3.6.1.4.1.24693.100.1.1.1.4.8|2|35500 +1.3.6.1.4.1.24693.100.4.1.1|66|524288 +1.3.6.1.4.1.24693.100.4.1.2|66|429056 1.3.6.1.4.1.24693.100.5060.1.0|2|3 1.3.6.1.4.1.24693.100.5060.2.0|2|4 1.3.6.1.4.1.24693.100.5060.3.1.1.0|4|Verizon -1.3.6.1.4.1.24693.100.5060.3.1.2.0|2|7 -1.3.6.1.4.1.24693.100.5060.3.1.3.0|2|8 1.3.6.1.4.1.24693.100.5060.3.1.1.1|4|T-Mobile +1.3.6.1.4.1.24693.100.5060.3.1.2.0|2|7 1.3.6.1.4.1.24693.100.5060.3.1.2.1|2|9 +1.3.6.1.4.1.24693.100.5060.3.1.3.0|2|8 1.3.6.1.4.1.24693.100.5060.3.1.3.1|2|10 diff --git a/tests/snmpsim/firebrick_6000.snmprec b/tests/snmpsim/firebrick_6000.snmprec index 05e46a2328..32a6fc4294 100644 --- a/tests/snmpsim/firebrick_6000.snmprec +++ b/tests/snmpsim/firebrick_6000.snmprec @@ -190,6 +190,8 @@ 1.3.6.1.4.1.24693.100.1.1.1.4.10|2|0 1.3.6.1.4.1.24693.100.1.1.1.4.11|2|0 1.3.6.1.4.1.24693.100.1.1.1.4.12|2|36750 +1.3.6.1.4.1.24693.100.4.1.1|66|2097152 +1.3.6.1.4.1.24693.100.4.1.2|66|1780736 1.3.6.1.4.1.24693.100.179.1.1.1.1.4.10.2.3.4|2|1 1.3.6.1.4.1.24693.100.179.1.1.1.1.4.10.2.3.5|2|1 1.3.6.1.4.1.24693.100.179.1.1.1.2.16.253.1.8.176.0.0.0.251.0.0.0.0.0.0.0.1|2|2