CENTOS7 搭建smokeping

机器配置:1核CPU,2G内存,2M带宽, 节点:广东地区 线路:BGP宽带 服务商:睿江云

一、关闭selinux,避免出错 [root@ecloud ~]# setenforce 0 ##临时关闭selinux [root@ecloud ~]# vi /etc/selinux/config ##永久关闭selinux CENTOS7 搭建smokeping_第1张图片 修改成以下内容 #SELINUX=enforcing SELINUX=disabled :wq ##保存

重启后查看selinux状态 输入图片说明 显示selinux已关闭

二、安装 lrzsz并上传源码包 [root@ecloud ~]# yum -y install lrzsz 输入图片说明 安装完成! [root@ecloud ~]# rz ##上传相应的源码包 CENTOS7 搭建smokeping_第2张图片 三、安装依赖包 [root@ecloud ~]# yum install -y perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-IO-Socket-SSL perl-Socket6 perl-Time-HiRes perl-ExtUtils-MakeMaker rrdtool rrdtool-perl curl httpd httpd-devel gcc make wget libxml2-devel libpng-devel glib pango pango-devel freetype freetype-devel fontconfig cairo cairo-devel libart_lgpl libart_lgpl-devel popt popt-devel libidn libidn-devel CENTOS7 搭建smokeping_第3张图片 安装完成。

四、安装fping [root@ecloud ~]# tar zxvf fping-3.10.tar.gz ##解压fping源码包 [root@ecloud ~]# cd fping-3.10 ##进入解压后的文件目录路径 [root@ecloud fping-3.10]# ./configure ##安装fping [root@ecloud fping-3.10]# make && make install ##编译 CENTOS7 搭建smokeping_第4张图片 五、安装echoping [root@ecloud ~]# tar zxvf echoping-6.0.2.tar.gz ##解压echoping源码包 [root@ecloud ~]# cd echoping-6.0.2 ##进入解压后的文件目录路径 [root@ecloud echoping-6.0.2]# ./configure ##安装echoping [root@ecloud echoping-6.0.2]# make && make install ##编译 CENTOS7 搭建smokeping_第5张图片 六、安装smokeping [root@ecloud ~]# tar zxvf smokeping-2.6.9.tar.gz [root@ecloud ~]# cd smokeping-2.6.9 [root@ecloud smokeping-2.6.9]# ./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty [root@ecloud smokeping-2.6.9]# ./configure --prefix=/usr/local/smokeping [root@ecloud smokeping-2.6.9]# /usr/bin/gmake install

七、创建相关的日志文件和配置文件 [root@ecloud ~]# cd /usr/local/smokeping [root@ecloud smokeping]# mkdir cache data var [root@ecloud smokeping]# touch /var/log/smokeping.log [root@ecloud smokeping]# chown apache:apache cache data var [root@ecloud smokeping]# chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist [root@ecloud smokeping]# cd /usr/local/smokeping/htdocs [root@ecloud htdocs]# mv smokeping.fcgi.dist smokeping.fcgi [root@ecloud htdocs]# cd /usr/local/smokeping/etc [root@ecloud etc]# mv config.dist config

八、修改配置文件 [root@ecloud etc]# vi /usr/local/smokeping/etc/config

修改成以下内容 #cgiurl = http://some.url/smokeping.cgi ##添加注释 cgiurl = http://XX.XX.XX.XX/smokeping.cgi ##XX.XX.XX.XX为主机IP

step = 60 pings = 30

九、修改HTTP配置文件 [root@ecloud ~]# vi /etc/httpd/conf/httpd.conf 在文件的最后添加以下内容 Alias /cache "/usr/local/smokeping/cache/" Alias /cropper "/usr/local/smokeping/htdocs/cropper/" Alias /smokeping "/usr/local/smokeping/htdocs/smokeping.fcgi" AllowOverride None Options All AddHandler cgi-script .fcgi .cgi Order allow,deny Allow from all DirectoryIndex smokeping.fcgi

十、修改字符集和字体支持中文 [root@ecloud ~]# yum -y install wqy-zenhei-fonts.noarch CENTOS7 搭建smokeping_第6张图片 [root@ecloud ~]# vi /usr/local/smokeping/etc/config charset = utf-8 ##在Presentation下添加此行 输入图片说明 [root@ecloud ~]# vim /usr/local/smokeping/lib/Smokeping/Graphs.pm '--font TITLE:20"WenQuanYi Zen Hei Mono"', ##添加此行,添加位置如下图 CENTOS7 搭建smokeping_第7张图片 十一、修改smokeping配置文件中fping的安装目录 [root@ecloud ~]# which fping ##查找fping安装目录 [root@ecloud ~]# vim /usr/local/smokeping/etc/config 修改smokeping配置文件 binary = /usr/local/sbin/fping ##修改为查找到的目录 CENTOS7 搭建smokeping_第8张图片 十二、设置网页权限 [root@ecloud ~]# htpasswd -c /usr/local/smokeping/htdocs/htpasswd smokeping New password: Re-type new password: ##账号是smokeping,密码自行设置 [root@ecloud ~]# chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist ##添加授权验证

十三、设置环境变量 [root@ecloud ~]# echo 'export PATH=/usr/local/smokeping/bin/:$PATH' >> /etc/profile

十四、启动http和smokeping [root@ecloud ~]#/etc/init.d/httpd start [root@ecloud ~]#/usr/local/smokeping/bin/smokeping

十五、设置开机启动 [root@ecloud ~]# echo "/usr/local/smokeping/bin/smokeping --logfile=/var/log/smokeping.log 2>&1 &" >> /etc/rc.local

十六、关闭防火墙 [root@ecloud ~]# service iptables stop

浏览器输入 http://IP/smokeping 查看网页 CENTOS7 搭建smokeping_第9张图片! 添加需要监控的IP vim /usr/local/smokeping/etc/config ##在文件的最后添加需要ping的IP

举个例子:

  • Other  menu = 测试  title = 测试  ++ dianxin  menu = 电信网络监控  title = 电信网络监控列表  +++ dianxin-bj  menu = 北京电信  title = 北京电信  alerts = someloss  host = 202.96.199.133 

由睿江云运维人员提供,想了解更多,请登陆www.eflycloud.com

转载于:https://my.oschina.net/u/3363053/blog/1154208

你可能感兴趣的:(CENTOS7 搭建smokeping)