Munin is programmed in Perl, which can be installed on most operating systems. In addition, it needs some perl modules, which you can fetch from CPAN.
However, the "plugins" used by the client are often OS or application spesific. E.g., many of the Linux-plugins use /proc to gather the data. There are some plugins that should work on most architectures. The architectures which have their own plugins as well, are
dbdir /var/lib/munin htmldir /var/www/munin logdir /var/log/munin rundir /var/run/munin [bing.foo.bar] address 10.232.33.259The server will expand the node to contain all the services it offers.
The cdef is fed to "rrdtool graph", so the man-page for "rrdgraph" should give you a bit more info. I'll try to explain it briefly here, though;
The cdef is defined using Reverse Polish Notation (RPN), which means that you would say "4,5,+" instead of "4+5". When you create a cdef-field, be sure to use the fieldname at least once in the definition, or rrdgraph will croak with an error.
For a more thorough definition of RPN, take a look at the man-page for "rrdgraph".
You can modify a graph with two data fields to a percentage view with the following cdef (gotten from Nicolai Langfeldt). It uses two field names, "hit" and "all", with "hit" being the field you want in percentages of "all".
hit,all,1,all,0,EQ,IF,/,100,*,UNKN,all,0,EQ,IF,UNKN,all,UNKN,EQ,IF
Normally, graph_order looks something like this:
graph_order apps buffers cache unused swapIt can, however, be used to define alises from other graphs. E.g. if you want to incorporate the number of http-connections in the "processes"-graph (i.e. together with the number of processes on the machine), you'd say:
graph_order processes connections=port_http.countThis would first draw the "proesses" data-source (as normal), then draw the "count" data-source from the "port_http"-graph. "connections" would then be a field-name in the same way as "processes", so you could give it a cdef, draw, negative, etc.
Example graph_orders:
graph_order bing bofh
(will draw two normal values)graph_order bing bang=bing
(will draw two normal
values, the second an alias to the first)graph_order bing bang=graph.bing
("loan" a data-source from
another graph)
graph_order bing bang=host:graph.bing
("loan" a
data-source from another host's graph)graph_order bing bang=domain;host:graph.bing
("loan" a
data-source from another domain's graph)The format of "special_stack" is the same as the graph_order-arguments above. You cannot, however, specify extra arguments for the fields. If you want to specify a cdef for the 'whole stack', you can use the fieldname defining the special stack. E.g.
[some.machine.boo] total_mail.graph_order total_received total_mail.graph_title Mail received by machine1 and machine2 total_mail.graph_vlabel mails/min total_mail.total_received.label not_used total_mail.total_received.stack \ machine1=machine1.your.dom:exim_mailstats.received \ machine2=machine2.your.dom:exim_mailstats.received total_mail.total_received.cdef total_received,60,*
Same as special_stack, with one exception: drop the "alias"-bit in the field definition. I.e., the above would become:
[some.machine.boo] total_mail.graph_order total_received total_mail.graph_title Mail received by machine1 and machine2 total_mail.graph_vlabel mails/min total_mail.total_received.label mails per minute # Now used total_mail.total_received.sum \ machine1.your.dom:exim_mailstats:received \ machine2.your.dom:exim_mailstats:received total_mail.total_received.cdef total_received,60,*
Yes, use the "domain_order" option at the topmost level. To specify that you want the topmost level, either put the option before any host/domain definitions, or reset the host/domain definition with "[]".
[] domain_order foo.bar goo.bar alpha.barThe default domain order is alphabetically.
Yes, use the "node_order" option under a domain. To specify that we want to modify a variable under the domain, supply an empty host:
[bing.foo.bar] address 10.232.33.259 [fii.foo.bar] address 10.232.33.259 [goo.foo.bar] address 10.232.33.259 [foo.bar;] node_order fii.foo.bar bing.foo.bar goo.foo.barThe default node order is alphabetically.
You have to configure the node thusly:
[ssh-node] address 127.0.0.1 port 5050
Then use ssh to establish the tunnel:
ssh -L 5050:localhost:4949 -f -N -i keyfile user@ssh-node
This will establish a tunnel between TCP ports 5050 on the calling machine to 4949 on the called machine. It will also send ssh in the background after possibly asking for a passphrase, a password or something like that. Since we are using a key made for this purpose, we have to specify that file with this key.
You should protect against misuse of ssh by creating a special key (and possibly also a special user). On the node, put something like this in ~user/.ssh/authorized_keys:
from="192.168.1.35",command="/bin/false",no-pty,no-X11-forwarding,no-agent-forwarding,no-port-forwarding,permitopen="localhost:4949"
ssh-dss AAAAB3......
Thus, we are restricting the key to a forced command "/bin/false" that is run independent of the request from the calling side. We are also restricting a few options:
from="192.168.1.35"
command="/bin/false"
no-pty
no-X11-forwarding
no-agent-forwarding
no-port-forwarding
permitopen="localhost:4949"
This FAQ entry was developed by Lupe Christoph, with the help of Jim Cheetham.
For interface eth0 on host foo.bar.example,
if_eth0.graph no my_ifeth0.graph_args --base 1000 --lower-limit 0 my_ifeth0.graph_title Traffic on interface eth0 my_ifeth0.graph_order received=foo.bar.example:if_eth0.down sent=foo.bar.example:if_eth0.up my_ifeth0.graph_vlabel Bits per second my_ifeth0.received.cdef received,8,* my_ifeth0.received.draw AREA my_ifeth0.sent.cdef sent,8,* my_ifeth0.sent.draw LINE1(Answer supplied by Jacques Caruso.)
The graph_sums option require that rrdtool version 1.0.39 or above is installed.
#!/bin/sh if [ "$1" = "config" ]; then echo "load.label load" # Field label (legend) # These are not really nedded, but makes the graph prettier. echo "graph_title Load average" # Set main title echo 'graph_args -l 0' # Y-axis starts at 0 echo 'graph_scale no' # Say 0.04 load, not 40 milliload echo 'graph_vlabel load' # Y-axis label exit 0 fi # The real data-gathering printf "load.value " cut -f1 -d' ' < /proc/loadavg
Yes, you can create a file in the plugin configuration directory (client-conf.d). The file should contain the username and group to run the plugin as. E.g., on linux, the exim_mailqueue-plugin need access to the exim mail spool (to count the messages in the queue). It needs "mail" group permissions to do this, so the "exim_mailqueue.auth" contents look like:
[exim_mailqueue] group mailSimilarly, you could use the "user" option to run the plugin as a user.
If more than one group is needed, or some of the groups only exist on certain hosts (and you want a common config file), the syntax supports this:
[some_plugin] group mail,adm,group1,group2,(group3_that_might_not_exist)