1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

Nutups2 multiplier (#1313)

* add multiplier_fetch that's much like common_fetch

* moved multiplier_fetch functionality to common_fetch

* power_emulated_multiplier env var added and Documented

---------

Co-authored-by: Tim Connors <tconnors@rather.puzzling.org>
This commit is contained in:
Tim Connors 2023-10-17 04:39:47 +11:00 committed by GitHub
parent 89bd7114e1
commit c66f50b2e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,10 +36,11 @@ You can also control individual fields like:
=head1 FEATURES
The plugin supports reporting battery charge, UPS load, input/output
frequencies/currents/voltages, apparent and real power output, humidity and
temperature readings. Note however that different UPS models report different
levels of detail; the plugin reports whatever information the NUT UPS driver
(and in turn the UPS itself) provides.
frequencies/currents/voltages, apparent and real power output, as well
as emulated power output if only % load is available, humidity and
temperature readings. Note however that different UPS models report
different levels of detail; the plugin reports whatever information
the NUT UPS driver (and in turn the UPS itself) provides.
Although the 'suggest' command will only offer UPSes for which the local host
is the master, you can also monitor remote UPSes if you include the host name
@ -49,6 +50,19 @@ in the symlink, like:
etc.
If your UPS only outputs % load instead of an actual power value, you
can emulate it based on readings you can manually make such as by
comparing against a power meter. Configure the plugin via with
settings like these:
[nutups2_powershield-commander*]
# powershield commander 1000: 400 watts at 63% load on powershield commander 1000: 400/63
env.power_emulated_multiplier 6.349
[nutups2_powershield-centurion*]
# powershield centurion 1000: 445 watts at 48% load on powershield centurion 1000: 445/49
env.power_emulated_multiplier 9.294
=head1 AUTHOR
Gábor Gombás <gombasg@sztaki.hu>
@ -141,6 +155,15 @@ my %config = (
config => \&common_config,
fetch => \&common_fetch,
},
power_emulated => {
filter => qr/^(.*)\.load$/,
title => 'UPS emulated power',
args => '--base 1000 -l 0',
vlabel => 'Watt',
config => \&common_config,
multiplier => $ENV{'power_emulated_multiplier'} || 1,
fetch => \&common_fetch,
},
);
sub read_ups_values {
@ -265,7 +288,9 @@ sub common_fetch {
$field .= $nominal if $nominal;
my $id = clean_fieldname($field);
print $id . ".value " . $values->{$key} . "\n";
print $id . ".value " . $values->{$key}*
(defined $config{$func}->{'multiplier'} ? $config{$func}->{'multiplier'} : 1)
. "\n";
}
}