Sign inSign up

tfeli/nedi

By tfeli

•Updated 20 days ago

NeDi 2.4C network monitoring and discovery platform based on Debian 13 and MariaDB.

Image
Networking
Monitoring & observability
0

873

tfeli/nedi repository overview

⁠NeDi 2.4C — Docker Image

Docker image for NeDi⁠ 2.4C.

The image runs NeDi with Apache, PHP and Perl on Debian 13. MariaDB runs as a separate container.

⁠Features

  • NeDi 2.4C
  • Debian 13
  • Apache 2
  • PHP 8.4
  • MariaDB 11.8
  • SNMP discovery and monitoring
  • RRD-based statistics
  • NetFlow processing
  • Compatible with Docker and rootless Podman

⁠Architecture

The deployment consists of two containers:

  • nedi — NeDi application, web interface, discovery and monitoring
  • nedi-mariadb — MariaDB database

Persistent configuration and data are stored on the host using bind mounts.

⁠Quick Start

Create a directory for the deployment:

mkdir nedi
cd nedi

Create compose.yml with the following content:

services:

  mariadb:
    image: docker.io/library/mariadb:11.8
    container_name: nedi-mariadb
    restart: unless-stopped

    environment:
      MARIADB_ROOT_PASSWORD: put-prefered-password-here

    volumes:
      - ./db:/var/lib/mysql

  nedi:
    image: docker.io/tfeli/nedi:latest
    container_name: nedi
    restart: unless-stopped

    depends_on:
      - mariadb

    ports:
      - "8080:80"

    volumes:
#      - ./nedi/nedi.conf:/var/nedi/nedi.conf
#      - ./nedi/seedlist:/var/nedi/seedlist
#      - ./nedi/crontab:/var/nedi/inc/crontab
      - ./nedi/conf:/var/nedi/conf
      - ./nedi/log:/var/nedi/log
      - ./nedi/rrd:/var/nedi/rrd
      - ./nedi/html/map:/var/nedi/html/map

Replace put-prefered-password-here with your preferred MariaDB root password.

Start the containers:

podman-compose up -d

⁠First-Time Database Initialization

Database initialization is required only once, during the first installation.

First, configure the NeDi database host:

podman exec nedi sed -i -E 's/^(dbhost[[:space:]]+).*/\1mariadb/' /var/nedi/nedi.conf

Initialize the database:

podman exec -it nedi /var/nedi/nedi.pl -i

When prompted, use:

  • Username: root
  • Password: the value configured as MARIADB_ROOT_PASSWORD in compose.yml
  • Database: %

The % database value allows the MariaDB user to connect from any host. This can be restricted further if desired, depending on your MariaDB security requirements.

After the database has been initialized successfully, do not run nedi.pl -i again. The initialization command creates/recreates the NeDi database and is intended for first-time setup.

⁠Persist NeDi Configuration

The following files are initially stored inside the container. Copy them to the host only during the first installation:

podman cp nedi:/var/nedi/nedi.conf ./nedi/nedi.conf
podman cp nedi:/var/nedi/inc/crontab ./nedi/crontab
podman cp nedi:/var/nedi/seedlist ./nedi/seedlist

Then uncomment the following bind mounts in compose.yml:

      - ./nedi/nedi.conf:/var/nedi/nedi.conf
      - ./nedi/seedlist:/var/nedi/seedlist
      - ./nedi/crontab:/var/nedi/inc/crontab

Restart the containers:

podman-compose down
podman-compose up -d

From this point onward, these files on the host are the persistent source of truth for the NeDi configuration. They are not replaced when the NeDi image is updated.

⁠Persistent Data

The following data is stored on the host:

Host pathContainer pathPurpose
./db/var/lib/mysqlMariaDB data
./nedi/nedi.conf/var/nedi/nedi.confNeDi configuration
./nedi/seedlist/var/nedi/seedlistNeDi seed list
./nedi/crontab/var/nedi/inc/crontabNeDi cron configuration
./nedi/conf/var/nedi/confNeDi configuration data
./nedi/log/var/nedi/logNeDi logs
./nedi/rrd/var/nedi/rrdRRD data
./nedi/html/map/var/nedi/html/mapNeDi map data

Do not remove the db/ or nedi/ directories when updating the installation.

⁠Further NeDi Configuration

The container provides a clean NeDi installation. Further configuration should be performed according to the official NeDi documentation⁠.

