mirror of https://github.com/mikaku/Monitorix.git
Add alt_scaling_for_timeleft, alt_scaling_for_battery_voltage and alt_scaling_for_voltage config options to nut module.
This option sets the alternative scaling option for the corresponding plots.
This commit is contained in:
parent
9bed02ca3f
commit
c29f1c3325
19
lib/nut.pm
19
lib/nut.pm
|
@ -259,6 +259,16 @@ sub skipscale_string {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub altscaling_options {
|
||||||
|
my ($altscaling) = @_;
|
||||||
|
my @scaling_options;
|
||||||
|
if ($altscaling) {
|
||||||
|
push(@scaling_options, "--alt-autoscale");
|
||||||
|
push(@scaling_options, "--alt-y-grid");
|
||||||
|
}
|
||||||
|
return @scaling_options;
|
||||||
|
}
|
||||||
|
|
||||||
sub nut_cgi {
|
sub nut_cgi {
|
||||||
my ($package, $config, $cgi) = @_;
|
my ($package, $config, $cgi) = @_;
|
||||||
my @output;
|
my @output;
|
||||||
|
@ -321,6 +331,9 @@ sub nut_cgi {
|
||||||
my $ignore_error_output = lc($nut->{ignore_error_output} || "") eq "y" ? 1 : 0;
|
my $ignore_error_output = lc($nut->{ignore_error_output} || "") eq "y" ? 1 : 0;
|
||||||
my $skipscale_for_transfer_voltage = lc($nut->{skipscale_for_transfer_voltage} || "") eq "y" ? 1 : 0;
|
my $skipscale_for_transfer_voltage = lc($nut->{skipscale_for_transfer_voltage} || "") eq "y" ? 1 : 0;
|
||||||
my $skipscale_for_shutdown_level = lc($nut->{skipscale_for_shutdown_level} || "") eq "y" ? 1 : 0;
|
my $skipscale_for_shutdown_level = lc($nut->{skipscale_for_shutdown_level} || "") eq "y" ? 1 : 0;
|
||||||
|
my $alt_scaling_for_voltage = lc($nut->{alt_scaling_for_voltage} || "") eq "y" ? 1 : 0;
|
||||||
|
my $alt_scaling_for_timeleft = lc($nut->{alt_scaling_for_timeleft} || "") eq "y" ? 1 : 0;
|
||||||
|
my $alt_scaling_for_battery_voltage = lc($nut->{alt_scaling_for_battery_voltage} || "") eq "y" ? 1 : 0;
|
||||||
|
|
||||||
# text mode
|
# text mode
|
||||||
#
|
#
|
||||||
|
@ -514,6 +527,7 @@ sub nut_cgi {
|
||||||
"--vertical-label=Volts",
|
"--vertical-label=Volts",
|
||||||
"--width=$width",
|
"--width=$width",
|
||||||
"--height=$height",
|
"--height=$height",
|
||||||
|
altscaling_options($alt_scaling_for_voltage),
|
||||||
@extra,
|
@extra,
|
||||||
@riglim,
|
@riglim,
|
||||||
$zoom,
|
$zoom,
|
||||||
|
@ -541,6 +555,7 @@ sub nut_cgi {
|
||||||
"--width=$width",
|
"--width=$width",
|
||||||
"--height=$height",
|
"--height=$height",
|
||||||
@full_size_mode,
|
@full_size_mode,
|
||||||
|
altscaling_options($alt_scaling_for_voltage),
|
||||||
@extra,
|
@extra,
|
||||||
@riglim,
|
@riglim,
|
||||||
$zoom,
|
$zoom,
|
||||||
|
@ -817,6 +832,7 @@ sub nut_cgi {
|
||||||
"--vertical-label=Volts",
|
"--vertical-label=Volts",
|
||||||
"--width=$width",
|
"--width=$width",
|
||||||
"--height=$height",
|
"--height=$height",
|
||||||
|
altscaling_options($alt_scaling_for_battery_voltage),
|
||||||
@extra,
|
@extra,
|
||||||
@riglim,
|
@riglim,
|
||||||
$zoom,
|
$zoom,
|
||||||
|
@ -840,6 +856,7 @@ sub nut_cgi {
|
||||||
"--width=$width",
|
"--width=$width",
|
||||||
"--height=$height",
|
"--height=$height",
|
||||||
@full_size_mode,
|
@full_size_mode,
|
||||||
|
altscaling_options($alt_scaling_for_battery_voltage),
|
||||||
@extra,
|
@extra,
|
||||||
@riglim,
|
@riglim,
|
||||||
$zoom,
|
$zoom,
|
||||||
|
@ -906,6 +923,7 @@ sub nut_cgi {
|
||||||
"--vertical-label=Minutes",
|
"--vertical-label=Minutes",
|
||||||
"--width=$width",
|
"--width=$width",
|
||||||
"--height=$height",
|
"--height=$height",
|
||||||
|
altscaling_options($alt_scaling_for_timeleft),
|
||||||
@extra,
|
@extra,
|
||||||
@riglim,
|
@riglim,
|
||||||
$zoom,
|
$zoom,
|
||||||
|
@ -930,6 +948,7 @@ sub nut_cgi {
|
||||||
"--vertical-label=Minutes",
|
"--vertical-label=Minutes",
|
||||||
"--width=$width",
|
"--width=$width",
|
||||||
"--height=$height",
|
"--height=$height",
|
||||||
|
altscaling_options($alt_scaling_for_timeleft),
|
||||||
@full_size_mode,
|
@full_size_mode,
|
||||||
@extra,
|
@extra,
|
||||||
@riglim,
|
@riglim,
|
||||||
|
|
|
@ -4234,6 +4234,27 @@ This option, when enabled via \fIy\fP, ignores the shutdown level graph when sca
|
||||||
.P
|
.P
|
||||||
Default value: \fIn\fP
|
Default value: \fIn\fP
|
||||||
.RE
|
.RE
|
||||||
|
.P
|
||||||
|
.BI alt_scaling_for_voltage
|
||||||
|
.RS
|
||||||
|
This option, when enabled via \fIy\fP, sets alternate plot axis scaling for the voltage graph. This can be useful to improve the scaling in some cases.
|
||||||
|
.P
|
||||||
|
Default value: \fIn\fP
|
||||||
|
.RE
|
||||||
|
.P
|
||||||
|
.BI alt_scaling_for_timeleft
|
||||||
|
.RS
|
||||||
|
This option, when enabled via \fIy\fP, sets alternate plot axis scaling for the time left graph. This can be useful to improve the scaling in some cases.
|
||||||
|
.P
|
||||||
|
Default value: \fIn\fP
|
||||||
|
.RE
|
||||||
|
.P
|
||||||
|
.BI alt_scaling_for_battery_voltage
|
||||||
|
.RS
|
||||||
|
This option, when enabled via \fIy\fP, sets alternate plot axis scaling for the battery voltage graph. This can be useful to improve the scaling in some cases.
|
||||||
|
.P
|
||||||
|
Default value: \fIn\fP
|
||||||
|
.RE
|
||||||
.SS Wowza Media Server (wowza.pm)
|
.SS Wowza Media Server (wowza.pm)
|
||||||
This graph is able to monitor an unlimited number of Wowza servers.
|
This graph is able to monitor an unlimited number of Wowza servers.
|
||||||
.P
|
.P
|
||||||
|
|
Loading…
Reference in New Issue