LirbeNMS如何安装
这篇文章主要介绍了LirbeNMS如何安装,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。
创新互联凭借在网站建设、网站推广领域领先的技术能力和多年的行业经验,为客户提供超值的营销型网站建设服务,我们始终认为:好的营销型网站就是好的业务员。我们已成功为企业单位、个人等客户提供了网站设计、网站建设服务,以良好的商业信誉,完善的服务及深厚的技术力量处于同行领先地位。
正文
环境
系统版本:CentOS 7.8
web:Nginx
PHP版本:7.3(最低7.3)
数据库:Mariadb
安装前准备
yum install epel-release yum-utils -y yum localinstall http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y yum-config-manager --enable remi-php74 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 -y
创建LibreNMS用户
useradd librenms -d /opt/librenms -M -r usermod -a -G librenms nginx
下载LibreNMS文件
cd /opt git clone https://github.com/librenms/librenms.git
如果大家出现这个问题,将上文地址由https改为git,但是非常慢
设置权限
chown -R librenms:librenms /opt/librenms chmod 770 /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/ chgrp apache /var/lib/php/session/
安装PHP依赖组件
su - librenms ./scripts/composer_wrapper.php install --no-dev exit
安装、配置DB
yum -y install mariadb-server systemctl start mariadb && systemctl enable mariadb mysql -uroot -p CREATE DATABASE librenms CHARACTER SET utf8 COLLATE utf8_unicode_ci; CREATE USER 'librenms'@'localhost' IDENTIFIED BY 'xiaoyu123'; GRANT ALL PRIVILEGES ON librenms.* TO 'librenms'@'localhost'; FLUSH PRIVILEGES; quit ####修改mariadb配置文件#### vi /etc/my.cnf innodb_file_per_table=1 lower_case_table_names=0 ####wr保存退出#### systemctl restart mariadb
添加配置
PHP-FPM配置
1.修改时区
vi /etc/php.ini
修改时区
2.修改php-fpm配置文件
vi /etc/php-fpm.d/www.conf ####改为如下#### ;user = apache user = nginx group = apache ;listen = 127.0.0.1:9000 listen = /run/php-fpm/php-fpm.sock listen.owner = nginx listen.group = nginx listen.mode = 0660
3.重启php-fpm服务
systemctl enable php-fpm systemctl restart php-fpm
配置Nginx
vi /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 /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; } }
启动Nginx
systemctl enable nginx systemctl restart nginx
SNMP配置
cp /opt/librenms/snmpd.conf.example /etc/snmp/snmpd.conf y 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/librenms.nonroot.cron /etc/cron.d/librenms
复制LibreNMS配置文件
cp /opt/librenms/misc/librenms.logrotate /etc/logrotate.d/librenms
访问前端
此时会发现访问还是Nginx的界面,这里需要调整一些参数
vi /etc/nginx/nginx.conf systemctl restart nginx
将端口改为8080
前端配置
点击图标进行下一步
检查通过
填写数据库信息
通过之后点击build
点击红框才能下一步
正常是空的dashboard
设置中文
简单使用
新增设备
最终效果
感谢你能够认真阅读完这篇文章,希望小编分享的“LirbeNMS如何安装”这篇文章对大家有帮助,同时也希望大家多多支持创新互联,关注创新互联行业资讯频道,更多相关知识等着你来学习!
网页题目:LirbeNMS如何安装
文章分享:http://cdiso.cn/article/jssjdh.html