3.8 KiB
3.8 KiB
type, created, updated
type | created | updated |
---|---|---|
topic | 2024-01-28T01:06:26.133Z | 2024-01-28T01:06:26.133Z |
LibreNMS
# https://learn.microsoft.com/en-us/windows/wsl/wsl-config
code-insiders .wslconfig
[wsl2]
networkingMode=mirrored
sudo -i
apt-get update
apt upgrade -y
ip a
lsb_release -a
apt-get install links unzip git nano ncdu -y
ncdu
timedatectl set-timezone America/Phoenix
timedatectl
nano /etc/hosts
exit
exit
wsl --export Ubuntu "L:\Ubuntu\Ubuntu-LibreNMS-001.tar"
wsl --unregister Ubuntu
wsl --import Ubuntu-LibreNMS Ubuntu-LibreNMS "L:\Ubuntu\Ubuntu-LibreNMS-001.tar"
# wsl --export Ubuntu-LibreNMS "L:\Ubuntu\Ubuntu-LibreNMS-002.tar"
# del "L:\Ubuntu\Ubuntu-LibreNMS-002.tar"
Name: Ubuntu-LibreNMS
Command Line: wsl.exe -d Ubuntu-LibreNMS
Tab Title: Ubuntu-LibreNMS
sudo -i
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 -y
exit
exit
wsl --export Ubuntu-LibreNMS "L:\Ubuntu\Ubuntu-LibreNMS-002.tar"
wsl --unregister Ubuntu-LibreNMS
wsl --import Ubuntu-LibreNMS Ubuntu-LibreNMS "L:\Ubuntu\Ubuntu-LibreNMS-002.tar"
# https://docs.librenms.org/Installation/Install-LibreNMS/#endpoints
useradd librenms -d /opt/librenms -M -r -s "$(which bash)"
#
cd /opt
git clone https://github.com/librenms/librenms.git
#
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/
#
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
code-insiders "\\wsl.localhost\Ubuntu-LibreNMS"
#
# America/Phoenix
# nano /etc/php/8.1/fpm/php.ini
# nano /etc/php/8.1/cli/php.ini
nano /etc/mysql/mariadb.conf.d/50-server.cnf
innodb_file_per_table=1
lower_case_table_names=0
systemctl enable mariadb
systemctl restart mariadb
mysql -u root
CREATE DATABASE librenms CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost';
exit
cp /etc/php/8.1/fpm/pool.d/www.conf /etc/php/8.1/fpm/pool.d/librenms.conf
nano /etc/php/8.1/fpm/pool.d/librenms.conf
nano /etc/nginx/conf.d/librenms.conf
rm /etc/nginx/sites-enabled/default
systemctl restart nginx
systemctl restart php8.1-fpm
# http://localhost/install/checks
wsl --export Ubuntu-LibreNMS "L:\Ubuntu\Ubuntu-LibreNMS-003.tar"
wsl --unregister Ubuntu-LibreNMS
wsl --import Ubuntu-LibreNMS Ubuntu-LibreNMS "L:\Ubuntu\Ubuntu-LibreNMS-003.tar"
# http://localhost
ln -s /opt/librenms/lnms /usr/bin/lnms
cp /opt/librenms/misc/lnms-completion.bash /etc/bash_completion.d/
cp /opt/librenms/snmpd.conf.example /etc/snmp/snmpd.conf
nano /etc/snmp/snmpd.conf
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
cp /opt/librenms/dist/librenms.cron /etc/cron.d/librenms
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
cp /opt/librenms/misc/librenms.logrotate /etc/logrotate.d/librenms
chown librenms:librenms /opt/librenms/config.php
exit
exit