Monday, November 28, 2011

Troubleshooting Munin Plugins

A few things to try when the Munin plugin, that you just installed, doesn’t work.  Examples below involve the ejabberd plugin from the Munin Exchange.

1) Try running the plugin from the command line. It should look something like:  

root@uranus:~# /etc/munin/plugins/ejabberd_connections
s2s_connections_out.value 0
s2s_connections_in.value 0
root@uranus:~#

If it spits up an error, you likely have a scripting error.  Take a look at the code.

2) Try telnetting to port 4949 of the Munin box and fetching the data. If it runs properly, it should look something like:

root@uranus:~# telnet localhost 4949
Trying ::1…
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
# munin node at uranus.joat
fetch ejabberd_connections
s2s_connections_out.value 0
s2s_connections_in.value 0
.
quit
Connection closed by foreign host.
root@uranus:~#

Note: In the above, you type in “telnet localhost 4949”, “fetch ejabberd_connections”, and “quit”.  If it doesn’t run properly, you’ll probably get a “Bad Exit” error. This means that something isn’t configured correctly or something isn’t where the script is looking for it. Take a look at the code.  Hopefully the author put comments in the script, explaining what's needed.

3) You might also try “munin-run ejabberd_connections”. Sometimes it’ll return a line number for where (or near where) the script is failing.  Again, you'll need to look at the code.

For info, the eJabberd plugin that was giving me fits (above) wasn’t working because I hadn’t made an env.vhosts entry, under [ejabberd*] in /etc/munin/plugin-conf/munin-node.