BSD Ports

net-mgmt/librenms 26.9.1.1,1 DragonFly

Autodiscovering PHP/MySQL/SNMP based network monitoring

System
DragonFly
Repository
DPorts
Maintainer
[email protected] (as in FreeBSD)
License
GPLv3
Categories
net-mgmt
Package size
82566.7 KiB, 1015879.3 KiB installed

Description

LibreNMS is an autodiscovering PHP/MySQL/SNMP based network monitoring which includes support for a wide range of network hardware and operating systems including Cisco, Linux, FreeBSD, Juniper, Brocade, Foundry, HP and many more.

LibreNMS has grown out of a lack of easy to configure network monitoring platforms. It is intended to provide a more navigable interface to the health and performance of your network. Its design goals include collecting as much historical data about devices as possible, being completely autodiscovered with little or no manual intervention, and having a very intuitive interface.

In the other systems

The newest version among them is 26.10.2, as upstream numbers it.

SystemPortVersionVulnerabilitiesStatusMaintainerLast update
DragonFlynet-mgmt/librenms26.9.1.1,1 behind since 2026-10-21none known-[email protected]-
FreeBSDnet-mgmt/librenms26.10.2_1,1 newestnone known-[email protected]2026-10-24
OpenBSDnet/librenms by name26.10.2v0 newestno data-Stuart Henderson <[email protected]>2026-10-29
MidnightBSDnet-mgmt/librenms26.2.0_2,1 behind since 2026-07-20no data-[email protected]2026-11-04
HardenedBSDnet-mgmt/librenms26.10.2_1,1 newestno data-[email protected]-
GhostBSDnet-mgmt/librenms26.10.2_1,1 newestno data-[email protected]-

Compare across BSDs

Version history 1

  1. 26.9.1.1

Upstream's version as each commit to the port's Makefile set it, or as this site first saw it in the system's packages; the tree's own revisions are not versions here.

Install

Binary package:

pkg install librenms

From DPorts:

cd /usr/dports/net-mgmt/librenms && make install clean

Dependency graph

Ports that need it on the left, what it needs to run on the right; at most 8 of each. "Dependencies" below lists them all.

Dependencies

Run dependencies 41

No port depends on this one.

Configuration

No options to configure.

Service scripts
none

Message after installing

You can mostly follow the guide at:
http://docs.librenms.org/

with the following notes:
- Installation directory is /usr/local/www/librenms

NOTE: setting sql-mode="" is no longer required. You can remove it from
/usr/local/etc/mysql/my.cnf

LibreNMS requires specific entries in my.cnf for MySQL. In MySQL 8, once the
service is started for the first time, the lower_case_table_names value can not
be changed. It is recommended that you my.cnf before starting MySQL for the
first time or pass specific values on the command-line when starting MySQL. 

NOTE that the lower_case_table_names entry needs to be set before you start
MySQL for the first time.

innodb_file_per_table=1
lower_case_table_names=0

By default MySQL 8 uses a different authentication plugin to auth database users.
If you see errors in the logs like this:

"The server requested authentication method unknown to the client..."

Add this to my.cnf:

[mysqld]
default-authentication-plugin=mysql_native_password

The following MySQL configuration is required. Adjust 'localhost' as
required if MySQL is on a different host.

CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'librenms'@'localhost' IDENTIFIED with mysql_native_password BY 'password';
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
FLUSH PRIVILEGES;

Enable the poller service with this command:

sysrc librenms_enable="YES"

The service will log to /var/log/librems/librenms-service.log

For log file rotation

* sample file installed to /usr/local/www/librenms/contrib/newsyslog.conf.sample
* actual file installed, never overwriting, to /usr/local/etc/newsyslog.conf.d/librenms.conf

For new installs, you need a /usr/local/www/librenms/.env file. To create:

cd /usr/local/www/librenms
cp -i .env.example .env

That file will eventually contain secrets.  Make sure it is not world-readable.

Database connection details are required in that file.

When trying to run /install for the first time you need to have (INSTALL=true)
in your .env file. If you don't set it you will get a 403 error on the
webpage.

Then run:

sudo php artisan key:generate

It should write directly to your .env file. The output should look something
like this:

$ sudo php artisan key:generate
Application key set successfully.

You need an APP_KEY.

* /usr/local/www/librenms/.env should now contain:
  * APP_KEY
  * NODE_I
  * DB_HOST
  * DB_DATABASE
  * DB_USERNAME
  * DB_PASSWORD

* you can create a NODE_ID with: php -r 'echo uniqid() . "\n";'

After that, follow the LibreNMS documentation for configuration.

It is also a good idea to validate your configuation after MySQL has been
started:

cd /usr/local/www/librenms
echo ./validate.php | sudu su -fm www

NOTE: The mysql client is no longer a run-time dependency.
      If needed, you must install it.

Depending on the version, you may have to run the upgrade script.
In previous releases, I used:

sudo su -fm www
/usr/local/bin/lnms migrate

Now I use this: sudo su -m www -c "lnms migrate"

If that command gives you problems, please let me know. I'll remove
the older command after a few releases, if all goes well.

NOTE: that script is particular about who runs it and ownership.
Previously, it was suggested you avoid this via chown when using
the script /usr/local/www/librenms/lnms
Now, a symlink is provided. Using /usr/local/bin/lnms avoids
those issues. Use it instead.

re: https://docs.librenms.org/General/Updating/

LibreNMS requires specific entries in my.cnf for MySQL.

NOTE that the lower_case_table_names entry needs to be set before you start
MySQL for the first time.

innodb_file_per_table=1
lower_case_table_names=0

For MySQL 8, you need to update the my.cnf

And adjust the login (adjusting localhost as required):

alter user 'librenms'@'localhost' identified with mysql_native_password by 'passwordhere';

NOTE: Starting with the 22.2.1 port the /usr/local/www/librenms/storage directory has
been replaced with a symlink to /var/db/librenms/storage

NOTE: Maintainer has noticed that upon reboot (at least in jails), the service
does not properly start. Monitor /var/log/librenms/*.log and if you see
'Unable to launch a new process', then restart the service via:

 service librenms restart

NOTE: The mysql client is no longer a run-time dependency.
      If needed, you must install it.