Sign inSign up

sk278/rpi-mrtg

By sk278

•Updated about 8 years ago

MRTG for RPi/arm32v6

Image
1

1.3K

sk278/rpi-mrtg repository overview

Original from https://github.com/gerrygosselin/mrtg-rpi⁠

⁠mrtg-rpi

A simple MRTG container based on Alpine.

Config
To use this container, attach the following volumes:

        - /etc/localtime:/etc/localtime:ro  
        - /etc/timezone:/etc/timezone:ro  
        - nodes.csv:/home/mrtg/cfg/nodes.csv:ro  
        - mrtg-data:/home/mrtg/data  

Localtime/timezone are nice-to-haves for making sure timezones are in sync. Totally optional.
The nodes.csv is a file listing the nodes for MRTG to poll. The format is:

routername1,rocommunity@ipaddress  
routername2,rocommunity@ipaddress  

For example:

MRTG-data is a named volume where MRTG stores its polling data.

Startup
Upon startup the nodes.csv file is read and each node is queried by cfgmaker. A new ~/cfg/nodename.cfg file is created. A printout of active targets (interfaces) is shown after each cfgmaker run for debugging purposes. It can be seen with docker logs . After all node configs have been created, indexmaker is run to generate a static index.html file in ~/data/. MRTG is then launched in foreground mode. The default polling cycle if 5 minutes. MRTG data is stored in log format, not RRD.

Web Server
You need a web server for displaying the index.html and graphs. A simple NGINX install will do.

Mount mrtg-data to an NGINX container:

        - mrtg-data:/mnt/mrtg:ro

and use a simple file in conf.d to display it:

server {
        server_name mrtg;
        root /mnt/mrtg;
        location / {
        }
}

Tag summary

Content type

Image

Digest

Size

10.8 MB

Last updated

about 8 years ago

docker pull sk278/rpi-mrtg