Fixed naming scheme

The naming scheme of some graphs are tricky in the way that they not sufixed
by a single numeric digit, but a double with padding (mostly a zero). This
commit fixes the numeric scheme of 'fs' and 'net' graphs, in the event of
when the user selects all graphs of all remote servers.

Still there might be possible that some graph does not appear because the
master server has a different configuration that the remote servers.

#216
This commit is contained in:
Jordi Sanfeliu 2019-01-08 17:10:59 +01:00
parent e4a90c5b18
commit fa6c341336
1 changed files with 6 additions and 2 deletions

View File

@ -111,11 +111,15 @@ sub multihost {
}
print " </tr>\n";
}
print " <tr>\n";
for(my $sg = 1; $config{graphs}->{"_$gn$sg"}; $sg++) {
my $sgd = $sg;
if($gn eq "fs" || $gn eq "net") {
$sgd = sprintf("%02d", $sg);
}
print " <tr>\n";
for($n = 0; $n < scalar(@host); $n++) {
print " <td bgcolor='$colors->{title_bg_color}' style='vertical-align: top; height: 10%; width: 10%;'>\n";
print " <iframe src='" . $url[$n] . "/monitorix.cgi?mode=localhost&when=$cgi->{when}&graph=_${gn}$sg&color=$cgi->{color}&silent=imagetag' height=201 width=397 frameborder=0 marginwidth=0 marginheight=0 scrolling=no></iframe>\n";
print " <iframe src='" . $url[$n] . "/monitorix.cgi?mode=localhost&when=$cgi->{when}&graph=_${gn}$sgd&color=$cgi->{color}&silent=imagetag' height=201 width=397 frameborder=0 marginwidth=0 marginheight=0 scrolling=no></iframe>\n";
print " </td>\n";
}
print " </tr>\n";