Closed mariotaku closed 8 years ago
According to the RRDtool documentation http://oss.oetiker.ch/rrdtool/doc/rrdgraph.en.html, the option --imgformat
accepts the following graphical formats:
[-a|--imgformat PNG|SVG|EPS|PDF]
Problem here is that Monitorix has the graphical format PNG hard-coded in every single module. I'll try to find enough time to remedy this situation with a new option from the configuration file where will let you specify the final image format.
Stay tuned, please. Thanks.
Thanks. here's a working patch for current version on APT repo:
#!/bin/sh
cd /usr/lib/monitorix
if [ $(which apt-get) ]; then
apt-get install -y patchutils
elif [ $(which yum) ]; then
yum -y install patch
fi
patch <<EOF
--- HTTPServer.pm 2015-11-13 12:51:36.000000000 +0000
+++ HTTPServer.pm.patched 2016-01-12 16:06:22.298993411 +0000
@@ -129,6 +129,8 @@
print "Content-Type: text/html; charset=UTF-8\r\n";
} elsif(\$mimetype eq "css") {
print "Content-Type: text/css; charset=UTF-8\r\n";
+ } elsif(\$mimetype eq "svg") {
+ print "Content-Type: image/svg+xml\r\n";
} else {
print "Content-Type: image/\$mimetype;\r\n";
}
EOF
# Replaces all png to svg
grep -rl png . | xargs sed -i "s/png/svg/g"
grep -rl PNG . | xargs sed -i "s/PNG/SVG/g"
service monitorix restart
After applying the modifications to create SVG images, I've seen that zoomed images are not correctly fit in the pop-up window. This is due because RRDs::graphv function does not return correctly the size of the zoomed image with SVG format.
Are you experiencing the same behavior for the zoomed images?
I'm using RRDtool version 1.3.8, perhaps newer versions are returning correct values. Please, let me know.
Yes, I also encountered this problem. Other images are OK.
Jordi Sanfeliu notifications@github.com于2016年1月25日周一 下午7:56写道:
After applying the modifications to create SGV images, I've seen that zoomed images are not correctly fit in the pop-up window. This is due because RRDs::graphv function does not return correctly the size of the zoomed image with SGV format.
Are you experiencing the same behavior for the zoomed images?
I'm using RRDtool version 1.3.8, perhaps newer versions are returning correct values. Please, let me know.
— Reply to this email directly or view it on GitHub https://github.com/mikaku/Monitorix/issues/132#issuecomment-174484173.
I have also tested it under RRDtool version 1.4.8 and I got the same bad results. :(
I've added the new option image_format
which has by default the value PNG
. Such option accepts only the values PNG
and SVG
. It should work as expected except the problem with the zoomed graphs.
Please, download all the .pm
files, the monitorix.cgi
file and update your monitorix.conf
to reflect such new option. And let me know how it works.
Thanks.
works on Debian 8. (though zoomed image is a little buggy)
Yeah, zoomed image won't fit in the pop-up window because it's using the <iframe>
tag.
I think we can close this.
First of all, thank you for such an amazing tool!
I wonder if there could be an option to change imgformat for graphs, like jpg, or svg. Thanks a lot!