Merge pull request #145 from hlovdal/patch.max_historic_years

Remove max_historic_years limitation
This commit is contained in:
Jordi Sanfeliu 2016-04-12 12:15:36 +02:00
commit 634bf308d9
2 changed files with 5 additions and 5 deletions

View File

@ -124,7 +124,7 @@ This option defines the maximum number of years of historical data in all graphs
.P
WARNING: Every time this value is extended Monitorix will resize every \fI.rrd\fP file accordingly, removing all historical data.
.P
The maximum allowed is 5.
There is no longer any upper limit for this value.
.P
Default value: \fI1\fP
.RE

View File

@ -389,6 +389,10 @@ EOF
print(OUT " <tr>\n");
}
for($n = 2; $n <= $config{max_historic_years}; $n++) {
if($n > 2 && (($n - 2) % 4) == 0) {
print(OUT " </tr>\n");
print(OUT " <tr>\n");
}
print(OUT <<EOF);
<td bgcolor="$title_back_color">
<input type="radio" name="when" value="${n}year">
@ -640,10 +644,6 @@ if(!$config{max_historic_years}) {
logger("WARNING: the 'max_historic_years' option doesn't exist. Please consider upgrading your configuration file.");
$config{max_historic_years} = 1;
}
if($config{max_historic_years} > 5) {
logger("WARNING: the 'max_historic_years' option exceeds the maximum years permitted (5).");
exit(0);
}
if(!$config{image_format}) {
logger("WARNING: the 'image_format' option is not valid or doesn't exist. Please consider upgrading your configuration file.");
# it's set in 'monitorix.cgi'