In particular, review the NeDi configuration and scheduling after the initial installation. The included crontab is the example configuration shipped with NeDi and does not enable periodic device discovery by default.

For example, if hourly discovery is appropriate for your environment, you can add the following line to crontab:

0 * * * * /var/nedi/nedi.pl -Aall > /var/nedi/log/nedi-`date +\%H\%M`.run 2>&1

Adjust the discovery schedule and NeDi options to your environment and requirements. Refer to the NeDi documentation for the available discovery, monitoring, backup and maintenance options.

⁠Updating the Image

Pull the new image and recreate the containers:

podman-compose pull
podman-compose down
podman-compose up -d

The host bind-mounted configuration and persistent data remain in place.

For a reproducible deployment, you can replace latest in compose.yml with a specific release tag, for example:

image: docker.io/tfeli/nedi:2.4C-20260922

⁠Image Tags

Each release is published using the following tags:

  • 2.4C-YYYYMMDD — dated release build
  • 2.4C — current NeDi 2.4C release
  • latest — current default release

The dated tag identifies a specific release build, while 2.4C and latest may be updated when a new image is released.

⁠Accessing NeDi

After the containers are running, open:

http://<host-ip>:8080/

The NeDi web interface is served on port 8080 of the host.

⁠Backup

Back up the deployment directory, especially:

  • db/
  • nedi/

These directories contain the MariaDB database and persistent NeDi configuration/data.

⁠Additional Persistent Data

If you configure additional NeDi components that store data in other directories, you can bind-mount those directories to the host as needed. Refer to the NeDi documentation⁠ for details about the purpose and contents of each directory before adding additional mounts.

Avoid bind-mounting directories that are part of the NeDi application itself unless you explicitly want to override the files provided by the image. In particular, do not bind-mount an empty host directory over application directories containing files supplied by the image, as this will hide those files inside the container.

⁠License

This image contains NeDi and third-party components, each distributed under its respective license. Please refer to the included copyright and license notices and comply with the applicable terms.

⁠Build

The image is built from NeDi 2.4C using Debian 13 as the base image.

The Docker build files are provided for transparency and reproducibility.

⁠Containerfile
FROM docker.io/library/debian:13

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        apache2 \
        libapache2-mod-php \
        php \
        php-cli \
        php-curl \
        php-gd \
        php-mbstring \
        php-mysql \
        php-snmp \
        php-xml \
        php-zip \
        perl \
        libnet-perl \
        libnet-snmp-perl \
        libnet-telnet-perl \
        libalgorithm-diff-perl \
        libdbi-perl \
        libdbd-mysql-perl \
        librrds-perl \
        libsocket6-perl \
        libio-pty-perl \
        libwww-perl \
        libnet-dns-perl \
        libnet-ntp-perl \
        libnet-smtp-ssl-perl \
        libcrypt-des-perl \
        libcrypt-rijndael-perl \
        libcrypt-hcesha-perl \
        libdigest-hmac-perl \
        snmp \
        rrdtool \
        fping \
        openssh-client \
        ca-certificates \
        curl \
        procps \
        iproute2 \
        net-tools \
        iputils-ping \
        libcap2-bin \
        cron \
    && setcap cap_net_raw+ep /usr/bin/ping \
    && rm -rf /var/lib/apt/lists/*

RUN a2enmod rewrite headers

WORKDIR /var/nedi

COPY nedi-2.4C.tgz /tmp/nedi-2.4C.tgz

RUN tar xzf /tmp/nedi-2.4C.tgz \
    && rm /tmp/nedi-2.4C.tgz \
    && chown -R www-data:www-data /var/nedi

RUN printf '%s\n' \
    '<VirtualHost *:80>' \
    '    DocumentRoot /var/nedi/html' \
    '' \
    '    <Directory /var/nedi/html>' \
    '        AllowOverride All' \
    '        Require all granted' \
    '    </Directory>' \
    '</VirtualHost>' \
    > /etc/apache2/sites-available/nedi.conf \
    && a2dissite 000-default \
    && a2ensite nedi

EXPOSE 80

CMD ["sh", "-c", "chown -R www-data:www-data /var/nedi && crontab -u www-data /var/nedi/inc/crontab && cron && /var/nedi/moni.pl -D & exec apachectl -D FOREGROUND"]

Tag summary

Content type

Image

Digest

sha256:a179ec0dd…

Size

136 MB

Last updated

20 days ago

docker pull tfeli/nedi