Instalasi
LibreNMS
Network Monitoring System berbasis open-source. Panduan ini mencakup instalasi lengkap di Debian menggunakan Nginx + MariaDB + PHP-FPM.
Langkah Pelaksanaan
Persiapan Sistem
Update sistem dan install dependensi yang dibutuhkan LibreNMS.
apt update && apt upgrade -y apt install -y acl curl fping git graphviz imagemagick mariadb-client \ mariadb-server mtr-tiny apache2 libapache2-mod-fcgid nmap php8.2-cli \ php8.2-curl php8.2-fpm php8.2-gd php8.2-gmp php8.2-mbstring \ php8.2-mysql php8.2-snmp php8.2-xml php8.2-zip rrdtool snmp snmpd \ whois unzip python3-dotenv python3-pymysql python3-redis \ python3-setuptools python3-systemd python3-pip lnav
Buat User LibreNMS
Buat user sistem khusus untuk menjalankan LibreNMS.
useradd librenms -d /opt/librenms -M -r -s "$(which bash)"
Download LibreNMS
Clone repositori LibreNMS dari GitHub ke direktori /opt/librenms.
cd /opt git clone https://github.com/librenms/librenms.git
Set Permission
Atur kepemilikan dan permission folder LibreNMS.
chown -R librenms:librenms /opt/librenms chmod 771 /opt/librenms setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs \ /opt/librenms/bootstrap/cache/ /opt/librenms/storage/ setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs \ /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
Install Dependensi PHP (Composer)
Install library PHP yang dibutuhkan menggunakan Composer.
cd /opt/librenms sudo -u librenms ./scripts/composer_wrapper.php install --no-dev
Set Timezone
Samakan timezone PHP dengan timezone sistem.
timedatectl set-timezone Asia/Jakarta
nano /etc/php/8.2/cli/php.ini # Cari dan ubah baris: # date.timezone = Asia/Jakarta
nano /etc/php/8.2/fpm/php.ini # Cari dan ubah baris: # date.timezone = Asia/Jakarta
Konfigurasi MariaDB
Tambahkan konfigurasi yang dibutuhkan, lalu buat database dan user khusus untuk LibreNMS.
# Tambahkan di bawah [mysqld]: innodb_file_per_table=1 lower_case_table_names=0
systemctl enable mariadb systemctl restart mariadb
sudo mysql
CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'passwordkamu'; GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost'; FLUSH PRIVILEGES;
EXIT;
Konfigurasi PHP-FPM
Buat pool PHP-FPM khusus untuk LibreNMS agar berjalan sebagai user librenms.
[librenms] user = librenms group = librenms listen = /run/php-fpm-librenms.sock listen.owner = www-data listen.group = www-data listen.mode = 0660 pm = dynamic pm.max_children = 10 pm.start_servers = 2 pm.min_spare_servers = 1 pm.max_spare_servers = 5
systemctl restart php8.2-fpm
Konfigurasi Apache
Aktifkan modul yang dibutuhkan dan buat VirtualHost untuk LibreNMS.
a2enmod rewrite proxy_fcgi setenvif a2enconf php8.2-fpm
<VirtualHost *:80>
ServerName librenms.local
DocumentRoot /opt/librenms/html/
AllowEncodedSlashes NoDecode
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php-fpm-librenms.sock|fcgi://localhost"
</FilesMatch>
<Directory "/opt/librenms/html/">
Require all granted
AllowOverride All
Options FollowSymLinks MultiViews
</Directory>
</VirtualHost>a2ensite librenms a2dissite 000-default systemctl restart apache2 systemctl restart php8.2-fpm
Konfigurasi SNMP
Setup SNMP daemon untuk monitoring perangkat lokal.
cp /opt/librenms/snmpd.conf.example /etc/snmp/snmpd.conf nano /etc/snmp/snmpd.conf # Ganti baris: rocommunity public default # Menjadi : rocommunity public localhost
curl -o /usr/bin/distro https://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro chmod +x /usr/bin/distro systemctl enable snmpd systemctl restart snmpd
Setup Cron & Log Rotation
Aktifkan cron job untuk polling data dan log rotation.
cp /opt/librenms/dist/librenms.cron /etc/cron.d/librenms cp /opt/librenms/misc/librenms.logrotate /etc/logrotate.d/librenms
Setup Scheduler (Laravel)
Aktifkan Laravel scheduler sebagai systemd service.
cp /opt/librenms/dist/librenms-scheduler.service \ /opt/librenms/dist/librenms-scheduler.timer \ /etc/systemd/system/ systemctl enable librenms-scheduler.timer systemctl start librenms-scheduler.timer
Web Installer
Selesaikan instalasi melalui browser.
http://<IP-SERVER>/install # atau jika pakai domain: http://librenms.local/install
Selesai & Login
Setelah web installer selesai, LibreNMS sudah siap digunakan. Login dengan akun admin yang dibuat tadi.
http://<IP-SERVER>/ # atau jika pakai domain: http://librenms.local/