一、LibreNMS簡(jiǎn)單介紹二、CentOS7下部署LibreNMS1、關(guān)閉SELINUX,配置yum源
2、配置remi-php73源,安裝LibreNMS所需的組件yum localinstall http://rpms./enterprise/remi-release-7.rpm yum-config-manager --enable remi-php73 yum install composer cronie fping git ImageMagick jwhois mariadb mariadb-server mtr MySQL-python net-snmp net-snmp-utils nginx nmap php-fpm php-cli php-common php-curl php-gd php-mbstring php-process php-snmp php-xml php-zip php-memcached php-mysqlnd python-memcached rrdtool python3 python3-pip python3-devel 3.git下載lirenms最新版本
usermod -a -G librenms nginx chown -R librenms:librenms /opt/librenms chmod 770 /opt/librenms chgrp apache /var/lib/php/session/ 4、切換到librenms用戶,配置php環(huán)境
5、配置數(shù)據(jù)庫(kù)mysqladmin -u root password 'MySQL@2021' mysql -u root -pMySQL@2021 登錄數(shù)據(jù)庫(kù)并創(chuàng)建如下數(shù)據(jù)庫(kù)表 CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci; CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'librenms@2021'; GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost'; FLUSH PRIVILEGES; exit
6、配置php環(huán)境修改時(shí)區(qū)配置如下 date.timezone = Asia/Shanghai
7、配置nginxserver { 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 /api/v0 { try_files $uri $uri/ /api_v0.php?$query_string; } location ~ \.php { include fastcgi.conf; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/run/php-fpm/php-fpm.sock; } location ~ /\.ht { deny all; } } 并刪掉/etc/nginx/nginx.conf中server段默認(rèn)配置 systemctl enable nginx systemctl restart nginx 8、snmpd配置
9、crond配置與logrotated配置cp /opt/librenms/librenms.nonroot.cron /etc/cron.d/librenms cp /opt/librenms/misc/librenms.logrotate /etc/logrotate.d/librenms 10、登錄web界面,添加監(jiān)控設(shè)備,功能界面體驗(yàn) |
|
來(lái)自: 西北望msm66g9f > 《編程》