diff --git a/manuscript/CHANGELOG.md b/manuscript/CHANGELOG.md index 9245127..66a935f 100644 --- a/manuscript/CHANGELOG.md +++ b/manuscript/CHANGELOG.md @@ -6,15 +6,11 @@ Sign up [here](http://eepurl.com/dfx95n) (double-opt-in) to receive email update ## Recently added recipes +* Added [Munin](/recipies/munin/), gatherer of highly details performance stats (_21 Jun 2018_) * Added [OwnTracks](/recipies/owntracks/), personal mobile location platform (_17 Jun 2018_) * Added [NZBHydra2](/recipies/autopirate/nzbhydra2/) to [autopirate](/recipies/autopirate/start/) stack (_9 Jun 2018_) * Added a list of [sponsored projects](sponsored-projects/) which I regularly donate to, to keep the geeky ingredients fresh! (_8 Jun 2018_) * [Turtle Pool](/recipies/turtle-pool/) - A mining pool for the fun, friendly, no-BS, still-in-its-infancy cryptocurrency, "[TurtleCoin](http://turtlecoin.lol)" (_7 May 2018_) -* [Wallabag](/recipies/wallabag/) - Self-hosted Read-it-Later / Annotation app (_21 Apr 2018_) -* [InstaPy](/recipies/instapy/) - Automate your Instagrammage (_17 Apr 2018_) -* [CryptoMiner](/recipies/cryto-miner/start/) - Become a cryptocurrency miner, put your GPU to work! -* [Calibre-Web](/recipies/calibre-web/) - Plex for EBooks (_8 Jan 2018_) -* [Emby](/recipies/emby/) - Geekier alternative to Plex, with improved parental controls (_28 Dec 2017_) ## Recent improvements @@ -24,7 +20,3 @@ Sign up [here](http://eepurl.com/dfx95n) (double-opt-in) to receive email update * [Lazy Librarian](/recipies/autopirate/lazylibrarian/) component of [autopirate](/recipies/autopirate/start/) recipe updated to include calibre-server, so that downloaded ebooks can be automatically added to a calibre library, to then be independently managed using [Calibre-Web](/recipies/calibre-web/) (_27 May 2018_) * [Miniflux](/recipies/miniflux/) updated to version 2.0, including PostgreSQL database and nightly DB dumps (_24 May 2018_) * [Turtle Pool](/recipies/turtle-pool/) updated for redundant daemons plus a failsafe (_16 May 2018_) -* "Disengaged" [AutoPirate](/recipies/autopirate/) uber-recipe into individual sub-recipies per-page, easing navigation and support / comment flow -* Switched [Emby](/recipies/emby/) to official docker container (more up-to-date) (_27 Mar 2018_) -* [Docker Swarm Mode](/ha-docker-swarm/docker-swarm-mode/#setup-automatic-updates) setup updated for automatic container updates (Shepherd) -* [Kanboard](/recipies/kanboard/) recipe [improved](https://github.com/funkypenguin/geek-cookbook/commit/8597bcc6319b571c8138cd1b615e8c512e5f5bd5) with the inclusion of a cron container to run automated daily jobs (_22 Dec 2017_) diff --git a/manuscript/images/munin.png b/manuscript/images/munin.png new file mode 100644 index 0000000..2e38724 Binary files /dev/null and b/manuscript/images/munin.png differ diff --git a/manuscript/recipies/munin.md b/manuscript/recipies/munin.md index 83167a8..6172d2b 100644 --- a/manuscript/recipies/munin.md +++ b/manuscript/recipies/munin.md @@ -1,12 +1,12 @@ -hero: Heroic Hero - # Munin -Intro +Munin is a networked resource monitoring tool that can help analyze resource trends and "what just happened to kill our performance?" problems. It is designed to be very plug and play. A default installation provides a lot of graphs with almost no work. -![NAME Screenshot](../images/name.jpg) +![Munin Screenshot](../images/munin.png) -Details +Using Munin you can easily monitor the performance of your computers, networks, SANs, applications, weather measurements and whatever comes to mind. It makes it easy to determine "what's different today" when a performance problem crops up. It makes it easy to see how you're doing capacity-wise on any resources. + +Munin uses the excellent ​RRDTool (written by Tobi Oetiker) and the framework is written in Perl, while plugins may be written in any language. Munin has a master/node architecture in which the master connects to all the nodes at regular intervals and asks them for data. It then stores the data in RRD files, and (if needed) updates the graphs. One of the main goals has been ease of creating new plugins (graphs). ## Ingredients @@ -16,6 +16,24 @@ Details ## Preparation +### Prepare target nodes + +Depending on what you want to monitor, you'll want to install munin-node. On Ubuntu/Debian, you'll use ```apt-get install munin-node```, and on RHEL/CentOS, run ```yum install munin-node```. Remember to edit ```/etc/munin/munin-node.conf```, and set your node to allow the server to poll it, by adding ```cidr_allow x.x.x.x/x```. + +On CentOS Atomic, of course, you can't install munin-node directly, but you can run it as a containerized instance. In this case, you can't use swarm since you need the container running in privileged mode, so launch a munin-node container on each atomic host using: + +``` +docker run -d --name munin-node --restart=always \ + --privileged --net=host \ + -v /:/rootfs:ro \ + -v /sys:/sys:ro \ + -e ALLOW="cidr_allow 0.0.0.0/0" \ + -p 4949:4949 \ + --restart=always \ + funkypenguin/munin-node +``` + + ### Setup data locations We'll need several directories to bind-mount into our container, so create them in /var/data/munin: @@ -28,8 +46,10 @@ mkdir -p {log,lib,run,cache} ### Prepare environment -Create /var/data/config/munin/munin.env, and populate with the following variables +Create /var/data/config/munin/munin.env, and populate with the following variables. Use the OAUTH2 variables if you plan to use an [oauth2_proxy](/reference/oauth_proxy/) to protect munin, and set at a **minimum** the ```MUNIN_USER```, ```MUNIN_PASSWORD```, and ```NODES``` values: + ``` +# Use these if you plan to protect the webUI with an oauth_proxy OAUTH2_PROXY_CLIENT_ID= OAUTH2_PROXY_CLIENT_SECRET= OAUTH2_PROXY_COOKIE_SECRET= @@ -45,7 +65,7 @@ SMTP_ALWAYS_SEND=false SMTP_MESSAGE='[${var:group};${var:host}] -> ${var:graph_title} -> warnings: ${loop<,>:wfields ${var:label}=${var:value}} / criticals: ${loop<,>:cfields ${var:label}=${var:value}}' ALERT_RECIPIENT=monitoring@example.com ALERT_SENDER=alerts@example.com -NODES="node1:10.20.30.1 node2:10.20.30.22 node3:10.20.30.23" +NODES="node1:192.168.1.1 node2:192.168.1.2 node3:192.168.1.3" SNMP_NODES="router1:10.0.0.254:9999" ``` @@ -77,7 +97,7 @@ services: image: a5huynh/oauth2_proxy env_file: /var/data/config/munin/munin.env networks: - - traefik + - traefik_public - internal deploy: labels: @@ -93,47 +113,30 @@ services: -provider=github networks: - traefik: + traefik_public: external: true internal: driver: overlay ipam: config: - - subnet: 172.16.20.0/24 + - subnet: 172.16.24.0/24 ``` !!! note Setup unique static subnets for every stack you deploy. This avoids IP/gateway conflicts which can otherwise occur when you're creating/removing stacks a lot. See [my list](/reference/networks/) here. -## Node - -``` -docker stop munin-node -docker rm munin-node -docker run -d --name munin-node --restart=always \ - --privileged --net=host \ - -v /:/rootfs:ro \ - -v /sys:/sys:ro \ - -e ALLOW="cidr_allow 0.0.0.0/0" \ - -p 4949:4949 \ - --restart=always \ - funkypenguin/munin-node -``` - - - ## Serving -### Launch Wekan stack +### Launch Munin stack -Launch the Wekan stack by running ```docker stack deploy wekan -c ``` +Launch the Munin stack by running ```docker stack deploy munin -c ``` -Log into your new instance at https://**YOUR-FQDN**, with user "root" and the password you specified in gitlab.env. +Log into your new instance at https://**YOUR-FQDN**, with user and password password you specified in munin.env above. ## Chef's Notes -1. If you wanted to expose the Wekan UI directly, you could remove the oauth2_proxy from the design, and move the traefik-related labels directly to the wekan container. You'd also need to add the traefik network to the wekan container. +1. If you wanted to expose the Munin UI directly, you could remove the oauth2_proxy from the design, and move the traefik-related labels directly to the munin container. You'd also need to add the traefik_public network to the munin container. ### Tip your waiter (donate) 👏 diff --git a/mkdocs.yml b/mkdocs.yml index 56847de..7df1b46 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -58,6 +58,7 @@ pages: - NextCloud: recipies/nextcloud.md - Plex: recipies/plex.md - Emby: recipies/emby.md + - Munin: recipies/munin.md - Home Assistant: recipies/homeassistant.md - OwnTracks: recipies/owntracks.md - CryptoMiner: