Add support for Alpha CXC HP Controller (#14829)

* add support for Alpha CXC HP Controller

* add num_oids, fix formatting

* fix typo

* Rename cxc_cxc.snmprec to cxc.snmprec

* Create ALPHA-RESOURCE-MIB

* Create ALPHA-RECTIFIER-SYS-MIB

* Create cxc.json

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
Schylar Utley 2023-04-14 18:04:42 -05:00 committed by GitHub
parent 5d7b0e8dc8
commit 056305c3c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 1794 additions and 0 deletions

View File

@ -0,0 +1,13 @@
os: cxc
text: 'Alpha CXC HP Controller'
type: power
icon: alpha
over:
- { graph: device_current, text: Current }
- { graph: device_voltage, text: Voltage }
- { graph: device_state, text: State }
mib_dir: alpha
discovery:
-
sysObjectID:
- .1.3.6.1.4.1.7309.5

View File

@ -0,0 +1,56 @@
mib: ALPHA-RECTIFIER-SYS-MIB:ALPHA-RESOURCE-MIB
modules:
os:
serial: ALPHA-RESOURCE-MIB:componentListSerialNumber.1.1
version: ALPHA-RESOURCE-MIB:controllerInfoSoftwareVersion.0
sensors:
voltage:
data:
-
oid: rectifierSystem
num_oid: '.1.3.6.1.4.1.7309.5.3.1.10.{{ $index }}'
value: rectSysSystemVoltage
divisor: 1000
descr: 'System Voltage'
index: rectSysSystemVoltage.{{ $index }}
-
oid: rectifierSystem
num_oid: '.1.3.6.1.4.1.7309.5.3.1.12.{{ $index }}'
value: rectSysBatteryVoltage
divisor: 1000
descr: 'Battery Voltage'
index: rectSysBatteryVoltage.{{ $index }}
-
oid: rectifierSystem
value: rectSysAverageRectifierACInputVoltage
num_oid: '.1.3.6.1.4.1.7309.5.3.1.6.{{ $index }}'
divisor: 1000
descr: 'AC Input Voltage'
index: rectSysAverageRectifierACInputVoltage.{{ $index }}
current:
data:
-
oid: rectifierSystem
num_oid: '.1.3.6.1.4.1.7309.5.3.1.1.{{ $index }}'
value: rectSysTotalOutputCurrent
divisor: 1000
descr: 'Total Output Current'
-
oid: rectifierSystem
num_oid: '.1.3.6.1.4.1.7309.5.3.1.13.{{ $index }}'
value: rectSysBatteryCurrent
index: rectSysBatteryCurrent.{{ $index }}
descr: 'Total Battery Current'
divisor: 1000
skip_value_lt: 0
temperature:
data:
-
oid: rectifierSystem
num_oid: '.1.3.6.1.4.1.7309.5.3.1.14.{{ $index }}'
value: rectSysBatteryTemperature
index: rectSysBatteryTemperature.{{ $index }}
divisor: 1000
descr: 'Battery Temperature'

View File

@ -0,0 +1,371 @@
ALPHA-RECTIFIER-SYS-MIB DEFINITIONS ::= BEGIN
--==========================================================================
--
-- Alpha Technologies Ltd.
-- Copyright 2014
--
--==========================================================================
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE
FROM SNMPv2-SMI
ScaledNumber, simple
FROM ALPHA-RESOURCE-MIB
MODULE-COMPLIANCE, OBJECT-GROUP
FROM SNMPv2-CONF;
rectifierSystem MODULE-IDENTITY
LAST-UPDATED "201704060000Z"
ORGANIZATION "Alpha Technologies Ltd."
CONTACT-INFO
"Alpha Technologies Ltd.
7700 Riverfront Gate
Burnaby, BC V5J 5M4
Canada
Tel: 1-604-436-5900
Fax: 1-604-436-1233"
DESCRIPTION
"This MIB defines the notification block(s) available in system controllers."
REVISION "201704060000Z" -- April 4, 2017
DESCRIPTION
"
Added fields for power save and some battery fields.
Tested with SimpleWeb: http://www.simpleweb.org
Passed highest level of compliance. (level 6)
"
REVISION "201507280000Z" -- July 28, 2015
DESCRIPTION
"
Updated to follow MIB structure conformance rules. Tested with
SimpleWeb: http://www.simpleweb.org
Passed highest level of compliance. (level 6)
"
REVISION "201507230000Z" -- July 23, 2015
DESCRIPTION
"Fixed MIB syntax warnings."
REVISION "201506230000Z" -- June 23, 2015
DESCRIPTION
"General revision."
::= { simple 1 }
-- Tectual convention
rectSysTotalOutputCurrent OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"
Total accumulated output current of all the rectifiers associated with the current system.
"
::= { rectifierSystem 1 }
rectSysTotalOutputPower OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Total output current of all system rectifiers."
::= { rectifierSystem 2 }
rectSysTotalCapacityInstalledAmps OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"A rectifier output current multiplied by the number of rectifiers installed."
::= { rectifierSystem 3 }
rectSysTotalCapacityInstalledPower OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"A rectifier output power multiplied by the number of rectifiers installed."
::= { rectifierSystem 4 }
rectSysAverageRectifierOutputVoltage OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Average rectifier output voltage."
::= { rectifierSystem 5 }
rectSysAverageRectifierACInputVoltage OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Average rectifier input voltage."
::= { rectifierSystem 6 }
rectSysAveragePhase1Voltage OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Average output voltage of rectifiers in Phase 1."
::= { rectifierSystem 7 }
rectSysAveragePhase2Voltage OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Average output voltage of rectifiers in Phase 2."
::= { rectifierSystem 8 }
rectSysAveragePhase3Voltage OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Average output voltage of rectifiers in Phase 3."
::= { rectifierSystem 9 }
rectSysSystemVoltage OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"System voltage."
::= { rectifierSystem 10 }
rectSysTotalLoadCurrent OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Total load current."
::= { rectifierSystem 11 }
rectSysBatteryVoltage OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Battery voltage."
::= { rectifierSystem 12 }
rectSysBatteryCurrent OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Battery current."
::= { rectifierSystem 13 }
rectSysBatteryTemperature OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Battery temperature."
::= { rectifierSystem 14 }
rectSysSystemNumber OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Snmp ID# assigned to the system."
::= { rectifierSystem 15 }
rectSysEstimatedRequiredCapacityInWatts OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Estimated required capacity needed in watts."
::= { rectifierSystem 16 }
rectSysEstimatedRequiredCapacityInAmps OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Estimated required capacity needed in amps."
::= { rectifierSystem 17 }
rectSysEstimatedAvailableCapacityInWatts OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Estimated available capacity needed in watts."
::= { rectifierSystem 18 }
rectSysEstimatedAvailableCapacityInAmps OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Estimated available capacity needed in amps."
::= { rectifierSystem 19 }
rectSysEstimatedRedundantCapacityInWatts OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Estimated redundant capacity needed in watts."
::= { rectifierSystem 20 }
rectSysEstimatedRedundantCapacityInAmps OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Estimated redundant capacity needed in amps."
::= { rectifierSystem 21 }
rectSysEstimatedStandbyCapacityInWatts OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Estimated standby capacity needed in watts."
::= { rectifierSystem 22 }
rectSysEstimatedStandbyCapacityInAmps OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Estimated standby capacity needed in amps."
::= { rectifierSystem 23 }
rectSysPowerAveragePower OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The average power of all modules supplying power for Power Save in percentage."
::= { rectifierSystem 24 }
rectSysModulesSupplyingPower OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Number of modules supplying power."
::= { rectifierSystem 25 }
rectSysModulesInStandby OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Number of modules in standby."
::= { rectifierSystem 26 }
rectSysEstimatedCapacityRemainingCurrent OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Estimated capacity remaining in amps."
::= { rectifierSystem 28 }
rectSysEstimatedCapacityRemainingPower OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Estimated capacity remaining in watts."
::= { rectifierSystem 29 }
rectSysEstimatedSOCPercent OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Estimated state of charge percent remaining."
::= { rectifierSystem 30 }
rectSysEstimatedBatteryRuntime OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Estimated battery runtime remaining in hours."
::= { rectifierSystem 31 }
rectSysEstimatedBatteryHealthPercent OBJECT-TYPE
SYNTAX ScaledNumber
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Estimated battery health percentage."
::= { rectifierSystem 32 }
-- Conformance
conformance OBJECT IDENTIFIER ::= { rectifierSystem 100 }
compliances OBJECT IDENTIFIER ::= { conformance 1 }
compliance MODULE-COMPLIANCE
STATUS current
DESCRIPTION
"The compliance statement for systems supporting
the alpha MIB."
MODULE -- this module
MANDATORY-GROUPS {
rectifierGroup
}
::= { compliances 1 }
rectifierGroups OBJECT IDENTIFIER ::= { conformance 2 }
rectifierGroup OBJECT-GROUP
OBJECTS {
rectSysTotalOutputCurrent,
rectSysTotalOutputPower,
rectSysTotalCapacityInstalledAmps,
rectSysTotalCapacityInstalledPower,
rectSysAverageRectifierOutputVoltage,
rectSysAverageRectifierACInputVoltage,
rectSysAveragePhase1Voltage,
rectSysAveragePhase2Voltage,
rectSysAveragePhase3Voltage,
rectSysSystemVoltage,
rectSysTotalLoadCurrent,
rectSysBatteryVoltage,
rectSysBatteryCurrent,
rectSysBatteryTemperature,
rectSysSystemNumber,
rectSysEstimatedRequiredCapacityInWatts,
rectSysEstimatedRequiredCapacityInAmps,
rectSysEstimatedAvailableCapacityInWatts,
rectSysEstimatedAvailableCapacityInAmps,
rectSysEstimatedRedundantCapacityInWatts,
rectSysEstimatedRedundantCapacityInAmps,
rectSysEstimatedStandbyCapacityInWatts,
rectSysEstimatedStandbyCapacityInAmps,
rectSysPowerAveragePower,
rectSysModulesSupplyingPower,
rectSysModulesInStandby,
rectSysEstimatedCapacityRemainingCurrent,
rectSysEstimatedCapacityRemainingPower,
rectSysEstimatedSOCPercent,
rectSysEstimatedBatteryRuntime,
rectSysEstimatedBatteryHealthPercent
}
STATUS current
DESCRIPTION
"Alpha Rectifier System data list group."
::= { rectifierGroups 1 }
END

File diff suppressed because it is too large Load Diff

155
tests/data/cxc.json Normal file
View File

@ -0,0 +1,155 @@
{
"os": {
"discovery": {
"devices": [
{
"sysName": "<private>",
"sysObjectID": ".1.3.6.1.4.1.7309.5",
"sysDescr": "System Controller, SW: v7.30, OS: v5.20, HW: S1.I3.P1, SN: 373012240",
"sysContact": "<private>",
"version": null,
"hardware": null,
"features": null,
"location": "<private>",
"os": "cxc",
"type": "power",
"serial": null,
"icon": "alpha.png"
}
]
},
"poller": "matches discovery"
},
"sensors": {
"discovery": {
"sensors": [
{
"sensor_deleted": 0,
"sensor_class": "current",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.7309.5.3.1.1.0",
"sensor_index": "0",
"sensor_type": "cxc",
"sensor_descr": "Total Output Current",
"group": null,
"sensor_divisor": 1000,
"sensor_multiplier": 1,
"sensor_current": 17.87,
"sensor_limit": null,
"sensor_limit_warn": null,
"sensor_limit_low": null,
"sensor_limit_low_warn": null,
"sensor_alert": 1,
"sensor_custom": "No",
"entPhysicalIndex": null,
"entPhysicalIndex_measured": null,
"sensor_prev": null,
"user_func": null,
"rrd_type": "GAUGE",
"state_name": null
},
{
"sensor_deleted": 0,
"sensor_class": "temperature",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.7309.5.3.1.14.0",
"sensor_index": "rectSysBatteryTemperature.0",
"sensor_type": "cxc",
"sensor_descr": "Battery Temperature",
"group": null,
"sensor_divisor": 1000,
"sensor_multiplier": 1,
"sensor_current": 17.527,
"sensor_limit": 37.527,
"sensor_limit_warn": null,
"sensor_limit_low": 7.527,
"sensor_limit_low_warn": null,
"sensor_alert": 1,
"sensor_custom": "No",
"entPhysicalIndex": null,
"entPhysicalIndex_measured": null,
"sensor_prev": null,
"user_func": null,
"rrd_type": "GAUGE",
"state_name": null
},
{
"sensor_deleted": 0,
"sensor_class": "voltage",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.7309.5.3.1.6.0",
"sensor_index": "rectSysAverageRectifierACInputVoltage.0",
"sensor_type": "cxc",
"sensor_descr": "AC Input Voltage",
"group": null,
"sensor_divisor": 1000,
"sensor_multiplier": 1,
"sensor_current": 249.125,
"sensor_limit": 286.49375,
"sensor_limit_warn": null,
"sensor_limit_low": 211.75625,
"sensor_limit_low_warn": null,
"sensor_alert": 1,
"sensor_custom": "No",
"entPhysicalIndex": null,
"entPhysicalIndex_measured": null,
"sensor_prev": null,
"user_func": null,
"rrd_type": "GAUGE",
"state_name": null
},
{
"sensor_deleted": 0,
"sensor_class": "voltage",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.7309.5.3.1.12.0",
"sensor_index": "rectSysBatteryVoltage.0",
"sensor_type": "cxc",
"sensor_descr": "Battery Voltage",
"group": null,
"sensor_divisor": 1000,
"sensor_multiplier": 1,
"sensor_current": 53.931,
"sensor_limit": 62.02065,
"sensor_limit_warn": null,
"sensor_limit_low": 45.84135,
"sensor_limit_low_warn": null,
"sensor_alert": 1,
"sensor_custom": "No",
"entPhysicalIndex": null,
"entPhysicalIndex_measured": null,
"sensor_prev": null,
"user_func": null,
"rrd_type": "GAUGE",
"state_name": null
},
{
"sensor_deleted": 0,
"sensor_class": "voltage",
"poller_type": "snmp",
"sensor_oid": ".1.3.6.1.4.1.7309.5.3.1.10.0",
"sensor_index": "rectSysSystemVoltage.0",
"sensor_type": "cxc",
"sensor_descr": "System Voltage",
"group": null,
"sensor_divisor": 1000,
"sensor_multiplier": 1,
"sensor_current": 53.946,
"sensor_limit": 62.0379,
"sensor_limit_warn": null,
"sensor_limit_low": 45.8541,
"sensor_limit_low_warn": null,
"sensor_alert": 1,
"sensor_custom": "No",
"entPhysicalIndex": null,
"entPhysicalIndex_measured": null,
"sensor_prev": null,
"user_func": null,
"rrd_type": "GAUGE",
"state_name": null
}
]
},
"poller": "matches discovery"
}
}

53
tests/snmpsim/cxc.snmprec Normal file
View File

@ -0,0 +1,53 @@
1.3.6.1.2.1.1.1.0|4|System Controller, SW: v7.30, OS: v5.20, HW: S1.I3.P1, SN: 373012240
1.3.6.1.2.1.1.2.0|6|1.3.6.1.4.1.7309.5
1.3.6.1.2.1.1.3.0|67|57851402
1.3.6.1.2.1.1.4.0|4|<private>
1.3.6.1.2.1.1.5.0|4|<private>
1.3.6.1.2.1.1.6.0|4|<private>
1.3.6.1.2.1.118.1.1.1.0|67|31204789
1.3.6.1.4.1.7309.5.1.3.0|4|v7.30
1.3.6.1.4.1.7309.5.2.1.2.1.6.1.1|4|373012240
1.3.6.1.4.1.7309.5.3.1.1.0|2|17870
1.3.6.1.4.1.7309.5.3.1.2.0|2|1079663
1.3.6.1.4.1.7309.5.3.1.3.0|2|177351
1.3.6.1.4.1.7309.5.3.1.4.0|2|9600000
1.3.6.1.4.1.7309.5.3.1.5.0|2|53852
1.3.6.1.4.1.7309.5.3.1.6.0|2|249125
1.3.6.1.4.1.7309.5.3.1.7.0|5|
1.3.6.1.4.1.7309.5.3.1.8.0|5|
1.3.6.1.4.1.7309.5.3.1.9.0|5|
1.3.6.1.4.1.7309.5.3.1.10.0|2|53946
1.3.6.1.4.1.7309.5.3.1.11.0|2|21361
1.3.6.1.4.1.7309.5.3.1.12.0|2|53931
1.3.6.1.4.1.7309.5.3.1.13.0|2|-1707
1.3.6.1.4.1.7309.5.3.1.14.0|2|17527
1.3.6.1.4.1.7309.5.3.1.15.0|2|1000
1.3.6.1.4.1.7309.5.3.1.16.0|2|1153675
1.3.6.1.4.1.7309.5.3.1.17.0|2|21361
1.3.6.1.4.1.7309.5.3.1.18.0|2|9600000
1.3.6.1.4.1.7309.5.3.1.19.0|2|177351
1.3.6.1.4.1.7309.5.3.1.20.0|2|6316240
1.3.6.1.4.1.7309.5.3.1.21.0|2|116954
1.3.6.1.4.1.7309.5.3.1.22.0|2|0
1.3.6.1.4.1.7309.5.3.1.23.0|2|0
1.3.6.1.4.1.7309.5.3.1.24.0|2|11246
1.3.6.1.4.1.7309.5.3.1.25.0|2|4000
1.3.6.1.4.1.7309.5.3.1.26.0|2|0
1.3.6.1.4.1.7309.5.3.1.28.0|2|157331
1.3.6.1.4.1.7309.5.3.1.29.0|2|8520335
1.3.6.1.4.1.7309.5.3.1.30.0|2|2147483647
1.3.6.1.4.1.7309.5.3.1.31.0|5|
1.3.6.1.4.1.7309.5.3.1.32.0|2|2147483647
1.3.6.1.4.1.7309.5.3.1.33.0|2|4000
1.3.6.1.4.1.7309.5.3.1.34.0|2|4000
1.3.6.1.4.1.7309.5.3.1.35.0|2|0
1.3.6.1.4.1.7309.5.3.1.36.0|2|0
1.3.6.1.4.1.7309.5.3.1.37.0|2|0
1.3.6.1.4.1.7309.5.3.1.38.0|2|4000
1.3.6.1.4.1.7309.5.3.1.39.0|2|0
1.3.6.1.4.1.7309.5.3.1.40.0|2|0
1.3.6.1.4.1.7309.5.3.1.41.0|2|0
1.3.6.1.4.1.7309.5.3.1.42.0|2|0
1.3.6.1.4.1.7309.5.3.1.43.0|2|0
1.3.6.1.4.1.7309.5.3.1.44.0|2|0
1.3.6.1.4.1.7309.5.3.1.45.0|2|26400