Wednesday, July 21, 2010

Understanding Munin's Protocol

Along this tutorial, you will create and install plugins, add nodes, virtual nodes... It is really important for troubleshooting and debugging that you understand how munin communicates with the nodes - so we are going to play with telnet a little bit here. Open a shell on a machine which is allowed to connect to the munin-node; for our example I will take ServerA (the node) and serverX (the server allowed to access the node). The default port of munin is the 4949.


ServerX $ telnet aaa.aaa.aaa.aaa 4949
Trying aaa.aaa.aaa.aaa...
Connected to ServerA.
Escape character is '^]'.
# munin node at ServerA


As there is no help command, just enter something and hit enter to get a list of the commands available:


?
# Unknown command. Try list, nodes, config, fetch, version or quit

Let's start with the list command: as you can guess, it lists all the "services" presented by the node (your output may differ a little bit).


list
open_inodes if_err_eth0 irqstats entropy if_eth0 processes postfix_mailqueue acpi netstat interrupts swap load df_inode if_err_eth1 if_eth1 postfix_mailvolume iostat open_files forks memory vmstat


This list actually depend on what you have installed; if you have a mysql server installed, you will see mysql-related services in the list. The two commands config and fetch take a service as argument. Let's have a look at our swap:


config swap  
graph_title Swap in/out
graph_args -l 0 --base 1000
graph_vlabel pages per ${graph_period} in (-) / out (+)
graph_category system
swap_in.label swap
swap_in.type DERIVE
swap_in.max 100000
swap_in.min 0
swap_in.graph no
swap_out.label swap
swap_out.type DERIVE
swap_out.max 100000
swap_out.min 0
swap_out.negative swap_in

.
fetch swap
swap_in.value 5
swap_out.value 8



The config command will tell our munin how to build the graph. It will give a title for the graph, a category, a legend for the axes... These variables are needed by rrdtool to build the graphs. The fetch command actually retrieves the values themselves.

The nodes command list the nodes made available by the current node; Right now we have only one node, but as one node can in theory monitor several servers or equipments, munin as introduced the concept of virtual node which we will detail later. This command is not too important for now.


nodes
ServerX
.


Finally, we have the version and the quit commands:


version
munins node on thunder version: 1.4.4

quit
Connection closed by foreign host.

Using telnet to access your munin-node is usually not useful, although it can be sometimes for debugging purposes. It has been described here to help you understand how munin and munin-node communicate together, and help you understand the whole data gathering process.

No comments:

Post a Comment