forked from librenms/librenms
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
device: Updated cyberpower sensors and os support (librenms#8551)
- Loading branch information
Showing
6 changed files
with
11,457 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
mib: CPS-MIB | ||
modules: | ||
sensors: | ||
state: | ||
data: | ||
- | ||
oid: upsBaseBatteryStatus | ||
num_oid: .1.3.6.1.4.1.3808.1.1.1.2.1.1. | ||
descr: 'Battery Status' | ||
index: 'upsBaseBatteryStatus.{{ $index }}' | ||
states: | ||
- { value: 1, descr: Known, graph: 1, generic: 3 } | ||
- { value: 2, descr: Normal, graph: 1, generic: 0 } | ||
- { value: 3, descr: Low, graph: 1, generic: 2 } | ||
- | ||
oid: upsAdvanceBatteryReplaceIndicator | ||
num_oid: .1.3.6.1.4.1.3808.1.1.1.2.2.5. | ||
descr: 'Battery Replace Indicator' | ||
index: 'upsAdvanceBatteryReplaceIndicator.{{ $index }}' | ||
states: | ||
- { value: 1, descr: No, graph: 1, generic: 0 } | ||
- { value: 2, descr: Replace, graph: 1, generic: 2 } | ||
- | ||
oid: upsAdvanceInputLineFailCause | ||
num_oid: .1.3.6.1.4.1.3808.1.1.1.3.2.5. | ||
descr: 'Input Line Cause' | ||
index: 'upsAdvanceInputLineFailCause.{{ $index }}' | ||
states: | ||
- { value: 1, descr: 'No Transfer', graph: 1, generic: 0 } | ||
- { value: 2, descr: 'High Voltage', graph: 1, generic: 2 } | ||
- { value: 3, descr: 'Brown Out', graph: 1, generic: 2 } | ||
- { value: 4, descr: 'Self Test', graph: 1, generic: 1 } | ||
- | ||
oid: upsAdvanceInputStatus | ||
num_oid: .1.3.6.1.4.1.3808.1.1.1.3.2.6. | ||
descr: 'Input Status' | ||
index: 'upsAdvanceInputStatus.{{ $index }}' | ||
states: | ||
- { value: 1, descr: 'Normal', graph: 1, generic: 0 } | ||
- { value: 2, descr: 'Over Voltage', graph: 1, generic: 2 } | ||
- { value: 3, descr: 'Under Voltage', graph: 1, generic: 2 } | ||
- { value: 4, descr: 'Frequency Failure', graph: 1, generic: 2 } | ||
- { value: 5, descr: 'Blackout', graph: 1, generic: 2 } | ||
- | ||
oid: upsBaseOutputStatus | ||
num_oid: .1.3.6.1.4.1.3808.1.1.1.4.1.1. | ||
descr: 'Output Status' | ||
index: 'upsBaseOutputStatus.{{ $index }}' | ||
states: | ||
- { value: 1, descr: 'Unknown', graph: 1, generic: 3 } | ||
- { value: 2, descr: 'Online', graph: 1, generic: 0 } | ||
- { value: 3, descr: 'On Battery', graph: 1, generic: 2 } | ||
- { value: 4, descr: 'On Boost', graph: 1, generic: 1 } | ||
- { value: 5, descr: 'On Sleep', graph: 1, generic: 1 } | ||
- { value: 6, descr: 'Off', graph: 1, generic: 2 } | ||
- { value: 7, descr: 'Rebooting', graph: 1, generic: 1 } | ||
charge: | ||
data: | ||
- | ||
oid: upsAdvanceBatteryCapacity | ||
num_oid: .1.3.6.1.4.1.3808.1.1.1.2.2.1. | ||
index: 'upsAdvanceBatteryCapacity.{{ $index }}' | ||
descr: 'Battery Capacity' | ||
current: | ||
data: | ||
- | ||
oid: upsAdvanceOutputCurrent | ||
num_oid: .1.3.6.1.4.1.3808.1.1.1.4.2.4. | ||
index: 'upsAdvanceOutputCurrent.{{ $index }}' | ||
descr: 'Output' | ||
voltage: | ||
data: | ||
- | ||
oid: upsAdvanceBatteryVoltage | ||
num_oid: .1.3.6.1.4.1.3808.1.1.1.2.2.2. | ||
index: 'upsAdvanceBatteryVoltage.{{ $index }}' | ||
descr: 'Battery Voltage' | ||
- | ||
oid: upsAdvanceInputLineVoltage | ||
num_oid: .1.3.6.1.4.1.3808.1.1.1.3.2.1. | ||
index: 'upsAdvanceInputLineVoltage.{{ $index }}' | ||
descr: 'Input Line Voltage' | ||
divisor: 10 | ||
- | ||
oid: upsAdvanceOutputVoltage | ||
num_oid: .1.3.6.1.4.1.3808.1.1.1.4.2.1. | ||
index: 'upsAdvanceOutputVoltage.{{ $index }}' | ||
descr: 'Output Voltage' | ||
divisor: 10 | ||
temperature: | ||
data: | ||
- | ||
oid: upsAdvanceBatteryTemperature | ||
num_oid: .1.3.6.1.4.1.3808.1.1.1.2.2.3. | ||
index: 'upsAdvanceBatteryTemperature.{{ $index }}' | ||
descr: 'Battery Temperature' | ||
runtime: | ||
data: | ||
- | ||
oid: upsAdvanceBatteryRunTimeRemaining | ||
num_oid: .1.3.6.1.4.1.3808.1.1.1.2.2.4. | ||
index: 'upsAdvanceBatteryRunTimeRemaining.{{ $index }}' | ||
descr: 'Battery Runtime' | ||
divisor: 6000 | ||
frequency: | ||
data: | ||
- | ||
oid: upsAdvanceInputFrequency | ||
num_oid: .1.3.6.1.4.1.3808.1.1.1.3.2.4. | ||
index: 'upsAdvanceInputFrequency.{{ $index }}' | ||
descr: 'Input' | ||
divisor: 10 | ||
- | ||
oid: upsAdvanceOutputFrequency | ||
num_oid: .1.3.6.1.4.1.3808.1.1.1.4.2.2. | ||
index: 'upsAdvanceOutputFrequency.{{ $index }}' | ||
descr: 'Output' | ||
divisor: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,19 @@ | ||
<?php | ||
|
||
$oids=array( | ||
'.1.3.6.1.4.1.3808.1.1.3.1.5.0', | ||
'.1.3.6.1.4.1.3808.1.1.3.1.3.0' | ||
); | ||
$returned_oids=snmp_get_multi_oid($device, $oids); | ||
if (begins_with('.1.3.6.1.4.1.3808.1.1.1', $device['sysObjectID'])) { | ||
$cyberpower_oids = [ | ||
'hardware' => '.1.3.6.1.4.1.3808.1.1.1.1.1.1.0', | ||
'version' => '.1.3.6.1.4.1.3808.1.1.1.1.2.1.0', | ||
'serial' => '.1.3.6.1.4.1.3808.1.1.1.1.2.3.0', | ||
]; | ||
} else { | ||
$cyberpower_oids = [ | ||
'version' => '.1.3.6.1.4.1.3808.1.1.3.1.3.0', | ||
'hardware' => '.1.3.6.1.4.1.3808.1.1.3.1.5.0', | ||
'serial' => '.1.3.6.1.4.1.3808.1.1.3.1.6.0', | ||
]; | ||
} | ||
$returned_oids = snmp_get_multi_oid($device, $cyberpower_oids, '-OUQn', 'CPS-MIB'); | ||
|
||
$hardware = $hardware = $returned_oids['.1.3.6.1.4.1.3808.1.1.3.1.5.0']; | ||
$hardware = str_replace('"', '', $hardware); | ||
$version = $hardware = $returned_oids['.1.3.6.1.4.1.3808.1.1.3.1.3.0']; | ||
$version = str_replace('"', '', $version); | ||
$hardware = $returned_oids[$cyberpower_oids['hardware']]; | ||
$version = $returned_oids[$cyberpower_oids['version']]; |
Oops, something went wrong.