LibreNMS is a popular open-source network monitoring tool that can monitor devices on your network, including servers, routers, switches, and more. In this tutorial, we will walk you through the steps of installing LibreNMS on Fedora CoreOS Latest.
Before you start with the installation process, make sure you have the following prerequisites:
To begin, you need to install some required packages on your server. Open a terminal and run the following commands:
sudo dnf install epel-release -y
sudo dnf install httpd mariadb-server mariadb php php-cli php-common php-mysqli php-gd php-ldap php-mbstring php-snmp php-pear php-curl php-zip php-xml php-mcrypt net-snmp net-snmp-utils fping cronie git wget -y
This will install Apache, MariaDB, PHP, and other required packages.
Next, you need to install SNMP and configure it to work with LibreNMS. Run the following command:
sudo dnf install net-snmp net-snmp-utils -y
After installing SNMP, you need to edit the SNMP configuration file by running the following command:
sudo nano /etc/snmp/snmpd.conf
Add the following lines at the end of the file:
rocommunity public 127.0.0.1
rocommunity public <your-server-IP-address>
syslocation "Your server location"
syscontact "Your email address"
Replace <your-server-IP-address>
with your server's IP address. Save and close the file.
Next, start the SNMP service and enable it to start at boot time:
sudo systemctl start snmpd
sudo systemctl enable snmpd
Now, you need to install and configure MariaDB. Run the following commands:
sudo systemctl start mariadb
sudo systemctl enable mariadb
sudo mysql_secure_installation
The last command will start the MariaDB security script which will ask you some questions about the security level of your database server. Follow the instructions and answer the questions accordingly.
Once the security script finishes, log in to your MariaDB server by running the following command:
sudo mysql -u root -p
Create a database for LibreNMS:
CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost' IDENTIFIED BY '<your-password>';
FLUSH PRIVILEGES;
exit;
Replace <your-password>
with a secure password.
Next, you need to download and install LibreNMS. Run the following commands:
sudo mkdir /opt/librenms
sudo chown -R apache:apache /opt/librenms
cd /opt/librenms
sudo git clone https://github.com/librenms/librenms.git .
sudo ./scripts/composer_wrapper.php install --no-dev
Now, you need to configure Apache to serve LibreNMS. Run the following commands:
sudo nano /etc/httpd/conf.d/librenms.conf
Add the following lines to the file:
Alias /librenms /opt/librenms/html
<Directory /opt/librenms/html>
AllowOverride All
Require all granted
</Directory>
Save and close the file. Next, restart Apache:
sudo systemctl restart httpd
If you have a firewall enabled on your server, you need to allow HTTP and SNMP traffic. Run the following commands:
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=snmp
sudo firewall-cmd --reload
Finally, you need to set up some cron jobs for LibreNMS. Run the following commands:
sudo ln -s /opt/librenms/librenms.nonroot.cron /etc/cron.d/librenms
sudo ln -s /opt/librenms/misc/lnms-schema.sql /opt/librenms/sql-schema/
sudo systemctl restart mariadb.service
sudo /opt/librenms/daily.sh
Open a web browser and go to http://<your-server-IP-address>/librenms
. You should see the LibreNMS login page. Log in with the default username admin
and password admin
.
Congratulations! You have successfully installed LibreNMS on Fedora CoreOS Latest. You can now start monitoring your network devices with this powerful tool.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!