hardware.WBEMGenHBA.WBEMGenHBA.yaml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of metricshub-community-connectors
Show all versions of metricshub-community-connectors
MetricsHub Community Connector Repository
The newest version!
---
extends:
- ../Hardware/Hardware
connector:
displayName: WMI - HBA
platforms: Any system
reliesOn: WMI
version: 0.9
information: This connector enables the monitoring of HBA cards on all Windows-based systems through the WMI layer (root/WMI namespace).
detection:
connectionTypes:
- remote
- local
appliesTo:
- NT
supersedes:
- CpqHBA
- SMISHBA
criteria:
# OS must be Windows NT-derivative
- type: deviceType
keep:
- NT
# WMI must be available
- type: service
name: WINMGMT
# The root\wmi namespace must have the MSFC_FCAdapterHBAAttributes
- type: wmi
query: SELECT InstanceName FROM MSFC_FCAdapterHBAAttributes
namespace: root\wmi
tags: [ hardware, windows ]
monitors:
network:
discovery:
sources:
source(1):
# Source(1) = MSFC_FibrePortHBAAttributes class (FC Ports)
# Active;AdapterID;UniquePortId;PortSpeed;PortWWN-Decimal;PortWWN-Decimal;PortType;
type: wmi
namespace: root\wmi
query: SELECT Active,InstanceName,Attributes.PortWWN,Attributes.PortSpeed,Attributes.PortWWN,Attributes.PortWWN,Attributes.PortType FROM MSFC_FibrePortHBAAttributes
computes:
# Keep Only Active Ports
# Active;AdapterID;UniquePortId;PortSpeed;PortWWN-Decimal;PortWWN-Decimal;PortType;
- type: keepOnlyMatchingLines
column: 1
valueList: "True"
# Translate PortType into a more readable string
# Active;AdapterID;UniquePortId;PortSpeed;PortWWN-Decimal;PortWWN-Decimal;PortType;
- type: translate
column: 7
translationTable: ${translation::PortTypeTranslationTable}
# and Remove the array pipes from the port WWN
# Active;AdapterID;UniquePortId;PortSpeed;PortWWN-Decimal;PortWWN-Decimal;PortType;
- type: replace
column: 5
existingValue: '|'
newValue: .
# Convert Speed from Gbps to Mbps (multiply by 1000)
# Active;AdapterID;UniquePortId;PortSpeed;PortWWN-Decimal;PortWWN-Decimal;PortType;
- type: multiply
column: 4
value: 1000
# Convert PortWWN to Hex
# NOTE - This script is column specific (See Column Variable), so watchout if you change the queries or duplicate columns.
# Active;AdapterID;UniquePortId;PortSpeed;PortWWN-Decimal;PortWWN-Hex;PortType;
- type: awk
script: ${file::network.awk}
keep: ^MSHW;
separators: ;
selectColumns: "2,3,4,5,6,7,8"
source(2):
# Source(2) = MSFC_FCAdapterHBAAttributes class (FC Adapters)
# AdapterID;Manufacturer;Model;Serial
type: wmi
namespace: root\wmi
query: SELECT InstanceName,Manufacturer,ModelDescription,SerialNumber FROM MSFC_FCAdapterHBAAttributes
computes:
# Keep only the first word of the Manufacturer name (to avoid stuff like "Corporations, Inc. and blah blah blah)
# AdapterID;Manufacturer;Model;Serial
- type: extract
column: 2
subColumn: 1
subSeparators: ' '
source(3):
# Source(3) = Table joint of Source(1) and Source(2)
# Active;AdapterID;UniquePortId;PortSpeed;PortWWN-Decimal;PortWWN-Hex;PortType;AdapterID;Manufacturer;Model;Serial
type: tableJoin
leftTable: ${source::monitors.network.discovery.sources.source(1)}
rightTable: ${source::monitors.network.discovery.sources.source(2)}
leftKeyColumn: 2
rightKeyColumn: 1
source(4):
# Source (4) = MSFC_FibrePortHBAStatistics
# InstanceName;TxFrames;RxFrames;ErrorCount
type: wmi
namespace: root\wmi
query: SELECT InstanceName,statistics.TxFrames,statistics.RxFrames,statistics.ErrorFrames FROM MSFC_FibrePortHBAStatistics
computes:
# Remove all values of -1 from Tx,Rx and ErrorCount to deactivate these parameters when they are not collected
# InstanceName;TxFrames;RxFrames;ErrorCount
- type: replace
column: 2
existingValue: -1
newValue: ""
- type: replace
column: 3
existingValue: -1
newValue: ""
- type: replace
column: 4
existingValue: -1
newValue: ""
source(5):
# Source(5) = Table joint of Source(3) and Source(4)
# Active;AdapterID;UniquePortId;PortSpeed;PortWWN-Decimal;PortWWN-Hex;PortType;AdapterID;Manufacturer;Model;Serial;InstanceName;TxFrames;RxFrames;ErrorCount;
type: tableJoin
leftTable: ${source::monitors.network.discovery.sources.source(3)}
rightTable: ${source::monitors.network.discovery.sources.source(4)}
leftKeyColumn: 2
rightKeyColumn: 1
mapping:
# Changed from UniquePortID to PortWWN as device ID as it seems this UniqueID is not fixed.
# InstanceTable = Source(3)
# Active;AdapterID;UniquePortId;PortSpeed;PortWWN-Decimal;PortWWN-Hex;PortType;AdapterID;Manufacturer;Model;Serial;InstanceName;TxFrames;RxFrames;ErrorCount;
source: ${source::monitors.network.discovery.sources.source(5)}
attributes:
id: $5
vendor: $9
model: $10
bandwidth: $4
physical_address: $6
physical_address_type: WWN
device_type: $7
hw.parent.type: enclosure
name: ${awk::sprintf("%s (%s - %s - %s)", $5, $7, $9, $10)}
conditionalCollection:
hw.errors{hw.type="network"}: $15
hw.network.packets{direction="transmit"}: $13
hw.network.packets{direction="receive"}: $14
collect:
# Collect type is multi-instance
type: multiInstance
keys:
- id
sources:
source(1):
# Source (1) = MSFC_FibrePortHBAAttributes
# AdapterID;PortState;PortSpeed;PortWWN-Decimal;
type: wmi
namespace: root\wmi
query: SELECT InstanceName,Attributes.PortState,Attributes.PortSpeed,Attributes.PortWWN FROM MSFC_FibrePortHBAAttributes
computes:
# Duplicate Port State Twice
# AdapterID;PortState;PortSpeed;PortWWN-Decimal;
- type: duplicateColumn
column: 2
- type: duplicateColumn
column: 2
# Translate PortState to Patrol Status
# AdapterID;Status;PortState;PortState;PortSpeed;PortWWN-Decimal;
- type: translate
column: 2
translationTable: ${translation::PortStateToStatusTranslationTable}
# Translate PortState to Patrol Status
# AdapterID;Status;StatusInformation;PortState;PortSpeed;PortWWN-Decimal;
- type: translate
column: 3
translationTable: ${translation::PortStateToStatusInformationTranslationTable}
# Translate PortState to Link Status
# AdapterID;Status;StatusInformation;LinkStatus;PortSpeed;PortWWN-Decimal;
- type: translate
column: 4
translationTable: ${translation::PortStateToLinkStatusTranslationTable}
# Convert Speed from Gbps to Mbps (multiply by 1000)
# AdapterID;Status;StatusInformation;LinkStatus;PortSpeed;PortWWN-Decimal;
- type: multiply
column: 5
value: 1000
# Add a FC_ to the Port ID to prevent it from being identified as a Integer
# Remove the array pipes from the port WWN
# AdapterID;Status;StatusInformation;LinkStatus;PortSpeed;PortWWN-Decimal;
- type: replace
column: 6
existingValue: '|'
newValue: .
source(2):
# Source (2) = MSFC_FibrePortHBAStatistics
# InstanceName;TxFrames;RxFrames;ErrorCount
type: wmi
namespace: root\wmi
query: SELECT InstanceName,statistics.TxFrames,statistics.RxFrames,statistics.ErrorFrames FROM MSFC_FibrePortHBAStatistics
source(3):
# Source (3) = Table Joint of 1 & 2
# AdapterID;Status;StatusInformation;LinkStatus;PortSpeed;PortWWN-Decimal;InstanceName;TxFrames;RxFrames;ErrorCount;
type: tableJoin
leftTable: ${source::monitors.network.collect.sources.source(1)}
rightTable: ${source::monitors.network.collect.sources.source(2)}
leftKeyColumn: 1
rightKeyColumn: 1
mapping:
# INSTANCE TABLE
# AdapterID;Status;StatusInformation;LinkStatus;PortSpeed;PortWWN-Decimal;InstanceName;TxFrames;RxFrames;ErrorCount;
source: ${source::monitors.network.collect.sources.source(3)}
attributes:
id: $6
metrics:
hw.status{hw.type="network"}: $2
hw.network.up: legacyLinkStatus($4)
hw.network.bandwidth.limit: megaBit2Bit($5)
hw.errors{hw.type="network"}: $10
hw.network.packets{direction="transmit"}: $8
hw.network.packets{direction="receive"}: $9
legacyTextParameters:
StatusInformation: $3
translations:
PortStateToLinkStatusTranslationTable:
"2": ok
"6": degraded
Default: UNKNOWN
PortStateToStatusInformationTranslationTable:
"1": Unknown
"2": ""
"3": User Offline
"4": Bypassed
"5": In diagnostics mode
"6": Link Down
"7": Port Error
"8": Loopback
Default: UNKNOWN
PortTypeTranslationTable:
"5": HBA FC Port N
"6": HBA FC Port NL
"7": HBA FC Port F/NL
"8": HBA FC Port F
"9": HBA FC Port E
Default: HBA FC Port
"10": HBA FC Port G
PortStateToStatusTranslationTable:
"1": UNKNOWN
"2": ok
"3": degraded
"4": ok
"5": degraded
"6": ok
"7": failed
"8": degraded
Default: UNKNOWN