• smokeping配置-centos 7.5 -smokeping 2.7.3 -经过2天半时间搞好了


      下载地址:https://oss.oetiker.ch/smokeping/doc/smokeping_install.en.html

    1.安装epel package

    yum install epel-release -y

    2. 安装development tools

    yum groupinstall "Development tools" -y

    3. 安装fping (smokeping 2.7.2以上需要fping4.0以上,因此需要手动编译)

    cd ~
    wget https://fping.org/dist/fping-4.2.tar.gz  -O /usr/local/src/fping-4.2.tar.gz
    cd /usr/local/src/
    tar -zxvf fping-4.2.tar.gz cd fping-4.2 ./configure make make install

    安装好的fping位于/usr/local/sbin/fping

    4. 安装echoping (预防以后需要做tcp ping)

    cd ~
    wget https://fossies.org/linux/misc/old/echoping-6.0.2.tar.gz  -O /usr/local/src/echoping-6.0.2.tar.gz
    cd  /usr/local/src/
    tar -zxvf echoping-6.0.2.tar.gz cd echoping-6.0.2 yum install -y popt-devel openssl openssl-devel ./configure --with-ssl --without-libidn make make install

    安装好的echoping位于/usr/local/bin/echoping

    5 安装需要的package

    cd ~
    yum install rrdtool rrdtool-perl curl bind-utils gcc make vim gcc-c++ -y
    yum install perl-core -y

    5.5 开启SSL支持

    yum install perl-LWP-Protocol-https

    6. 安装apache, 注意smokeping是fcgi程序,因此apache 需要安装mod_fcgid, http的版本是2.4.6, 

    yum install httpd httpd-devel
    yum install mod_fcgid
    systemctl enable httpd

    7 安装smokeping

    cd ~
    
    wget https://oss.oetiker.ch/smokeping/pub/smokeping-2.7.3.tar.gz  -O /usr/local/src/smokeping-2.7.3.tar.gz
    cd /usr/local/src/
    tar -zxvf smokeping-2.7.3.tar.gz
    
    cd smokeping-2.7.3
    
    ./configure --prefix=/opt/smokeping PERL5LIB=/usr/lib64/perl5/
    
    /usr/bin/gmake install

     

    注意,如果我们不加上 ./configure –prefix=/opt/smokeping PERL5LIB=/usr/lib64/perl5/,会提示下面的:

     

    ** Ready to install Smokeping ******************************
    
    Settings:
    
    PERL5LIB = not set
    PERL = /usr/bin/perl
    
    The Smokeping Makefiles use GNU make functionality.
    Continue installation with
    
    /usr/bin/gmake install

     

    如果我们加上PERL5LIB=/usr/lib64/perl5的话,会显示如下:

    ** Ready to install Smokeping ******************************
    
    Settings:
    
    PERL5LIB = /usr/lib64/perl5/
    PERL = /usr/bin/perl
    
    The Smokeping Makefiles use GNU make functionality.
    Continue installation with
    
    /usr/bin/gmake install

    9 初始化smokeping, 我们需要建立三个文件夹,data用来存放rrd文件,var用来存放smokeping的pid, log用来存放smokeping.log

    cd /opt/smokeping
    
    mkdir data var cache
    
    chmod 777 data var  cache
    chown apache:apache data var cache -R touch var/log/smokeping.log
    chown apache:apache var/log/smokeping.log

    10 重命名配置文件等
    cd /opt/smokeping/htdocs/ cp smokeping.fcgi.dist smokeping.fcgi cd /opt/smokeping/etc cp config.dist config
    cp basepage.html.dist basepage.html
    配置config文件

    11.编辑/opt/smokeping/etc/config

    *** General ***
    
    owner    = JCJGK      
    contact  = some@address.nowhere
    mailhost = my.mail.host
    sendmail = /usr/sbin/sendmail
    # NOTE: do not put the Image Cache below cgi-bin
    # since all files under cgi-bin will be executed ... this is not
    # good for images.
    imgcache = /opt/smokeping/cache   #修改处
    imgurl   = cache          #修改处
    datadir  = /opt/smokeping/data  #修改处
    piddir  = /opt/smokeping/var    #修改处,
    cgiurl   = http://10.50.133.23/smokeping.cgi  #修改处,访问地址
    
    smokemail = /opt/smokeping/etc/smokemail.dist
    tmail = /opt/smokeping/etc/tmail.dist
    # specify this to get syslog logging
    syslogfacility = local0
    # each probe is now run in its own process
    # disable this to revert to the old behaviour
    # concurrentprobes = no
    *** Alerts ***
    to = |/opt/smokeping/bin/mailx_alert.sh
    from = smokealert@company.xy
    
    +someloss
    type = loss
    # in percent
    pattern = >0%,*12*,>0%,*12*,>0%
    comment = loss 3 times  in a row
    
    +hostdown
    type = loss
    pattern = ==0%,==0%,==0%,==U
    comment = No response
    
    
    *** Database ***
    
    step     = 60
    pings    = 60
    
    # consfn mrhb steps total
    
    AVERAGE  0.5   1  1008
    AVERAGE  0.5  12  4320
        MIN  0.5  12  4320
        MAX  0.5  12  4320
    AVERAGE  0.5 144   720
        MAX  0.5 144   720
        MIN  0.5 144   720
    
    *** Presentation ***
    
    template = /opt/smokeping/etc/basepage.html
    htmltitle = yes
    graphborders = no
    charset = utf-8
    
    + charts
    
    menu = Charts
    title = The most interesting destinations
    
    ++ stddev
    sorter = StdDev(entries=>4)
    title = Top Standard Deviation
    menu = Std Deviation
    format = Standard Deviation %f
    
    ++ max
    sorter = Max(entries=>5)
    title = Top Max Roundtrip Time
    menu = by Max
    format = Max Roundtrip Time %f seconds
    
    ++ loss
    sorter = Loss(entries=>5)
    title = Top Packet Loss
    menu = Loss
    format = Packets Lost %f
    
    ++ median
    sorter = Median(entries=>5)
    title = Top Median Roundtrip Time
    menu = by Median
    format = Median RTT %f seconds
    + overview
    
    width = 600
    height = 600
    range = 10h
    
    + detail
    
    width = 600
    height = 600
    unison_tolerance = 2
    
    "Last 3 Hours"    3h
    "Last 30 Hours"   30h
    "Last 10 Days"    10d
    "Last 400 Days"   400d
    
    #+ hierarchies
    #++ owner
    #title = Host Owner
    #++ location
    #title = Location
    
    *** Probes ***
    
    + FPing
    
    binary = /usr/local/sbin/fping
    
    *** Slaves ***
    secrets=/opt/smokeping/etc/smokeping_secrets.dist
    +boomer
    display_name=boomer
    color=0000ff
    
    +slave2
    display_name=another
    color=00ff00
    
    *** Targets ***
    
    probe = FPing
    
    menu = Top
    title = Network Latency Grapher
    remark = Welcome to the SmokePing website of CCBY Company. 
             Here you will learn all about the latency of our network.
    
    #+ Test
    #menu= Targets
    #parents = owner:/Test/James location:/
    
    #++ James
    
    #menu = James
    #title =James
    #alerts = someloss
    #slaves = boomer slave2
    #host = james.address
    
    
    +Monitor
    menu = Monitor
    title = Host_Monitor
    
    ++BD
    menu = Baoding
    title = BD-Test-DataCenter
    host = /Monitor/BD/BD-node-1 /Monitor/BD/BD-node-2 /Monitor/BD/BD-node-3 /Monitor/BD/BD-node-4 /Monitor/BD/BD-node-5
    
    +++BD-node-1
    menu = BD-X3650
    title =  BD-X3650
    alerts = someloss
    host = 10.50.132.100
    +++BD-node-2
    menu = BD-X3850
    title =  BD-X3850
    alerts = someloss
    host = 10.50.132.141
    +++BD-node-3
    menu = BD-DL380
    title =  BD-DL380
    alerts = someloss
    host = 10.50.132.4
    +++BD-node-4
    menu = BD-KF-DL380
    title =  BD-KF-DL380
    alerts = someloss
    host = 10.50.132.2
    +++BD-node-5
    menu = BD-Z640
    title =  BD-Z640
    alerts = someloss
    #host = 10.50.130.220
    host = 10.50.132.5
    
    ++ MSD
    menu = MSD
    title = MSD-Test-DataCenter
    alerts = someloss
    host = 10.50.100.13
    ++ TH
    menu = TianHe
    title = TianHe-Cluster
    alerts = someloss
    host = 10.50.133.211

    12.启动smokeping

      手动:[root@localhost smokeping]# bin/smokeping --logfile=/var/log/smokeping.log

    自动:

    [root@localhost smokeping]# vim /etc/systemd/system/smokeping.service
    
    [Unit]
    Description=Smokeping Network performance monitoring
    After=syslog.target network.target
    
    [Service]
    ExecStart=/opt/smokeping/bin/smokeping --logfile=/var/log/smokeping.log
    ExecReload=/bin/kill -HUP $MAINPID
    StandardError=syslog
    Type=forking
    PIDFile=/opt/smokeping/var/smokeping.pid
    
    [Install]
    WantedBy=multi-user.target
    
    # 设置完之后重启daemon
    [root@localhost smokeping]# systemctl daemon-reload
    
    [root@localhost smokeping]# systemctl start smokeping

    12.修改apache配置文件,在最下面一行 写入

    [root@localhost smokeping]# vim /etc/httpd/conf/httpd.conf
    
    
    Alias /cache "/opt/smokeping/cache"
    Alias /css "/opt/smokeping/htdocs/css/"
    Alias /js "/opt/smokeping/htdocs/js/"
    Alias /smokeping "/opt/smokeping/htdocs/smokeping.fcgi"
    #
    # Relax access to content within /var/www.
    #
    
    
    <Directory "/opt/smokeping">
    AllowOverride None
    Options All
    AddHandler cgi-script .fcgi .cgi
    Order allow,deny
    Allow from all
    # 密码认证 
    AuthName "admin"
    AuthType Basic
    AuthUserFile /opt/smokeping/htdocs/htpasswd
    Require valid-user
    DirectoryIndex smokeping.fcgi
    </Directory>

    13.启动httpd服务

    systemctl start httpd

    14.关闭防火墙和selinux

  • 相关阅读:
    android studio debug
    SharePoint 2013 单一页面赋设计权限
    sed实现文件自我复制
    iOS第三方支付集成
    移动端报表JS开发演示样例
    马化腾内部分享:产品经理的必修课
    实战c++中的string系列--string与char*、const char *的转换(data() or c_str())
    【React全家桶入门之十】登录与身份认证
    猜拳游戏案例
    Java JDBC利用反射技术将查询结果封装为对象
  • 原文地址:https://www.cnblogs.com/hekuangquanshuiweiteng/p/13361010.html
Copyright © 2020-2023  润新知