BSD Ports

net-mgmt/librenms 26.10.2,1 FreeBSD

Autodiscovering PHP/MySQL/SNMP based network monitoring

System
FreeBSD
Repository
FreeBSD ports
Maintainer
[email protected]
Last update
Commit
7324e31363
License
GPLv3
Categories
net-mgmt
Package size
84247.2 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

SystemPortVersion
FreeBSDnet-mgmt/librenms26.10.2,1
OpenBSDnet/librenms26.10.0v0
MidnightBSDnet-mgmt/librenms26.2.0_1,1

Install

Binary package:

pkg install librenms

From the ports tree:

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

To depend on this port in another port's Makefile:

RUN_DEPENDS=	librenms>0:net-mgmt/librenms

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

Repositoryaarch64amd64armv6armv7i386
FreeBSD:14:latest26.9.1.1,126.9.1.1,1-25.8.0,126.9.1.1,1
FreeBSD:14:quarterly26.9.1.1,126.9.1.1,1n/a25.6.0,126.9.1.1,1
FreeBSD:15:latest26.9.1.1,126.9.1.1,1n/a25.8.0,125.8.0,1
FreeBSD:15:quarterly26.9.1.1,126.9.1.1,1n/an/an/a
FreeBSD:16:latest26.9.1.1,126.9.1.1,1n/an/an/a
FreeBSD:16:quarterlyn/an/an/an/an/a

Dependencies

As this port's Makefile names them.

Runtime 7

The full lists below include those, and their dependencies in turn.

Build dependencies 7
Run dependencies 192

The first 100 are listed.

No port depends on this one.

Configuration

Options name: net-mgmt_librenms

OptionDefaultDescription
DOCSoffBuild and/or install documentation
EXAMPLESoffBuild and/or install examples
FPINGonEnable fping support ping monitoring
IPMITOOLonEnable support for monitoring hardware IPMI
LIBVIRTonVirtualization support via libvirt
MYSQLDoffUse local MySQL server
NAGPLUGINSonPlugins from nagios-plugins.org
NMAPonNMAP security scanning support
WMIConEnable support for WMI polling
X11offX11 (graphics) support
USES
cpe php python shebangfix sudo
Service scripts
librenms

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.

Files

distinfo 2
FileSizeSHA256
librenms-vendor-26.10.2.tar.gz3.8124933e+079a9b0088f70202d2504fafd8865f7144d01b52b3611b3b92664f9e5069827400
librenms-librenms-26.10.2_GH0.tar.gz8.3803318e+0751a8563f534d0b0053375ac816b68199abb533f4ee10150adef4d82641d19b97
Master sites 1
  • LOCAL/dvl:vendor

Commit history 9

DateCommitCreditsLog message
7324e31363 Dan Langille net-mgmt/librenms: Update to 26.10.2
re: https://github.com/librenms/librenms/releases/tag/26.10.2 This release requires a database update. Sponsored by: Yes
dd01641e57 Dan Langille net-mgmt/librenms: Update to 26.9.1.1
re: https://github.com/librenms/librenms/releases/tag/26.9.1.1 https://github.com/librenms/librenms/releases/tag/26.9.1
76ad60fa69 Dan Langille net-mgmt/librenms: Update to 26.9.0
re: https://github.com/librenms/librenms/releases/tag/26.9.0 This release requires a database update. Sponsored by: yes
dbbbd33c78 Dan Langille net-mgmt/librenms: Correct command_args in rc.d script
PR: 298398 Reported by: Dries Michiels
ee0efe6ff6 Dan Langille net-mgmt/librenms: fix rc script restart race & log rotation
Please stop librenms service before updating. No harm will occur. The value in the PID file changes from the service to the supervisor. Behavior changes: "service librenms status" now reports the daemon(8) supervisor PID instead of the python PID; log rotation now actually re-opens the log file. Upgrade note: an instance started with the previous rc script is invisible to the new procname and still holds the pidfile lock. Stop the service before upgrading, or SIGTERM the old supervisor (visible in ps as "daemon: ..."), which cleanly terminates the child and removes the pidfile. PR: 298398

The latest 5 of 9 in the history this site was built from.