diff --git a/.hugo_build.lock b/.hugo_build.lock new file mode 100644 index 0000000..e69de29 diff --git a/config.toml b/config.toml index b4d2645..4f469c2 100644 --- a/config.toml +++ b/config.toml @@ -6,11 +6,17 @@ publishdir = "/var/www/localhost/htdocs" [menu] [[menu.main]] - identifier = "knowledge" - name = "Knowledge" - url = "/knowledge/" + identifier = "posts" + name = "Posts" + url = "/post/" title = "" weight = 1 + [[menu.main]] + identifier = "tags" + name = "Tags" + url = "/tags/" + title = "" + weight = 2 [params] version = "0.2.X" diff --git a/content/knowledge/apache-httpd.md b/content/post/apache-httpd.md similarity index 100% rename from content/knowledge/apache-httpd.md rename to content/post/apache-httpd.md diff --git a/content/knowledge/lets-encrypt.md b/content/post/lets-encrypt.md similarity index 100% rename from content/knowledge/lets-encrypt.md rename to content/post/lets-encrypt.md diff --git a/content/knowledge/lxc/lxc-networking.md b/content/post/lxc/lxc-networking.md similarity index 100% rename from content/knowledge/lxc/lxc-networking.md rename to content/post/lxc/lxc-networking.md diff --git a/content/knowledge/mail.md b/content/post/mail.md similarity index 100% rename from content/knowledge/mail.md rename to content/post/mail.md diff --git a/content/knowledge/matrix-chat-server.md b/content/post/matrix-chat-server.md similarity index 100% rename from content/knowledge/matrix-chat-server.md rename to content/post/matrix-chat-server.md diff --git a/content/post/mrtg/mrtg.md b/content/post/mrtg/mrtg.md new file mode 100644 index 0000000..a85e20b --- /dev/null +++ b/content/post/mrtg/mrtg.md @@ -0,0 +1,96 @@ +--- +title: "MRTG - fun with 20th century monitoring solution" +date: 2022-01-15T14:43:04+01:00 +draft: false +tags: + - monitoring + - mrtg +--- + + > I'm totaly aware there are more modern monitoring solutions (prometheus, icinga2, prtg and other + hipster stuff) out there. Despite this, I still like MRTG's minimalist approach. + +![MRTG](/image/mrtg/mrtg.png#center) + +## (my) setup +In my configuration MRTG is solely used for *collecting metrics* from various sources. +MRTG is very flexible where these metrics come from (snmp, curl, scripts ...). +My current configuration can be found at https://git.br0tkasten.de/br0tkasten/mrtg + +### backend + +#### installation +In [Alpine](https://www.alpinelinux.org), mrtg can be installed with `apk add mrtg`. + +#### configuration +Details on mrtg's config can be found in the [projects online documentation](https://oss.oetiker.ch/mrtg). +You will find my configs in [my git project](https://git.br0tkasten.de/br0tkasten/mrtg/src/branch/master/config). + +**Example:** +``` +LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt +WorkDir: /var/www/mrtg/rrd +LogFormat: rrdtool + +Target[br0tkasten.eth0]: #eth0:oom6faayaTosh0nizoepoonahCohhahy@10.3.0.1: +Title[br0tkasten.eth0]: [br0tkasten] eth0 +MaxBytes[br0tkasten.eth0]: 4294967295 +``` + +### frontend + +#### cgi-bin/graph.pl +A perl script is generating graphs from rrd using templates for each metric. + +``` +br0tkasten.eth0 Traffic Graph +``` +##### Parameter +- graph: name of the metric, the script will look for a template with the same name in tmpl/*.tmpl +- width & height: dimensions of the returned image in pixel + +![cgi-bin/graph.pl](/image/mrtg/graph.png) + +##### Templates +For each metric to be displayed you will have to create a template in tmpl/*metric*.tmpl. +Templates use rrdgraph syntax. More details can be found at [the projects online documentation](https://oss.oetiker.ch/rrdtool/doc/rrdgraph.en.html) + +**Example: tmpl/br0tkasten.eth0.tmpl** +``` +-v in/up bps +-t [br0tkasten] eth0 +--full-size-mode +--color=BACK#343637 +--color=CANVAS#F0F0F0 +--color=FONT#F0F0F0 +--font=TITLE:12:DejaVu Bold +DEF:d=/var/www/mrtg/rrd/br0tkasten.eth0.rrd:ds0:AVERAGE +DEF:u=/var/www/mrtg/rrd/br0tkasten.eth0.rrd:ds1:AVERAGE +CDEF:down=d,8,* +CDEF:up=u,-8,* +AREA:down#CC9A5780:Down +AREA:up#2EA34960:Up +LINE1:down#CC9A57 +LINE1:up#2EA349 +LINE1:0#000000 +``` + +#### cgi-bin/details.pl +Renders tmpl/details.tmpl to display a html page with a bigger version of the graph. +Using [rrdGraphJs](https://github.com/oetiker/RrdGraphJS) you can interactively zoom and scroll in your graph. + +![cgi-bin/details.pl](/image/mrtg/details.png) + +#### html +Graphs are embedded in static (and some dynamically generated) html pages. +I like to keep things simple - so most content is static. +Examples can be found in [htdocs](https://git.br0tkasten.de/br0tkasten/mrtg/src/branch/master/htdocs/index.html). + +``` +
+ [br0tkasten.de] eth0
+ + br0tkasten.eth0 Traffic Graph + +
+``` \ No newline at end of file diff --git a/content/knowledge/tiptoi.md b/content/post/tiptoi.md similarity index 100% rename from content/knowledge/tiptoi.md rename to content/post/tiptoi.md diff --git a/content/knowledge/webhook.md b/content/post/webhook.md similarity index 100% rename from content/knowledge/webhook.md rename to content/post/webhook.md diff --git a/static/image/mrtg/details.png b/static/image/mrtg/details.png new file mode 100644 index 0000000..44db704 Binary files /dev/null and b/static/image/mrtg/details.png differ diff --git a/static/image/mrtg/graph.png b/static/image/mrtg/graph.png new file mode 100644 index 0000000..427d6df Binary files /dev/null and b/static/image/mrtg/graph.png differ diff --git a/static/image/mrtg/mrtg.png b/static/image/mrtg/mrtg.png new file mode 100644 index 0000000..96b526b Binary files /dev/null and b/static/image/mrtg/mrtg.png differ