0% found this document useful (0 votes)
87 views3 pages

Install LIbreNMS

Uploaded by

Faiz Firmansyah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views3 pages

Install LIbreNMS

Uploaded by

Faiz Firmansyah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

Installation LibreNMS ( Monitoring )

~#apt install software-properties-common


~#add-apt-repository universe
~#add-apt-repository ppa:ondrej/php
~#apt update
~#apt install acl curl fping git graphviz imagemagick mariadb-client mariadb-server
mtr-tiny nginx-full nmap php-cli php-curl php-fpm php-gd php-gmp php-json php-
mbstring php-mysql php-snmp php-xml php-zip rrdtool snmp snmpd unzip python3-
pymysql python3-dotenv python3-redis python3-setuptools python3-systemd python3-pip
whois traceroute

=== Add librenms user ===


~#useradd librenms -d /opt/librenms -M -r -s "$(which bash)"

=== Download LibreNMS ===


/opt#cd /opt
/opt#git clone https://github.com/librenms/librenms.git

=== Set permissions ===


/opt#chown -R librenms:librenms /opt/librenms
/opt#chmod 771 /opt/librenms
/opt#setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs
/opt/librenms/bootstrap/cache/ /opt/librenms/storage/
/opt#setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs
/opt/librenms/bootstrap/cache/ /opt/librenms/storage/

=== Install PHP dependencies ===


~$su - librenms
~$./scripts/composer_wrapper.php install --no-dev
~$exit

~#wget https://getcomposer.org/composer-stable.phar
~#mv composer-stable.phar /usr/bin/composer
~#chmod +x /usr/bin/composer

=== Set timezone PHP ===


~#nano /etc/php/8.3/fpm/php.ini
date.timezone = Asia/Jakarta
~#nano /etc/php/8.3/cli/php.ini
date.timezone = Asia/Jakarta
~#timedatectl set-timezone Asia/Jakarta

=== Configure MariaDB ===


~#nano /etc/mysql/mariadb.conf.d/50-server.cnf
[mysqld]
innodb_file_per_table=1
lower_case_table_names=0
~#systemctl enable mariadb
~#systemctl restart mariadb
~#mysql -u root
CREATE DATABASE zitline CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'zitline'@'localhost' IDENTIFIED BY 'zitlineISP';
GRANT ALL PRIVILEGES ON zitline.* TO 'zitline'@'localhost';
exit

=== Configure PHP-FPM


~#cp /etc/php/8.3/fpm/pool.d/www.conf /etc/php/8.3/fpm/pool.d/librenms.conf
~#nano /etc/php/8.3/fpm/pool.d/librenms.conf
Ubah [www] menjadi [librenms]

user = librenms
group = librenms

listen = /run/php-fpm-librenms.sock

=== Configure Web Server ===


~#nano /etc/nginx/conf.d/librenms.conf
server {
listen 80;
server_name librenms.example.com;
root /opt/librenms/html;
index index.php;

charset utf-8;
gzip on;
gzip_types text/css application/javascript text/javascript application/x-javascript
image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ [^/]\.php(/|$) {
fastcgi_pass unix:/run/php-fpm-librenms.sock;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi.conf;
}
location ~ /\.(?!well-known).* {
deny all;
}
}

~#rm /etc/nginx/sites-enabled/default
~#systemctl restart nginx
~#systemctl restart php8.3-fpm

=== Enable lnms command completion ===


~#ln -s /opt/librenms/lnms /usr/bin/lnms
~#cp /opt/librenms/misc/lnms-completion.bash /etc/bash_completion.d/

=== Configure snmpd ===


~#cp /opt/librenms/snmpd.conf.example /etc/snmp/snmpd.conf
~#nano /etc/snmp/snmpd.conf
Edit community default RANDOMSTRINGGOESHERE menjadi sesuai yang kita inginkan
~#curl -o /usr/bin/distro https://raw.githubusercontent.com/librenms/librenms-
agent/master/snmp/distro
~#chmod +x /usr/bin/distro
~#systemctl enable snmpd
~#systemctl reload snmpd

=== Cron job ===


~#cp /opt/librenms/dist/librenms.cron /etc/cron.d/librenms

=== Enable the scheduler ===


~#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
=== Copy logrotate config ===
~#cp /opt/librenms/misc/librenms.logrotate /etc/logrotate.d/librenms

=== Web installer ===


Buka browser dengan http://192.168.1.20 lalu ikuti perintah untuk Installation
LibreNMS
~#chown librenms:librenms /opt/librenms/config.php

=== Troubleshooting ===


~$su - librenms

===gunakan perintah dibawah untuk mengetahui jika ada trouble yang terjadi diServer
Monitoring LibreNMS
~$./validate.php

==Gunakan perintah dibawah untuk mengupdate system pada LibreNMS


~$./daily.sh

== Jika ada masalah seperti berikut :


FAIL: We have detected that your database schema may be wrong Database: incorrect
column (notifications/datetime) Database: missing index
(ports_stack/ports_stack_device_id_port_id_high_port_id_low_unique) Database: extra
index (ports_stack/ports_stack_device_id_high_ifindex_low_ifindex_unique) Database:
incorrect column (users/created_at)
klik saja pada bagian fix automatic/ opsi berwarna hijau
lalu run pada server dengan command berikut :
~#Run the following SQL statements to fix it

You might also like