How to Install and Configure LibreNMS on Ubuntu 16.04

How to Install and Configure LibreNMS on Ubuntu 16.04

In this tutorial we will show you how to install and configure LibreNMS on Ubuntu 16.04. LibreNMS is free and open source auto-discovering network monitoring tool based on PHP/MYSQL/SNMP. It’s a featured network monitoring system that provides support for wide range of network hardware and operating systems including, FreeBSD, Cisco, Linux, HP etc. LibreNMS is a community-based fork of the Observium network monitoring tool.

LibreNMS comes with a lot of useful features such as
– Automatic discovery
– Customisable alerting
– API Access
– Billing system
– Automatic Updates
– Distributed Polling
– iOS and Android App
– Unix Agent
– And many more…

Installing and configuring LibreNMS on Ubuntu 16.04, is fairly easy task, if you carefully follow our guide below.

1. Actualizarea sistemului

Login to your server via SSH as user root

ssh [email protected]_Address

and update all installed packages

apt-get update && upgrade de apt-get

2. Install Apache web server

Run the following command to install Apache web server on your Ubuntu 16.04 VPS

apt-get -y install apache2

Once the web server is installed, start it and enable it to start on boot

systemctl start apache2
systemctl enable apache2

Create Apache virtual host with the following content

nano /etc/apache2/sites-available/librenms.conf

<VirtualHost *:80>
DocumentRoot /opt/librenms/html/

AllowEncodedSlashes NoDecode
<Directory "/opt/librenms/html/">
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews

enable the virtual host and restart Apache for the changes to take effect

a2ensite librenms.conf
a2enmod rewrite
systemctl restart apache2

3. Install and configure MariaDB server

Install MariaDB server, start it and enable it to start automatically at system boot

apt-get install -y mariadb-client mariadb-server
systemctl start mysql
systemctl enable mysql

Următor →, run the mysql_secure_installation post installation script to secure the MariaDB server and set root password.

Acum, login to the MariaDB server as user root and create a new user and database for the LibreNMS installation

MariaDB [(none)]> CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci;
MariaDB [(none)]> CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'PASSWORD';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
MariaDB [(none)]> exit

Don’t forget to replace ‘PASSWORD’ with an actual strong password.

Open the MariaDB configuration file and add the following lines under [mysqld] secțiune

nano /etc/mysql/mariadb.conf.d/50-server.cnf


Restart MariaDB for the changes to take effect.

systemctl restart mysql

4. Install PHP 7

LibreNMS is a PHP based application, so we have to install PHP too. Run the following command to install PHP 7 and some additional PHP modules required by LibreNMS

apt-get install php7.0-cli php7.0-curl php7.0-gd php7.0-json php7.0-mcrypt php7.0-mysql php7.0-snmp php7.0-xml php7.0-zip libapache2-mod-php7.0

5. Install additional required packages

Install the following packages required by LibreNMS

apt-get install composer fping git graphviz imagemagick mtr-tiny nmap python-memcache python-mysqldb rrdtool snmp snmpd whois

6. Install and configure LibreNMS

Create a system user under which LibreNMS will run, and set the its home directory to /opt/librenms

useradd librenms -d /opt/librenms -M -r
usermod -a -G librenms www-data

Clone the LibreNMS source code through Git.

cd /opt/
git clone librenms

set the correct permission to the librenms directory

chown -R librenms:librenms /opt/librenms

To configure snmpd, copy the example configuration file

cp /opt/librenms/snmpd.conf.example /etc/snmp/snmpd.conf

Open the snmpd.conf file, edit the RANDOMSTRINGGOESHERE line and set your own community string.

Următor →, download the snmpd distro detection script

curl -o /usr/bin/distro

make it executable and restart the service

chmod +x /usr/bin/distro
systemctl restart snmpd

Acum, copy the cron script provided by LibreNMS to the ‘/ect/cron.d’ directory.

cp /opt/librenms/librenms.nonroot.cron /etc/cron.d/librenms

Copy the logrotate script too, in order to rotate the old logs

cp /opt/librenms/misc/librenms.logrotate /etc/logrotate.d/librenms

7. Finalize the installation

In cele din urma, go to and follow the on-screen instructions to complete the LibreNMS installation.

Articol original

lasa un raspuns

Acest site foloseste Akismet pentru a reduce spam-ul. Aflați cum este procesat un comentariu date.

Noi folosim cookie-uri pentru a vă oferi cea mai bună experiență on-line. Acceptând acceptați utilizarea cookie-urilor, în conformitate cu politica noastră de cookie.