Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix power unit and add Voltage metric #5187

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/hardware/pdu/cyberpower/snmp/mode/load.pm
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ sub set_counters {
{ template => '%s', unit => 'W', min => 0, label_extra_instance => 1 }
]
}
},
{ label => 'phase-voltage', nlabel => 'phase.voltage.volt', set => {
key_values => [ { name => 'voltage' } ],
output_template => 'voltage : %s V',
perfdatas => [
{ template => '%s', unit => 'V', min => 0, label_extra_instance => 1 }
]
}
}
];
}
Expand Down Expand Up @@ -197,6 +205,7 @@ sub check_pdu2 {
number => { oid => '.1.3.6.1.4.1.3808.1.1.6.4.4.1.3' }, # ePDU2PhaseStatusNumber
state => { oid => '.1.3.6.1.4.1.3808.1.1.6.4.4.1.4', map => $map_pdu_status }, # ePDU2PhaseStatusLoadState
current => { oid => '.1.3.6.1.4.1.3808.1.1.6.4.4.1.5' }, # ePDU2PhaseStatusLoad
voltage => { oid => '.1.3.6.1.4.1.3808.1.1.6.4.4.1.6' }, # ePDU2PhaseStatusVoltage
power => { oid => '.1.3.6.1.4.1.3808.1.1.6.4.4.1.7' } # ePDU2PhaseStatusPower
};
my $mapping_bank = {
Expand Down Expand Up @@ -230,7 +239,8 @@ sub check_pdu2 {
display => $result->{number},
state => $result->{state},
current => $result->{current} / 10,
power => $result->{power} * 10 # hundreth of kW. So * 10 for watt
voltage => $result->{voltage}/10,
power => $result->{power}
}
}

Expand Down Expand Up @@ -317,7 +327,7 @@ You can use the following variables: %{state}, %{display}
=item B<--warning-*> B<--critical-*>

Thresholds.
Can be: 'phase-current', 'phase-power', 'bank-current'.
Can be: 'phase-current', 'phase-power', 'phase-voltage', 'bank-current'.

=back

Expand Down
Loading
Loading