completes munin

This commit is contained in:
waldek 2021-07-08 22:27:26 +02:00
parent dad1065218
commit 0a966c76ed
1 changed files with 32 additions and 8 deletions

View File

@ -22,9 +22,7 @@ When monitoring for example ten workstations or servers you will have **one** ma
![munin architecture](./assets/munin_architecture.png) ![munin architecture](./assets/munin_architecture.png)
### First installation ### The master
#### The master
First we'll install one munin **master** for everybody in the classroom. First we'll install one munin **master** for everybody in the classroom.
The installation documentation on the official [website](http://guide.munin-monitoring.org/en/latest/installation/install.html) is very good so we'll follow that one. The installation documentation on the official [website](http://guide.munin-monitoring.org/en/latest/installation/install.html) is very good so we'll follow that one.
@ -34,7 +32,7 @@ The overall processes has three components.
2. configure the master to query some future nodes 2. configure the master to query some future nodes
3. install a web server to serve the monitor pages 3. install a web server to serve the monitor pages
##### Installing #### Installing
Installing can be done through the Debian package manager. Installing can be done through the Debian package manager.
Do a `tab-complete` to see all available packages and note that on the **master** you need the `munin` package. Do a `tab-complete` to see all available packages and note that on the **master** you need the `munin` package.
@ -55,7 +53,7 @@ Why does the master also install the node?
Well, just so it can monitor itself and display it in the web gui. Well, just so it can monitor itself and display it in the web gui.
This gives you already a good idea of what will need to be installed and configured on the nodes. This gives you already a good idea of what will need to be installed and configured on the nodes.
##### Configuring #### Configuring
The main configuration file for munin is located at `/etc/munin/munin.conf`. The main configuration file for munin is located at `/etc/munin/munin.conf`.
Open up your favorite text editor and browse through it. Open up your favorite text editor and browse through it.
@ -88,7 +86,7 @@ On my demonstration server the configuration is as follows.
For now we'll just leave it as is and move on to installing the web server. For now we'll just leave it as is and move on to installing the web server.
##### The web server #### The web server
Here you have a choice to make but any way you go, you can't really go wrong. Here you have a choice to make but any way you go, you can't really go wrong.
My web server of choice is often `nginx` and we'll install that one together because I'm most comfortable with it. My web server of choice is often `nginx` and we'll install that one together because I'm most comfortable with it.
@ -165,7 +163,7 @@ Web servers are an essential part of any Linux system administrator's life.
**Can you figure out how to password protect this folder so it behaves like my munin server?** **Can you figure out how to password protect this folder so it behaves like my munin server?**
#### The first node ### The first node
Let's add some nodes! Let's add some nodes!
The nodes have to be in the same network in order to be contactable by the master. The nodes have to be in the same network in order to be contactable by the master.
@ -190,7 +188,33 @@ By default the node only accepts incoming connections from the localhost.
We can add as many **masters** as we like to this list but we must respect the regex syntax. We can add as many **masters** as we like to this list but we must respect the regex syntax.
I'll leave that up to you to figure out. I'll leave that up to you to figure out.
#### Plugins
## Hints Munin works with [plugins](https://guide.munin-monitoring.org/en/latest/plugin/use.html#plugin-use) to supply the master with data to plot.
You can install extra plugins or even write your own in [bash](https://guide.munin-monitoring.org/en/latest/develop/plugins/howto-write-plugins.html#howto-write-plugins) or in [python](https://aouyar.github.io/PyMunin/).
To have your node auto detect which plugins should be used you can execute the following command as root (not sudo).
```
munin-node-configure --shell --families=contrib,auto | sh -x
```
## Other operating systems
Because the munin server client model is so basic you can find node software for most operating systems.
I've run it successfully on [freeNAS](https://www.truenas.com/community/threads/install-munin-node.79224/#post-549934) but you can try a [windows](https://github.com/munin-monitoring/munin-node-win32) node as well.
## Alternatives
There are quite a few alternatives out there to choose from.
One of the better known is [nagios](https://www.nagios.org/) which can be installed on Debian as well.
There are ways to have munin and nagios work together that are described [here](https://guide.munin-monitoring.org/en/latest/tutorial/nagios.html?highlight=nagios).
## Notes and hints
You might feel munin is too simple or basic because it does not offer any tweaking via it's web GUI but that's the main reason why I *like* and use it so much.
Because it's so simple, it's not a real security risk.
I would however **not** expose a master to the internet without **SSL** and a good **htpasswd**.
There are some known exploits in the CGI part of munin.
* the Debian system administrator handbook has a good [section](https://debian-handbook.info/browse/stable/sect.monitoring.html#sect.munin) on munin
* if your dynamic zoom is not working have a look [here](https://serverfault.com/questions/615048/munin-dynamic-graph-zoom-dynazoom-not-working-nginx-php-fpm) * if your dynamic zoom is not working have a look [here](https://serverfault.com/questions/615048/munin-dynamic-graph-zoom-dynazoom-not-working-nginx-php-fpm)