首页 » 网站建设 » snmpphp技巧_一文学会LirbeNMS安装优秀开源的SNMP设备监控软件

snmpphp技巧_一文学会LirbeNMS安装优秀开源的SNMP设备监控软件

访客 2024-10-30 0

扫一扫用手机浏览

文章目录 [+]

yum install epel-release yum-utils -yyum localinstall http://rpms.remirepo.net/enterprise/remi-release-7.rpm -yyum-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文件

snmpphp技巧_一文学会LirbeNMS安装优秀开源的SNMP设备监控软件

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

如果大家涌现这个问题,将上文地址由https改为git,但是非常慢

snmpphp技巧_一文学会LirbeNMS安装优秀开源的SNMP设备监控软件
(图片来自网络侵删)

设置权限

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-devexit

安装、配置DB

yum -y install mariadb-serversystemctl start mariadb && systemctl enable mariadbmysql -uroot -pCREATE 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.cnfinnodb_file_per_table=1lower_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 = apacheuser = nginxgroup = apache;listen = 127.0.0.1:9000listen = /run/php-fpm/php-fpm.socklisten.owner = nginxlisten.group = nginxlisten.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 nginxsystemctl restart nginx

SNMP配置

cp /opt/librenms/snmpd.conf.example /etc/snmp/snmpd.confycurl -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.confsystemctl restart nginx

将端口改为8080

前端配置

点击图标进行下一步

检讨通过

填写数据库信息

通过之后点击build

点击红框才能下一步

正常是空的dashboard

设置中文

大略利用

新增设备

终极效果

总结

该软件支配较为繁芜,如果仅仅想体验可以试试容器版本,目前官方供应apache和nginx两种版本,容器版本利用起来设备如果不多还是可以的,当然如果有一定根本的可以自行安装,但该软件的特点紧张利用大略,监控项细致,但目前该软件还是存在一定的问题,例如华为WLAN部分access user显示有一定问题,预测是后台的mib逻辑调用存在非常导致,其余负载也有相对应的问题,以是大家如果想用,不妨先测试,终极决定是否利用。

标签:

相关文章

微信第三方登录便捷与安全的完美融合

社交平台已成为人们日常生活中不可或缺的一部分。微信作为我国最受欢迎的社交软件之一,拥有庞大的用户群体。为了方便用户在不同平台间切换...

网站建设 2025-02-18 阅读0 评论0

广东高速代码表解码高速公路管理智慧

高速公路作为国家交通动脉,连接着城市与城市,承载着巨大的物流和人流。广东作为我国经济大省,高速公路网络密布,交通流量巨大。为了更好...

网站建设 2025-02-18 阅读0 评论0