js06金沙官网登录-js06.com-欢迎您

来自 计算机 2019-12-19 08:40 的文章
当前位置: js06金沙官网登录-js06.com-欢迎您 > 计算机 > 正文

金沙官网登录Smokeping配置,

Smokeping配置,

参考文档:

 本文简单介绍smokeping的安装配置操作。 

一.环境

金沙官网登录,1. OS

Server:10.11.4.250/CentOS-7-x86_64-1511 

2. Smokeping版本

smokeping-2.6.11:

二.安装Smokeping 

1. 安装EPEL

#epel版本有可能变更,变更后不一定能下载
[[email protected] ~]# rpm -Uvh http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm
[[email protected] ~]# yum install foo -y

2. 安装依赖&环境

#其中本人遇到的问题有,未预安装"wqy*"导致中文显示的问题;没有预安装"perl-Sys-Syslog",在"gmake install"阶段有报错
[[email protected] ~]# yum install -y rrdtool wqy* fping echoping curl bind-utils httpd httpd-devel perl perl-FCGI perl-CGI perl-CGI-SpeedyCGI perl-CGI-SpeedyCGI perl-libwww-perl perl-Socket6 perl-Net-Telnet perl-Net-OpenSSH perl-Net-DNS perl-LDAP perl-IO-Socket-SSL perl-ExtUtils-MakeMaker rrdtool-perl perl-Sys-Syslog perl-RadiusPerl perl-Time-HiRes perl-RRD-Simple libxml2-devel libpng-devel glib pango pango-devel freetype freetype-devel fontconfig cairo cairo-devel libart_lgpl libart_lgpl-devel mod_fastcgi

3. 编译安装

#请注意在configure前需要先build相应的perl模块,否则有报错。
[[email protected] ~]# cd /usr/local/src/
[[email protected] src]# wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz
[[email protected] src]# tar -zxvf smokeping-2.6.11.tar.gz
[[email protected] src]# cd smokeping-2.6.11
[[email protected] smokeping-2.6.11]# ./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
[[email protected] smokeping-2.6.11]# ./configure --prefix=/usr/local/smokeping
[[email protected] smokeping-2.6.11]# gmake install

三.配置Smokeping 

1. config文件配置

#创建程序运行相关目录并赋权
[[email protected] smokeping-2.6.11]# cd /usr/local/smokeping/ 
[[email protected] smokeping]# mkdir var cache data
[[email protected] smokeping]# chown apache:apache var/ cache/ data/

#生成cgi文件与config文件
[[email protected] smokeping]# cp /usr/local/smokeping/htdocs/smokeping.fcgi.dist /usr/local/smokeping/htdocs/smokeping.fcgi
[[email protected] smokeping]# cp /usr/local/smokeping/etc/config.dist /usr/local/smokeping/etc/config

1)General配置

#修改 cgiurl,General及Alerts等是config文件多个section之一
[[email protected] smokeping]# sed -i 's|some.url|10.11.4.250|g' /usr/local/smokeping/etc/config

2)Alerts配置

#someloss部分注释默认配置,重设监测机制
[[email protected] smokeping]# vim /usr/local/smokeping/etc/config
+someloss
type = loss
# in percent
#pattern = >0%,*12*,>0%,*12*,>0%
#comment = loss 3 times  in a row

pattern = ==0%,>2%,>2%,>2%
comment = 每次发出60个包,连续3次轮询检查丢包率在2%以上

#新增rtt监测机制
+rttdetect
type = rtt
# in milliseconds
pattern = <55,<55,<55,>55,>55,>55
comment = 每次发出60个包,连续3次轮询检查延时超过55毫秒

3)Database配置

# 默认300秒 ping 20次,修改为120秒 ping 30次
[[email protected] smokeping]# sed -i 's|step = 300|step = 120|g' /usr/local/smokeping/etc/config
[[email protected] smokeping]# sed -i 's|pings = 20|pings = 30|g' /usr/local/smokeping/etc/config

4)Presentation配置

