4

I'm having a problem in one of my servers, where munin is not able to write the text that accompanies each graph correctly. It is written as random squares, but I haven't found anything in the logs that could point me to the problem.

munin corrupted graph

Anyone had a similar problem? Thanks in advance, Simon.

UPDATE

I've found some lines in /var/mail/root regarding some problem with pango:

Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='latin'
Simon
  • 855
  • 2
  • 12
  • 22
  • This is typically due to the font being used not able to represent the glyph (character) that should be shown; however it's strange that everything becomes the box symbol. Maybe the font munin wants to use is not available at all. – wurtel Dec 10 '14 at 12:33
  • FYI: on my munin server, `DejaVuSansMono.ttf` and `DejaVuSans.ttf` are used. – wurtel Dec 10 '14 at 12:46
  • Thanks wurtel, but I have those fonts installed in my system. Just a question, where do you look for the font that munin uses? – Simon Dec 10 '14 at 15:07
  • I use Debian, and I checked the dependencies of munin and rrdtool (which contains rrdgraph that munin uses to draw the graphs). Then I checked the access times of the font files contained in the dependencies. They're also listed in `GraphOld.pm` which is the perl module that does the actual graphing. – wurtel Dec 11 '14 at 07:53
  • Ty wurtel, same fonts here, and installed :/. Thx anyway! – Simon Dec 11 '14 at 10:08
  • Is the system locale set correctly (`/etc/locale-gen` on Archlinux, may be different on your distro) ? Try running `locale-gen` to regenerate locale files and see if that solves the issue (you may need to reboot). –  Dec 14 '14 at 03:24
  • This could be a problem with rrdtool. Did you try updating or reinstalling rrdtool? – Mehmet Dec 14 '14 at 16:34
  • Yes, everything is ok. Just in case, I ran locale-gen and rebooted without success. Thanks anyway André. – Simon Dec 14 '14 at 17:26
  • Yes Mehmet, I've tried to purge munin and the rrd packages without success :(. – Simon Dec 14 '14 at 17:36
  • The same problem with rrd graphs is mentioned [here](https://bbs.archlinux.org/viewtopic.php?id=100416) with similar pictures, but you already covered the mono font possibility in previous comments, so not sure but might help. – Mehmet Dec 14 '14 at 22:54
  • Have you tried altering the fonts that munin/rrdtool are using to render the graphs - even taking into account that you do have the defaults installed locally? – BE77Y Dec 15 '14 at 15:39
  • I have the local fonts installed (ttf-dejavu, -core, -extras). I've thought about that but I don't really know where to change fonts. Any help will be appreciated ;). – Simon Dec 15 '14 at 20:23
  • If you run rrdtool by hand, do you have the same problem? – Sobrique Dec 18 '14 at 18:11
  • Also: When you installed rrdtool, did you do so from package or from source? This sort of thing _can_ occur with some of the (numerous) dependencies to RRDTool being broken. – Sobrique Dec 18 '14 at 18:23

2 Answers2

1

This could either be a problem with rrd, or a munin plugin. Check the munin-graph.log and see if you have anything like this;

[RRD ERROR] Unable to graph <filename> : failed to load : failed to load $libdir/Some_Font_File.ttf

Another possibility is that munin is not able to read the font files in question (eg: the owner, group, or permissions are "wrong"), or there's a plugin interfering with the rendering.

Depending on the version of munin you're running, there should be a munin-check command that will fix various permissions (please read the man page before using, there's at least one caveat)

EDIT: This could also be an encoding problem. There's a bug where munin assumes everything is going to be in ISO-8859-1. A fix-request was filed and munin 1.3 and higher should use Encode::Guess now (details).

EDIT #2: Thanks to the additional comments, we now know two important things;

1) Software versions involved are

  • Ubuntu 12 LTS
  • munin: 1.4.6-3ubuntu3.4
  • rrdtool: 1.4.7-1

2) There are multiple servers w/ this configuration, and only one is broken.

Therefore, there is probably a slight difference in the shell environment settings between two of the servers (the "broken" server versus a "known-good" server).

Compare the Shell Environments on "broken" server & a "known-good" server

1) Login to the user-account the graphs are being generated with

2) Run env | sort > ~/shell_environment-User_Name-Server_Name.txt

(Replace "User_Name" and "Server_Name" with the actual names involved.)

3) Copy both shell_environment-*.txt files to a single place and compare them.

There's probably a variable (maybe $LANG) that's different and breaking the rendering.

Signal15
  • 943
  • 7
  • 27
  • Unfortunately, there is nothing in the graph log related with fonts. I've passed munin-check and fixed some perms suggestions, but it stays the same. Thanks anyway for the effort Signal15. – Simon Dec 16 '14 at 23:55
  • @simon Could be an encoding problem (Added to the answer). What version of RRD & munin are you running? – Signal15 Dec 17 '14 at 17:49
  • They are the defaults packages in Ubuntu 12 LTS, munin: 1.4.6-3ubuntu3.4, rrdtool: 1.4.7-1... The things is that I have other different servers with the same OS and the same munin installation and everything works. The problem is just with this one. Thx for trying! – Simon Dec 17 '14 at 23:49
  • @Simon In that case, I would find out what user-account the graphs are being generated with, `su -` to that user, then run `env | sort > ~/shell_environment.txt` on the Broken Server and a Working Server. There's probably a variable (maybe `$LANG`) that's different and breaking the rendering. – Signal15 Dec 18 '14 at 17:27
  • No luck. Both envs have the same lang defined (LANG=es_ES.UTF-8). These are the differences: http://pastebin.com/jnsaFzbk. The only thing noticeable is that the env command in the server with the bad munin, env wasn't in the path of my regular user (I need to run it from its absolute path /usr/bin/env). – Simon Dec 19 '14 at 07:25
  • just for giggles, change it to `en_US.UTF-8` or just `en_ES` and see if that clears it up. – Signal15 Dec 19 '14 at 14:10
  • done with reboot, no luck :( – Simon Dec 20 '14 at 06:24
  • I've just found some log lines in /var/mail/root with pango and fonts problems: Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='latin'. I'm gonna investigate it... – Simon Dec 20 '14 at 07:35
  • @simon if you find the root-cause to the problem , feel free to post an "Answer" and mark it as accepted. Good luck! – Signal15 Dec 20 '14 at 07:39
0

On alpine I ran apk add ttf-opensans and su-exec munin:root munin-cron

You can see that it is starting to work as graphs refresh

Graphs