mirror of https://github.com/mikaku/Monitorix.git
Add gap_on_all_nan option to lmsens.
This commit is contained in:
parent
63c800fc7b
commit
e046987f6f
|
@ -489,7 +489,7 @@ sub lmsens_cgi {
|
|||
if(lc($config->{temperature_scale}) eq "f") {
|
||||
$temp_scale = "Fahrenheit";
|
||||
}
|
||||
|
||||
my $gap_on_all_nan = lc($lmsens->{gap_on_all_nan} || "") eq "y" ? 1 : 0;
|
||||
|
||||
# text mode
|
||||
#
|
||||
|
@ -750,6 +750,7 @@ sub lmsens_cgi {
|
|||
@tmp = @tmpz;
|
||||
push(@tmp, "COMMENT: \\n");
|
||||
}
|
||||
my $cdef_allvalues_core = $gap_on_all_nan ? "CDEF:allvalues=core0,UN,0,1,IF,core1,UN,0,1,IF,core2,UN,0,1,IF,core3,UN,0,1,IF,core4,UN,0,1,IF,core5,UN,0,1,IF,core6,UN,0,1,IF,core7,UN,0,1,IF,core8,UN,0,1,IF,core9,UN,0,1,IF,core10,UN,0,1,IF,core11,UN,0,1,IF,core12,UN,0,1,IF,core13,UN,0,1,IF,core14,UN,0,1,IF,core15,UN,0,1,IF,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+,0,GT,1,UNKN,IF" : "CDEF:allvalues=core0,core1,core2,core3,core4,core5,core6,core7,core8,core9,core10,core11,core12,core13,core14,core15,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+";
|
||||
$pic = $rrd{$version}->("$IMG_DIR" . "$IMG1",
|
||||
"--title=$config->{graphs}->{_lmsens1} ($tf->{nwhen}$tf->{twhen})",
|
||||
"--start=-$tf->{nwhen}$tf->{twhen}",
|
||||
|
@ -778,7 +779,7 @@ sub lmsens_cgi {
|
|||
"DEF:core13=$rrd:lmsens_core13:AVERAGE",
|
||||
"DEF:core14=$rrd:lmsens_core14:AVERAGE",
|
||||
"DEF:core15=$rrd:lmsens_core15:AVERAGE",
|
||||
"CDEF:allvalues=core0,core1,core2,core3,core4,core5,core6,core7,core8,core9,core10,core11,core12,core13,core14,core15,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+",
|
||||
$cdef_allvalues_core,
|
||||
@CDEF,
|
||||
@tmp);
|
||||
$err = RRDs::error;
|
||||
|
@ -814,7 +815,7 @@ sub lmsens_cgi {
|
|||
"DEF:core13=$rrd:lmsens_core13:AVERAGE",
|
||||
"DEF:core14=$rrd:lmsens_core14:AVERAGE",
|
||||
"DEF:core15=$rrd:lmsens_core15:AVERAGE",
|
||||
"CDEF:allvalues=core0,core1,core2,core3,core4,core5,core6,core7,core8,core9,core10,core11,core12,core13,core14,core15,+,+,+,+,+,+,+,+,+,+,+,+,+,+,+",
|
||||
$cdef_allvalues_core,
|
||||
@CDEF,
|
||||
@tmpz);
|
||||
$err = RRDs::error;
|
||||
|
@ -945,6 +946,7 @@ sub lmsens_cgi {
|
|||
push(@tmp, "COMMENT: \\n");
|
||||
push(@tmp, "COMMENT: \\n");
|
||||
}
|
||||
my $cdef_allvalues_volt = $gap_on_all_nan ? "CDEF:allvalues=volt0,UN,0,1,IF,volt1,UN,0,1,IF,volt2,UN,0,1,IF,volt3,UN,0,1,IF,volt4,UN,0,1,IF,volt5,UN,0,1,IF,volt6,UN,0,1,IF,volt7,UN,0,1,IF,volt8,UN,0,1,IF,volt9,UN,0,1,IF,volt10,UN,0,1,IF,volt11,UN,0,1,IF,+,+,+,+,+,+,+,+,+,+,+,0,GT,1,UNKN,IF" : "CDEF:allvalues=volt0,volt1,volt2,volt3,volt4,volt5,volt6,volt7,volt8,volt9,volt10,volt11,+,+,+,+,+,+,+,+,+,+,+";
|
||||
$pic = $rrd{$version}->("$IMG_DIR" . "$IMG2",
|
||||
"--title=$config->{graphs}->{_lmsens2} ($tf->{nwhen}$tf->{twhen})
|
||||
",
|
||||
|
@ -970,7 +972,7 @@ sub lmsens_cgi {
|
|||
"DEF:volt9=$rrd:lmsens_volt9:AVERAGE",
|
||||
"DEF:volt10=$rrd:lmsens_volt10:AVERAGE",
|
||||
"DEF:volt11=$rrd:lmsens_volt11:AVERAGE",
|
||||
"CDEF:allvalues=volt0,volt1,volt2,volt3,volt4,volt5,volt6,volt7,volt8,volt9,volt10,volt11,+,+,+,+,+,+,+,+,+,+,+",
|
||||
$cdef_allvalues_volt,
|
||||
@CDEF,
|
||||
@tmp);
|
||||
$err = RRDs::error;
|
||||
|
@ -1002,7 +1004,7 @@ sub lmsens_cgi {
|
|||
"DEF:volt9=$rrd:lmsens_volt9:AVERAGE",
|
||||
"DEF:volt10=$rrd:lmsens_volt10:AVERAGE",
|
||||
"DEF:volt11=$rrd:lmsens_volt11:AVERAGE",
|
||||
"CDEF:allvalues=volt0,volt1,volt2,volt3,volt4,volt5,volt6,volt7,volt8,volt9,volt10,volt11,+,+,+,+,+,+,+,+,+,+,+",
|
||||
$cdef_allvalues_volt,
|
||||
@CDEF,
|
||||
@tmpz);
|
||||
$err = RRDs::error;
|
||||
|
@ -1090,6 +1092,7 @@ sub lmsens_cgi {
|
|||
push(@tmp, "COMMENT: \\n");
|
||||
push(@tmp, "COMMENT: \\n");
|
||||
}
|
||||
my $cdef_allvalues_cpu = $gap_on_all_nan ? "CDEF:allvalues=mb0,UN,0,1,IF,mb1,UN,0,1,IF,cpu0,UN,0,1,IF,cpu1,UN,0,1,IF,cpu2,UN,0,1,IF,cpu3,UN,0,1,IF,+,+,+,+,+,0,GT,1,UNKN,IF" : "CDEF:allvalues=mb0,mb1,cpu0,cpu1,cpu2,cpu3,+,+,+,+,+";
|
||||
$pic = $rrd{$version}->("$IMG_DIR" . "$IMG3",
|
||||
"--title=$config->{graphs}->{_lmsens3} ($tf->{nwhen}$tf->{twhen})",
|
||||
"--start=-$tf->{nwhen}$tf->{twhen}",
|
||||
|
@ -1109,7 +1112,7 @@ sub lmsens_cgi {
|
|||
"DEF:cpu1=$rrd:lmsens_cpu1:AVERAGE",
|
||||
"DEF:cpu2=$rrd:lmsens_cpu2:AVERAGE",
|
||||
"DEF:cpu3=$rrd:lmsens_cpu3:AVERAGE",
|
||||
"CDEF:allvalues=mb0,mb1,cpu0,cpu1,cpu2,cpu3,+,+,+,+,+",
|
||||
$cdef_allvalues_cpu,
|
||||
@CDEF,
|
||||
"COMMENT: \\n",
|
||||
@tmp);
|
||||
|
@ -1137,7 +1140,7 @@ sub lmsens_cgi {
|
|||
"DEF:cpu1=$rrd:lmsens_cpu1:AVERAGE",
|
||||
"DEF:cpu2=$rrd:lmsens_cpu2:AVERAGE",
|
||||
"DEF:cpu3=$rrd:lmsens_cpu3:AVERAGE",
|
||||
"CDEF:allvalues=mb0,mb1,cpu0,cpu1,cpu2,cpu3,+,+,+,+,+",
|
||||
$cdef_allvalues_cpu,
|
||||
@CDEF,
|
||||
@tmpz);
|
||||
$err = RRDs::error;
|
||||
|
@ -1229,6 +1232,7 @@ sub lmsens_cgi {
|
|||
push(@tmp, "COMMENT: \\n");
|
||||
push(@tmp, "COMMENT: \\n");
|
||||
}
|
||||
my $cdef_allvalues_fan = $gap_on_all_nan ? "CDEF:allvalues=fan0,UN,0,1,IF,fan1,UN,0,1,IF,fan2,UN,0,1,IF,fan3,UN,0,1,IF,fan4,UN,0,1,IF,fan5,UN,0,1,IF,fan6,UN,0,1,IF,fan7,UN,0,1,IF,fan8,UN,0,1,IF,+,+,+,+,+,+,+,+,0,GT,1,UNKN,IF" : "CDEF:allvalues=fan0,fan1,fan2,fan3,fan4,fan5,fan6,fan7,fan8,+,+,+,+,+,+,+,+";
|
||||
$pic = $rrd{$version}->("$IMG_DIR" . "$IMG4",
|
||||
"--title=$config->{graphs}->{_lmsens4} ($tf->{nwhen}$tf->{twhen})",
|
||||
"--start=-$tf->{nwhen}$tf->{twhen}",
|
||||
|
@ -1251,7 +1255,7 @@ sub lmsens_cgi {
|
|||
"DEF:fan6=$rrd:lmsens_fan6:AVERAGE",
|
||||
"DEF:fan7=$rrd:lmsens_fan7:AVERAGE",
|
||||
"DEF:fan8=$rrd:lmsens_fan8:AVERAGE",
|
||||
"CDEF:allvalues=fan0,fan1,fan2,fan3,fan4,fan5,fan6,fan7,fan8,+,+,+,+,+,+,+,+",
|
||||
$cdef_allvalues_fan,
|
||||
@CDEF,
|
||||
"COMMENT: \\n",
|
||||
@tmp);
|
||||
|
@ -1282,7 +1286,7 @@ sub lmsens_cgi {
|
|||
"DEF:fan6=$rrd:lmsens_fan6:AVERAGE",
|
||||
"DEF:fan7=$rrd:lmsens_fan7:AVERAGE",
|
||||
"DEF:fan8=$rrd:lmsens_fan8:AVERAGE",
|
||||
"CDEF:allvalues=fan0,fan1,fan2,fan3,fan4,fan5,fan6,fan7,fan8,+,+,+,+,+,+,+,+",
|
||||
$cdef_allvalues_fan,
|
||||
@CDEF,
|
||||
@tmpz);
|
||||
$err = RRDs::error;
|
||||
|
@ -1386,6 +1390,7 @@ sub lmsens_cgi {
|
|||
push(@tmp, "COMMENT: \\n");
|
||||
push(@tmp, "COMMENT: \\n");
|
||||
}
|
||||
my $cdef_allvalues_gpu = $gap_on_all_nan ? "CDEF:allvalues=gpu0,UN,0,1,IF,gpu1,UN,0,1,IF,gpu2,UN,0,1,IF,gpu3,UN,0,1,IF,gpu4,UN,0,1,IF,gpu5,UN,0,1,IF,gpu6,UN,0,1,IF,gpu7,UN,0,1,IF,gpu8,UN,0,1,IF,+,+,+,+,+,+,+,+,0,GT,1,UNKN,IF" : "CDEF:allvalues=gpu0,gpu1,gpu2,gpu3,gpu4,gpu5,gpu6,gpu7,gpu8,+,+,+,+,+,+,+,+";
|
||||
$pic = $rrd{$version}->("$IMG_DIR" . "$IMG5",
|
||||
"--title=$config->{graphs}->{_lmsens5} ($tf->{nwhen}$tf->{twhen})
|
||||
",
|
||||
|
@ -1409,7 +1414,7 @@ sub lmsens_cgi {
|
|||
"DEF:gpu6=$rrd:lmsens_gpu6:AVERAGE",
|
||||
"DEF:gpu7=$rrd:lmsens_gpu7:AVERAGE",
|
||||
"DEF:gpu8=$rrd:lmsens_gpu8:AVERAGE",
|
||||
"CDEF:allvalues=gpu0,gpu1,gpu2,gpu3,gpu4,gpu5,gpu6,gpu7,gpu8,+,+,+,+,+,+,+,+",
|
||||
$cdef_allvalues_gpu,
|
||||
@CDEF,
|
||||
"COMMENT: \\n",
|
||||
@tmp);
|
||||
|
@ -1440,7 +1445,7 @@ sub lmsens_cgi {
|
|||
"DEF:gpu6=$rrd:lmsens_gpu6:AVERAGE",
|
||||
"DEF:gpu7=$rrd:lmsens_gpu7:AVERAGE",
|
||||
"DEF:gpu8=$rrd:lmsens_gpu8:AVERAGE",
|
||||
"CDEF:allvalues=gpu0,gpu1,gpu2,gpu3,gpu4,gpu5,gpu6,gpu7,gpu8,+,+,+,+,+,+,+,+",
|
||||
$cdef_allvalues_gpu,
|
||||
@CDEF,
|
||||
@tmpz);
|
||||
$err = RRDs::error;
|
||||
|
|
|
@ -1420,6 +1420,13 @@ This option, when enabled via \fIy\fP, shows \fInan\fP values for missing data i
|
|||
.P
|
||||
Default value: \fIn\fP
|
||||
.RE
|
||||
.P
|
||||
.BI gap_on_all_nan
|
||||
.RS
|
||||
This option, when enabled via \fIy\fP, combined with the \fIshow_gaps\fP option shows gaps only if all data points are \fInan\fP instead of requiring only one to be \fInan\fP for a gap. This can be useful if not all sensor data are required for normal operation.
|
||||
.P
|
||||
Default value: \fIn\fP
|
||||
.RE
|
||||
.SS Generic sensors statistics (gensens.pm)
|
||||
This graph helps to monitor up to three (so far) different sensors: temperatures, CPU frequencies and battery status which, depending of your machine, they should appear in the \fI/sys\fP directory.
|
||||
.P
|
||||
|
|
Loading…
Reference in New Issue