zoukankan      html  css  js  c++  java
  • Monitorix系统和网络监控工具

    Monitorix 系统和网络监控公工具
    一、monitorix
    Monitorix是一款功能非常强大的免费开源轻型工具,目的在于监测Linux中的系统和网络资源。它可以定期收集系统和网络数据,并使用自己的Web界面,通过图形显示相关信息。Monitorix让用户可以监测系统整体性能,还有助于检测瓶颈、故障、不必要的超长响应时间及其他异常活动。
    二、Monitorix功能简介
    监测系统负载平均数值、活动进程、每个处理器的内核使用情况、全局内核使用情况和内存分配情况。
    监测磁盘驱动器的温度和健康状况。
    监测文件系统的使用情况和文件系统的输入/输出活动。
    监测多达10个网络设备的网络流量使用情况。
    监测众多系统服务,包括SSH、FTP、Vsftpd、ProFTP、SMTP、POP3、IMAP、POP3、VirusMail和Spam。
    显示MTA Mail的统计数字,包括输入连接和输出连接。
    显示网络端口流量,包括TCP和UDP等。
    显示FTP的统计数字,使用FTP服务器的日志文件格式。
    显示本地或远程服务器的Apache统计数字。
    显示本地或远程服务器的MySQL统计数字。
    显示Squid代理Web缓存的统计数字。
    显示Fail2ban的统计数字。
    监测远程服务器(多主机)。
    能够按照每天、每周、每月或每年,通过图形或明文表格查看统计数字。
    能够缩放图形,以便更清楚地查看。
    能够定义每一行的图形数量。
    内置的HTTP服务器。

    官方文档地址:http://www.monitorix.org/

    中文网站:http://monitorix.jincon.com/

    1、修改配置文件
    vim /etc/selinux/config

    SELINUX=enforcing
    改为
    SELINUX=disabled

    2、新建 testaccount 用户
    这2个目录下都有 testaccount 文件夹
    /home/
    /var/spool/mail/
    查看 testaccount 用户并授权
    cat /etc/passwd |grep testaccount
    testaccount:x:1001:1001::/home/testaccount:/bin/bash

    cat /etc/group |grep testaccount
    testaccount:x:1001:

    #没有则新建 密码: chinese@123
    su root
    useradd testaccount
    passwd testaccount

    visudo
    新增 testaccount用户具有root权限,修改 /etc/sudoers,并保存后退出
    testaccount ALL=(ALL) NOPASSWD:ALL

    su testaccount

    3、安装monitorix

    有安装的话先删除
    sudo rpm -qa |grep epel
    sudo rpm -e epel-release-7-11.noarch --nodeps

    方式1:
    sudo yum -y install epel-release
    sudo yum -y install monitorix


    方式2:
    rpm 包下载地址:http://rpm.pbone.net/
    rpmforge-release下载地址:
    http://rpm.pbone.net/index.php3/stat/4/idpl/30428251/dir/centos_7/com/rpmforge-release-0.5.3-2.1.x86_64.rpm.html

    sudo rpm -ivh rpmforge-release-0.5.3-2.1.x86_64.rpm
    yum -y install epel-release

    #找到这些包并安装
    yum -y install perl perl-CGI perl-MailTools perl-MIME-Lite perl-DBI perl-XML-Simple perl-Config-General perl-HTTP-Server-Simple perl-IO-Socket-SSL rrdtool-perl

    sudo yum list |grep perl-libwww
    sudo yum -y install perl-libwww-perl.noarch

    #rrtool包
    http://rpm.pbone.net/index.php3/stat/4/idpl/44081754/dir/centos_7/com/rrdtool-1.4.8-9.el7.x86_64.rpm.html
    sudo rpm -ivh rrdtool-devel-1.4.8-9.el7.x86_64.rpm

    #monitorix包
    sudo wget https://www.monitorix.org/monitorix-3.10.1-1.noarch.rpm

    sudo rpm -ivh monitorix-3.10.1-1.noarch.rpm


    epel.repo文件参考:
    [epel]
    name=Extra Packages for Enterprise Linux 7 - $basearch
    #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
    metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
    failovermethod=priority
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

    [epel-debuginfo]
    name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
    #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
    metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
    failovermethod=priority
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
    gpgcheck=1

    [epel-source]
    name=Extra Packages for Enterprise Linux 7 - $basearch - Source
    #baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
    metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
    failovermethod=priority
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
    gpgcheck=1

    #新增防火强允许通过的端口号 monitorix:8084
    sudo firewall-cmd --zone=public --add-port=8084/tcp --permanent

    #重新加载防火强
    sudo firewall-cmd --reload

    #查看通过防火强的端口
    sudo firewall-cmd --zone=public --list-ports

    #重启防火强
    sudo systemctl restart firewalld.service

    4、修改 monitorix.conf 配置文件端口号
    sudo vim /etc/monitorix/monitorix.conf

    <httpd_builtin>
    enabled = y
    host =
    port = 8084
    user = nobody
    group = nobody
    log_file = /var/log/monitorix-httpd
    hosts_deny =
    hosts_allow =
    <auth>
    enabled = n
    msg = Monitorix: Restricted access
    htpasswd = /var/lib/monitorix/htpasswd
    </auth>
    </httpd_builtin>

    #多机器监控
    <multihost>
    enabled = y
    footer_url = y
    graphs_per_row = 2
    remotehost_list = server 1, server 2, server 3
    <remotehost_desc>
    0 = http://ip1:8084
    1 = http://ip2:8084
    2 = http://ip3:8084
    </remotehost_desc>
    groups = y
    remotegroup_list = My Group
    <remotegroup_desc>
    0 = server 2, server 3
    </remotegroup_desc>
    </multihost>

    5、启动 monitorix
    #添加为系统服务
    sudo chkconfig --level 35 monitorix on

    sudo chkconfig --list

    #启动 monitorix
    sudo systemctl start monitorix

    访问地址:
    http://ip:8084/monitorix/

  • 相关阅读:
    python求pi的方法
    Python:字符串格式化
    Python time模块学习
    开源的PaaS平台
    车牌识别技术实现方式及应用场景
    ASP.NET车辆管理系统
    Spark+Hadoop+IDE环境搭建
    大数据平台技术方案及案例
    主流大数据平台及解决方案对比
    大数据平台架构——通用版
  • 原文地址:https://www.cnblogs.com/NiceTime/p/8583759.html
Copyright © 2011-2022 走看看