Find a file
Lars Kruse 7b4f376daf Fix fetching data for interfaces with a dash in the name
munin-node passes the original interface name (as extracted from
/proc/net/dev) to if_* and if_err_*. Thus replacing dash with underscore
results in interfaces not being found anymore.

Source: patch "220-modify-ifname-parser" from OpenWrt
Author: Martin Blumenstingl
2019-07-19 06:01:08 +02:00
doc More fixes to the floppyfw howto 2007-06-15 09:36:53 +00:00
examples Added post-boot script for floppyfw 2007-06-15 09:36:16 +00:00
plugins Fix fetching data for interfaces with a dash in the name 2019-07-19 06:01:08 +02:00
.svnignore Ignore releases as well 2007-06-13 12:41:52 +00:00
Changelog git-svn-id: svn://svn.code.sf.net/p/muninlite/code/muninlite@35 35caa317-6b62-4e8a-81c0-b04f0c356266 2011-01-27 10:07:07 +00:00
CREDITS Forgot these 2011-01-14 20:39:50 +00:00
LICENSE Import 2007-06-11 15:45:16 +00:00
Makefile Ignore .svn in release 2011-01-27 10:11:08 +00:00
munin-node.conf Forget the previous change 2011-01-27 10:03:27 +00:00
munin-node.in Fix error messages on server regarding recognition bridge interfaces 2019-07-19 05:59:49 +02:00
README Import 2007-06-11 15:45:16 +00:00
TODO Import 2007-06-11 15:45:16 +00:00
VERSION Release VERSION 1.0.4 2011-01-27 10:06:30 +00:00

README for MuninLite
====================

MuninLite is a single Bourne Shell script that implements the Munin
protocoll as well as some Linux specific plugins. The motivation for
developing MuninLite was to provide a simple Munin Node, using inetd
on systems without a full featured Perl and/or bash or a busybox
system. 

MuninLite is Copyright (C) 2007 Rune Nordbøe Skillingstad
<rune@skillingstad.no> and released under GPLv2 (see LICENSE file)

Features
--------
MuninLite implements the following plugins:
* df 
* cpu 
* if_ 
* if_err_ 
* load 
* memory
* processes
* swap
* netstat
* uptime
* interrupts
* irqstats

Included files
--------------
Changelog     			Changelog 
CREDITS	      			Credits to contributors
LICENSE				GPLv2 License
Makefile			Rules to make munin-node
README				This file
TODO				Things to do in future releases
VERSION				Current version
munin-node.in			The MuninLite script skeleton
examples/xinetd.d/munin 	Sample xinetd configuration
examples/inetd.conf		Sample inetd.conf configuration
examples/inetd.busybox		Sample inetd.conf configuration for busybox
examples/hosts.deny		Sample hosts.deny configuration
examples/hosts.allow		Sample hosts.allow configuration
plugins/cpu			CPU usage plugin
plugins/df			Filesystem usage plugin
plugins/if_			Network interface traffic plugin
plugins/if_err_			Network interface errors plugin
plugins/interrupts		Interrupts & context switches plugin
plugins/irqstats		Individual interrupts plugin
plugins/load			Load average plugin
plugins/memory			Memory usage plugin
plugins/netstat			Netstat plugin
plugins/processes		Number of Processes plugin
plugins/swap			Swap in/out plugin
plugins/uptime			Uptime plugin

Build requirements
------------------
Make	     (Not sure what requirements)
Perl         (even very old versions should work)

Requirements
------------
Bourne Shell (ash or dash should be sufficient)
grep   	     (simple grep in busybox is sufficient)
sed	     (simple sed in busybox is sufficient -- but a bit strange...)
cut	     (cut in busybox is sufficient)
wc	     (wc in busybox is sufficient)
xargs	     (xargs in busybox is sufficient)
inetd	     (inetd in busybox is sufficient)

Installation
------------
Download source and unpack it.
Edit Makefile to suit your choice of plugins

Make munin-node by running "make"
  # make
  Making munin-node for muninlite version 0.9.14
  Adding plugin df
  Adding plugin cpu
  Adding plugin if_
  Adding plugin if_err_
  Adding plugin load
  Adding plugin memory
  Adding plugin processes
  Adding plugin swap
  Adding plugin netstat
  Adding plugin uptime
  Adding plugin interrupts
  Adding plugin irqstats

Copy munin-node to a suitable location (/usr/local/bin/) and make it
executable (there will be a "make install" at a later release)

  # cp munin-node /usr/local/bin
  # chmod +x /usr/local/bin/munin-node

Add munin port to /etc/services

  # echo "munin           4949/tcp        lrrd            # Munin" >>/etc/services

Configure inetd or xinetd to fork this script for request on the
munin port (4949). 

Sample configuration for xinetd is located in examples/xinetd.d/munin

  # cp examples/xinetd.d/munin /etc/xinetd.d 
  # killall -HUP xinetd

Sample configuration for inetd is located in examples/inetd.conf

  # cat examples/inetd.conf >> /etc/inetd.conf
  # killall -HUP inetd

Restrict access to munin port using hosts.allow and
hosts.deny or add a rule to your favorite firewall config.
Examples of hosts.allow/deny settings is provided in the examples
directory.

Iptables might be set with something like this:

  # iptables -A INPUT -p tcp --dport munin --source 10.42.42.25 -j ACCEPT 

Test
----
To test script, just run it (/usr/bin/local/munin-node):

  # /usr/local/bin/munin-node
  # munin node at localhost.localdomain
  help
  # Unknown command. Try list, nodes, config, fetch, version or quit
  list
  df cpu if_eth0 if_eth1 if_err_eth0 if_err_eth1 load memory
  version
  munins node on mose.medisin.ntnu.no version: 0.0.5 (munin-lite)
  quit

For inetd-test, try to telnet to munin port from allowed host.

  # telnet localhost 4949
  Trying 127.0.0.1...
  Connected to localhost.
  Escape character is '^]'.
  # munin node at localhost.localdomain
  help
  # Unknown command. Try list, nodes, config, fetch, version or quit
  list
  df cpu if_eth0 if_eth1 if_err_eth0 if_err_eth1 load memory
  version
  munins node on mose.medisin.ntnu.no version: 0.0.5 (munin-lite)
  quit
  Connection closed by foreign host.


Plugin configuration 
------------------------
To configure which plugins should be enabled, locate the PLUGINS
variable in munin-node and remove unwanted plugins.

There is no specific configuration for plugins. 

Munin configuration
-------------------
Configure your /etc/munin/munin.conf as you would for a regular
munin-node.

[some.host.tld]
    address 10.42.42.25
    use_node_name yes