优秀开源SNMP设备监控软件LirbeNMS安装图文教程

2025-05-27 0 53

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

写在前面

前面简单介绍了该款软件,这篇主要讲安装的过程,大家在使用开源软件的时候不要抱有免费的软件,商业的体验的心态,那是不可能的,该款软件一样存在很多问题,只不过在网络领域还是比其他开源软件要强大不少,至少在易用性、可扩展性还是不错的。

正文

环境

  • 系统版本:CentOS 7.8
  • web:Nginx
  • PHP版本:7.3(最低7.3)
  • 数据库:Mariadb

安装前准备

  1. yuminstallepel-releaseyum-utils-y
  2. yumlocalinstallhttp://rpms.remirepo.net/enterprise/remi-release-7.rpm-y
  3. yum-config-manager–enableremi-php74
  4. yuminstallcomposercroniefpinggitImageMagickjwhoismariadbmariadb-servermtrMySQL-pythonnet-snmpnet-snmp-utilsnginxnmapphp-fpmphp-cliphp-commonphp-curlphp-gdphp-mbstringphp-processphp-snmpphp-xmlphp-zipphp-memcachedphp-mysqlndpython-memcachedrrdtoolpython3python3-pip-y

创建LibreNMS用户

  1. useraddlibrenms-d/opt/librenms-M-r
  2. usermod-a-Glibrenmsnginx

下载LibreNMS文件

  1. cd/opt
  2. gitclonehttps://github.com/librenms/librenms.git

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

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

设置权限

  1. chown-Rlibrenms:librenms/opt/librenms
  2. chmod770/opt/librenms
  3. setfacl-d-mg::rwx/opt/librenms/rrd/opt/librenms/logs/opt/librenms/bootstrap/cache//opt/librenms/storage/
  4. setfacl-R-mg::rwx/opt/librenms/rrd/opt/librenms/logs/opt/librenms/bootstrap/cache//opt/librenms/storage/
  5. chgrpapache/var/lib/php/session/

安装PHP依赖组件

  1. su-librenms
  2. ./scripts/composer_wrapper.phpinstall–no-dev
  3. exit

安装、配置DB

  1. yum-yinstallmariadb-server
  2. systemctlstartmariadb&&systemctlenablemariadb
  3. mysql-uroot-p
  4. CREATEDATABASElibrenmsCHARACTERSETutf8COLLATEutf8_unicode_ci;
  5. CREATEUSER'librenms'@'localhost'IDENTIFIEDBY'xiaoyu123';
  6. GRANTALLPRIVILEGESONlibrenms.*TO'librenms'@'localhost';
  7. FLUSHPRIVILEGES;
  8. quit
  9. ####修改mariadb配置文件####
  10. vi/etc/my.cnf
  11. innodb_file_per_table=1
  12. lower_case_table_names=0
  13. ####wr保存退出####
  14. systemctlrestartmariadb

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

添加配置

PHP-FPM配置

1.修改时区

  1. vi/etc/php.ini

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

修改时区

2.修改php-fpm配置文件

  1. vi/etc/php-fpm.d/www.conf
  2. ####改为如下####
  3. ;user=apache
  4. user=nginx
  5. group=apache
  6. ;listen=127.0.0.1:9000
  7. listen=/run/php-fpm/php-fpm.sock
  8. listen.owner=nginx
  9. listen.group=nginx
  10. listen.mode=0660

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

3.重启php-fpm服务

  1. systemctlenablephp-fpm
  2. systemctlrestartphp-fpm

配置Nginx

  1. vi/etc/nginx/conf.d/librenms.conf
  2. ####添加如下内容####
  3. server{
  4. listen80;
  5. server_namelibrenms.example.com;
  6. root/opt/librenms/html;
  7. indexindex.php;
  8. charsetutf-8;
  9. gzipon;
  10. gzip_typestext/cssapplication/javascripttext/javascriptapplication/x-javascriptimage/svg+xmltext/plaintext/xsdtext/xsltext/xmlimage/x-icon;
  11. location/{
  12. try_files$uri$uri//index.php?$query_string;
  13. }
  14. location/api/v0{
  15. try_files$uri$uri//api_v0.php?$query_string;
  16. }
  17. location~\\.php{
  18. includefastcgi.conf;
  19. fastcgi_split_path_info^(.+\\.php)(/.+)$;
  20. fastcgi_passunix:/run/php-fpm/php-fpm.sock;
  21. }
  22. location~/\\.ht{
  23. denyall;
  24. }
  25. }

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

启动Nginx

  1. systemctlenablenginx
  2. systemctlrestartnginx

SNMP配置

  1. cp/opt/librenms/snmpd.conf.example/etc/snmp/snmpd.conf
  2. y
  3. curl-o/usr/bin/distrohttps://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distro
  4. chmod+x/usr/bin/distro
  5. systemctlenablesnmpd&&systemctlrestartsnmpd

计划任务

  1. cp/opt/librenms/librenms.nonroot.cron/etc/cron.d/librenms

复制LibreNMS配置文件

  1. cp/opt/librenms/misc/librenms.logrotate/etc/logrotate.d/librenms

访问前端

此时会发现访问还是Nginx的界面,这里需要调整一些参数

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

  1. vi/etc/nginx/nginx.conf
  2. systemctlrestartnginx

将端口改为8080

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

前端配置

点击图标进行下一步

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

检查通过

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

填写数据库信息

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

通过之后点击build

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

点击红框才能下一步

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

正常是空的dashboard

设置中文

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

简单使用

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

新增设备

最终效果

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

优秀开源SNMP设备监控软件LirbeNMS安装图文教程

总结

该软件部署较为复杂,如果仅仅想体验可以试试容器版本,目前官方提供apache和nginx两种版本,容器版本使用起来设备如果不多还是可以的,当然如果有一定基础的可以自行安装,但该软件的特点主要使用简单,监控项细致,但目前该软件还是存在一定的问题,例如华为WLAN部分access user显示有一定问题,预测是后台的mib逻辑调用存在异常导致,另外负载也有相对应的问题,所以大家如果想用,不妨先测试,最终决定是否使用。

原文地址:https://www.toutiao.com/i6943253500189016583/

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。

快网idc优惠网 行业资讯 优秀开源SNMP设备监控软件LirbeNMS安装图文教程 https://www.kuaiidc.com/67360.html

相关文章

发表评论
暂无评论