Skip to content

Commit

Permalink
Refactor HOST-RESOURCES-MIB (#1027)
Browse files Browse the repository at this point in the history
* Refactor HOST-RESOURCES-MIB

Now that we support multiple walks per scrape, migrate
HOST-RESOURCES-MIB walks to separate modules.

Signed-off-by: SuperQ <[email protected]>

* Migrate hrSystem to separate module.

Signed-off-by: SuperQ <[email protected]>

* Migrate hrDevice to separate module.

Signed-off-by: SuperQ <[email protected]>

* Migrate remaining host walks to separate modules.

Signed-off-by: SuperQ <[email protected]>

---------

Signed-off-by: SuperQ <[email protected]>
  • Loading branch information
SuperQ authored Nov 14, 2023
1 parent 96c440c commit aec1630
Show file tree
Hide file tree
Showing 2 changed files with 9,033 additions and 9,604 deletions.
49 changes: 30 additions & 19 deletions generator/generator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ modules:
#
paloalto_fw:
walk:
- hrDevice
- hrSystem
- hrStorage
- 1.3.6.1.4.1.25461.2.1.2.1 # panSys
- 1.3.6.1.4.1.25461.2.1.2.3 # panSession
- 1.3.6.1.4.1.25461.2.1.2.5 # panGlobalProtect
Expand All @@ -188,8 +185,6 @@ modules:
#
arista_sw:
walk:
- 1.3.6.1.2.1.25.3.3.1.2 # hrProcessorLoad
- 1.3.6.1.2.1.25.2.3.1.6 # hrStorageUsed
- 1.3.6.1.4.1.30065.3.1.1 # aristaSwFwdIp

# Synology
Expand All @@ -208,7 +203,6 @@ modules:
- ssCpuSystem
- ssCpuIdle
- memory
- hrStorage
- 1.3.6.1.4.1.6574.1 # synoSystem
- 1.3.6.1.4.1.6574.2 # synoDisk
- 1.3.6.1.4.1.6574.3 # synoRaid
Expand Down Expand Up @@ -237,9 +231,6 @@ modules:
- source_indexes: [laIndex]
lookup: laNames
drop_source_indexes: true
- source_indexes: [hrStorageIndex]
lookup: hrStorageDescr
drop_source_indexes: true
overrides:
diskModel:
type: DisplayString
Expand Down Expand Up @@ -274,7 +265,6 @@ modules:
#
ddwrt:
walk:
- 1.3.6.1.2.1.25.2 # hrStorage
- 1.3.6.1.4.1.2021.4 # memory
- 1.3.6.1.4.1.2021.10.1.1 # laIndex
- 1.3.6.1.4.1.2021.10.1.2 # laNames
Expand All @@ -284,9 +274,6 @@ modules:
- source_indexes: [laIndex]
lookup: laNames
drop_source_indexes: true
- source_indexes: [hrStorageIndex]
lookup: hrStorageDescr
drop_source_indexes: true

# Ubiquiti / AirFiber
#
Expand Down Expand Up @@ -422,7 +409,6 @@ modules:
# https://www.iana.org/assignments/ianaprinter-mib/ianaprinter-mib.xhtml
printer_mib:
walk:
- hrPrinterStatus
- prtGeneralReset
- prtConsoleDisable
- prtGeneralPrinterName
Expand All @@ -438,8 +424,6 @@ modules:
- source_indexes: [hrDeviceIndex, prtMarkerSuppliesIndex]
lookup: prtMarkerSuppliesType
overrides:
hrPrinterStatus:
type: EnumAsStateSet
prtGeneralReset:
type: EnumAsStateSet
prtConsoleDisable:
Expand Down Expand Up @@ -563,15 +547,12 @@ modules:
walk:
- laIndex
- sysDescr
- host
- mikrotik
lookups:
- source_indexes: [ifIndex]
lookup: ifName
- source_indexes: [mtxrInterfaceStatsIndex]
lookup: ifName
- source_indexes: [hrStorageIndex]
lookup: hrStorageDescr
- source_indexes: [laIndex]
lookup: laNames
drop_source_indexes: true
Expand Down Expand Up @@ -616,3 +597,33 @@ modules:
eap:
walk:
- 1.3.6.1.4.1.11863.10.1.1.1 # client count

#
# HOST-RESOURCES-MIB
#
# http://www.net-snmp.org/docs/mibs/host.html
hrSystem:
walk:
- hrSystem
hrStorage:
walk:
- hrStorage
lookups:
- source_indexes: [hrStorageIndex]
lookup: hrStorageDescr
drop_source_indexes: true
hrDevice:
walk:
- hrDevice
overrides:
hrPrinterStatus:
type: EnumAsStateSet
hrSWRun:
walk:
- hrSWRun
hrSWRunPerf:
walk:
- hrSWRunPerf
hrSWInstalled:
walk:
- hrSWInstalled
Loading

0 comments on commit aec1630

Please sign in to comment.