MRTG - fun with 20th century monitoring solution
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.
(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, mrtg can be installed with apk add mrtg
.
configuration
Details on mrtg’s config can be found in the projects online documentation. You will find my configs in my git project.
Example:
|
|
frontend
cgi-bin/graph.pl
A perl script is generating graphs from rrd using templates for each metric.
|
|
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
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
Example: tmpl/br0tkasten.eth0.tmpl
|
|
cgi-bin/details.pl
Renders tmpl/details.tmpl to display a html page with a bigger version of the graph. Using rrdGraphJs you can interactively zoom and scroll in your graph.
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.
|
|