当前位置: 首页 > Linux

很刺激!这个免费开源的监控系统真的很强大~

时间:2023-04-07 01:14:41 Linux

大家好,我是民工哥。说到监控系统,大家很快就能想到Zabbix、Prometheus等,今天米工哥给大家推荐一款不输Zabbix的监控软件Librenms。LibreNMS简介LibreNMS是一个功能齐全的开源网络监控系统。它用于SNMP从不同的设备获取数据。LibreNMS支持Cisco、Linux、FreeBSD、Juniper、Brocade、Foundry、HP等多种设备,支持多种认证机制,支持双因素认证。它有一个可定制的警报系统,通过电子邮件向网络管理员发出警报github:https://github.com/librenms/l...LibreNMS功能自动发现警报多个环境传感器支持多种协议数据收集(STP、OSPF、BGP等).)VLAN、ARP和FDB表集合可定制的仪表板设备集成备份分布式轮询多种身份验证方法(MySQL、LDAP、ActiveDirectory、HTTP)NetFlow、sFlow、IPFIX(NfSen)服务监控(Nagios插件)Syslog(集成、Graylog)流量统计双因素认证强大的API自动更新LibreNMS安装环境请注意支持的最低PHP版本为7.3建议使用Nginx作为Web服务器安装所需的包yuminstallepel-releaseyum-utilsyumlocalinstallhttp://rpms.remirepo.net/enterprise/remi-release-7.rpmyum-config-manager--enableremi-php73yuminstallcomposercroniefpinggitImageMagickjwhoismariadbmariadb-servermtrMySQL-pythonnet-snmpnet-snmp-utilsnginxnmapphp-fpmphp-cliphp-commonphp-curlphp-gdphp-mbstringphp-processphp-snmpphp-xmlphp-zipphp-memcachedphp-mysqlndpython-memcachedrrdtoolpython3python3-pip添加librenms用户useraddlibrenms-d/opt/librenms-M-rusermod-a-Glibrenmsnginx下载LibreNMScd/optgit克隆https://github.com/librenms/librenms.git设置权限chown-Rlibrenms:librenms/opt/librenmschmod770/opt/librenmssetfacl-d-mg::rwx/opt/librenms/rrd/opt/librenms/logs/opt/librenms/bootstrap/cache//opt/librenms/storage/setfacl-R-mg::rwx/opt/librenms/rrd/opt/librenms/logs/opt/librenms/bootstrap/cache//opt/librenms/storage/chgrpapache/var/lib/php/session/安装PHP依赖项su-librenms./scripts/composer_wrapper.phpinstall--no-devexit数据库服务器#ConfigureMySQLsystemctlstartmariadbmysql-uroot#ChangetheinitialpasswordCREATEDATABASElibrenmsCHARACTERSETutf8mb4COLLATEutf8mb4_unicode_ci;CREATEUSER'librenms'@'localhost'IDENTIFIEDBY'password';GRANTALLPRIVILEGESONlibrenms.*TO'librenms'@'localhost';冲洗特权;exitvi/etc/my.cnf在这个[mysqld]部分,请添加:innodb_file_per_table=1lower_case_table_names=0systemctlenablemariadbsystemctlrestartmariadbconfigure并启动PHP-FPM确保在php.ini中启动PHP-FPM,设置日期。时区到您的首选时区。具体时区请参考:https://php.net/manual/en/tim...vi/etc/php.inidate.timezone=Asia/Shanghaiin/etc/php-fpm.d/www.confvi/etc/php-fpm.d/www.conf;user=apacheuser=nginx组=阿帕奇;将组保持为apache;listen=127.0.0.1:9000listen=/run/php-fpm/php-fpm.socklisten.owner=nginxlisten.group=nginxlisten.mode=0660systemctlenablephp-fpmsystemctlrestartphp-fpm配置NGINXvi/etc/nginx/conf.d/librenms.conf添加如下配置,server_name根据需要修改:server{listen80;服务器名称librenms.example.com;根/opt/librenms/html;索引index.php;字符集utf-8;gzip上;gzip_types文本/css应用程序/javascript文本/javascript应用程序/x-javascript图像/svg+xml文本/纯文本/xsd文本/xsl文本/xml图像/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{includefastcgi.conf;fastcgi_split_path_info^(.+\.php)(/.+)$;fastcgi_passunix:/run/php-fpm/php-fpm.sock;}location~/\.ht{全部拒绝;}}systemctlenablenginxsystemctlrestartnginx配置LibreNMS所需的contextsemanagefcontext-a-thttpd_sys_content_t'/opt/librenms/logs(/.*)?'semanagefcontext-a-thttpd_sys_rw_content_t'/opt/librenms/logs(/.*)?'restorecon-RFvv/opt/librenms/logs/semanagefcontext-a-thttpd_sys_content_t'/opt/librenms/rrd(/.*)?'semanagefcontext-a-thttpd_sys_rw_content_t'/opt/librenms/rrd(/.*)?'restorecon-RFvv/opt/librenms/rrd/semanagefcontext-a-thttpd_sys_content_t'/opt/librenms/storage(/.*)?'semanagefcontext-a-thttpd_sys_rw_content_t'/opt/librenms/storage(/.*)?'restorecon-RFvv/opt/librenms/storage/semanagefcontext-a-thttpd_sys_content_t'/opt/librenms/bootstrap/cache(/.*)?'semanagefcontext-a-thttpd_sys_rw_content_t'/opt/librenms/bootstrap/cache(/.*)?'restorecon-RFvv/opt/librenms/bootstrap/cache/setsebool-Phttpd_can_sendmail=1setsebool-Phttpd_execmem1允许fping创建具有以下内容的文件http_fping.tt您可以在任何地方创建此文件,因为它是一次性文件。此安装过程的最后一步会将模块安装在正确的位置。模块http_fping1.0;需要{typehttpd_t;classcapabilitynet_raw;classrawip_socket{getoptcreatesetoptwriteread};}#=============httpd_t==============allowhttpd_tself:capabilitynet_raw;allowhttpd_tself:rawip_socket{getoptcreatesetoptwriteread};然后运行这些命令checkmodule-M-m-ohttp_fping.modhttp_fping.ttsemodule_package-ohttp_fping.pp-mhttp_fping.modsemodule-ihttp_fping.ppconfiguresnmpdcp/opt/librenms/snmpd.conf.example/etc/snmp/snmpd.confvi/etc/snmp/snmpd.conf编辑显示的文本RANDOMSTRINGGOESHERE并设置您自己的社区字符串。curl-o/usr/bin/distrohttps://raw.githubusercontent.com/librenms/librenms-agent/master/snmp/distrochmod+x/usr/bin/distrosystemctl启用snmpdsystemctl重启snmpdCronjobcp/opt/librenms/librenms。nonroot.cron/etc/cron.d/librenmslogrotate配置LibreNMS以将日志保存在/opt/librenms/logs中。随着时间的推移,它们可能会变大并向外旋转。要轮换旧日志,您可以使用提供的logrotate配置文件。cp/opt/librenms/misc/librenms.logrotate/etc/logrotate.d/librenmsWeb安装浏览器输入http://librenms.example.com/i...安装Web安装程序可能会提示librenms中的config.php安装位置需要手动创建一个文件,此时将Web上显示的内容复制到该文件中。然后设置权限。chownlibrenms:librenms/opt/librenms/config.phpLibreNMS界面首页界面添加设备创建组设备列表启用发现模块流量监控磁盘监控网络图LibreNMS图表API配置报警规则过去推荐:系统之眼!Linux系统性能监控工具Glances,界面炫酷,功能强大!这款Linux性能实时监控工具超级好用!