#在presentation下添加utf-8中文字符集
*** Presentation ***
charset = utf-8

#在presentation下detail部分,注释默认历史数据展示时间,重设数值
+ detail

width = 600
height = 200
unison_tolerance = 2

#"Last 3 Hours"    3h
#"Last 30 Hours"   30h
#"Last 10 Days"    10d
#"Last 400 Days"   400d

"Last 10 Minutes" 10m
"Last 30 Minutes" 30m
"Last 4 Hours" 4h
"Last 12 Hours" 12h
"Last 1 Days" 24h
"Last 3 Days" 3d
"Last 1 Weeks" 7d
"Last 1 Mouths" 30d
"Last Half years" 180d
"Last 1 years" 365d 

2. 修改账号文件权限

#修改密码文件权限为root只读
[[email protected] smokeping]# chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist

3. Apache配置

#设置登录账户及密码
[[email protected] smokeping]# htpasswd -c /usr/local/smokeping/htdocs/htpasswd mcloudadmin
New password:
Re-type new password:

#httpd文件配置,在“DocumentRoot "/var/www/html"”段下新增smokeping相关配置,请注意路径等强相关设置的前后一致性
[[email protected] smokeping]# vim /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html"

Alias /cache "/usr/local/smokeping/cache/"
Alias /cropper "/usr/local/smokeping/htdocs/cropper/"
Alias /smokeping "/usr/local/smokeping/htdocs/smokeping.fcgi"

<Directory "/usr/local/smokeping">
    AllowOverride None
    Options All
    AddHandler cgi-script .fcgi .cgi
    Order allow,deny
    Allow from all
    AuthName "Smokeping"
    AuthType Basic
    AuthUserFile /usr/local/smokeping/htdocs/htpasswd
    Require valid-user
    DirectoryIndex smokeping.fcgi
</Directory> 

4. 设置iptables

[[email protected] smokeping]# vim /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT

[[email protected] smokeping]# service iptables restart

5. 设置开机启动

[[email protected] smokeping]# echo "/usr/local/smokeping/bin/smokeping &">> /etc/rc.local

四.添加Smokeping监控点 

1. 注意事项

添加smokeping监控点本质上还是修改config文件,主要修改"Targets"章节。

注意事项:

2. 配置示例

#以下是一个简单的两层目录层级配置示例:
[[email protected] smokeping]# vim /usr/local/smokeping/etc/config
*** Targets ***

probe = FPing

menu = Top
title = 网络质量监测系统
remark = SmokePing.<br> 
         您在这里可以观察到网络质量.

+ IDC
menu = IDC网络质量
title = 网络质量监控统计

++ All_Monitor
menu = 网络质量总图
title = 网络质量总图
host = /IDC/CoreSwitch /IDC/AccessSwitch

++ CoreSwitch

menu = 监控点至核心
title = 监控点至核心
alerts = someloss
host = 10.10.24.1

++ AccessSwitch

menu = 监控点至接入
title = 监控点至接入
alerts = someloss
host = 10.11.4.1 

五.验证

1. 启动服务

[[email protected] ~]# systemctl start httpd
[[email protected] ~]# /usr/local/smokeping/bin/smokeping &

金沙官网登录 1

2. URL登陆

URL登录:

输入前文设置的apache账号/密码登录,即可登录smokeping控制台。

1)HomePage

可以看到,登录账号为前文设置的mcloudadmin,首页及左侧目录都是在config文件的"Targets"章节做的设置。

金沙官网登录 2

2)目录层级

金沙官网登录 3

3)历史数据展示时间

在config文件Presentation章节的detail部分设置。

金沙官网登录 4

4)监测取样点

在config文件Database章节。

金沙官网登录 5

参考文档: 本文简单介绍 smokeping 的安装配置操作。 一.环境 1. OS Server : 10.11.4.250/CentOS-7-x86_64-1511 2. Smokeping版本 smokeping...

本文由js06金沙官网登录-js06.com-欢迎您发布于计算机,转载请注明出处:金沙官网登录Smokeping配置,

关键词: