Smokeping安装教程

smokeping安装步骤

    • 机器准备
    • 安装依赖包
    • 源码编译安装
    • 配置smokeping配置文件
    • 新建smokeping目录
    • 修改config配置文件
    • 创建用户
    • 修改http配置文件
    • 添加监控内容
    • 启动http和smokeping
    • 通过网页访问

机器准备

[root@localhost ~]# uname -r
3.10.0-862.el7.x86_64
[root@localhost ~]# cat /etc/redhat-release 
CentOS Linux release 7.5.1804 (Core) 

安装依赖包

yum -y install epel-release wget make gcc openssl openssl-devel rrdtool rrdtool-perl perl-core perl mod_fcgid perl-CPAN httpd httpd-devel curl bind-utils gcc make vim gcc-c++ perl-LWP-Protocol-https wqy-microhei-fonts
yum -y install perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-IO-Socket-SSL perl-Socket6 perl-Time-HiRes perl-ExtUtils-MakeMaker 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 rrdtool rrdtool-perl

下载fping,echoping,smokeping,可以去链接选择任意版本(推荐smokeping 10以上版本)

# wget http://www.fping.org/dist/fping-3.0.tar.gz
# wget https://fossies.org/linux/misc/old/echoping-6.0.2.tar.gz
# wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz

源码编译安装

 tar xf fping-3.0.tar.gz 
 cd fping-3.0
 ./configure && echo $?
 make ; make install
tar xf echoping-6.0.2.tar.gz 
cd echoping-6.0.2
./configure
make ; make install
tar xf smokeping-2.6.11.tar.gz 
cd smokeping-2.6.11
./setup/build-perl-modules.sh   /usr/local/smokeping/thirdparty
./configure --prefix=/usr/local/smokeping
/usr/bin/gmake install

配置smokeping配置文件

[root@localhost smokeping-2.6.11]# cd /usr/local/smokeping/
[root@localhost smokeping]# ls
bin  etc  htdocs  lib  share  thirdparty
#etc为重要配置目录

新建smokeping目录

cd /usr/local/smokeping
mkdir cache data var log location
touch /usr/local/smokeping/log/smokeping.log
chown -R apache:apache /usr/local/smokeping
cd etc 
cp config.dist config  #配置文件将后缀为dist的全部替换
cp /usr/local/smokeping/htdocs/smokeping.fcgi.dist  /usr/local/smokeping/htdocs/smokeping.fcgi

修改config配置文件

vim /usr/local/smokeping/etc/config
cgiurl   = http://192.168.25.100/smokeping.cgi
step     = 60
pings    = 60
template = /opt/smokeping/etc/basepage.html
height = 200
height = 600
binary = /usr/local/sbin/fping
secrets=/opt/smokeping/etc/smokeping_secrets
在*** Presentation ***下添加
charset = utf-8 使其支持中文

创建用户

chmod 600 smokeping_secrets
htpasswd -c /usr/local/smokeping/htdocs/htpasswd admin

修改http配置文件

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 "admin"
AuthType Basic
AuthUserFile /usr/local/smokeping/htdocs/htpasswd
Require valid-user
DirectoryIndex smokeping.fcgi
</Directory>

添加监控内容

vim /usr/local/smokeping/etc/config
*** Targets ***中将Test模块注释
+ NetMonitor
menu = 三大网络监控
title = 监控统计

++ dianxin
menu = 电信网络监控
title = 电信网络监控列表
host = /NetMonitor/dianxin/dianxin-bj

+++ dianxin-bj
menu = 北京电信
title = 北京电信
alerts = someloss
host = 202.96.199.133

+++ dianxin-sc
menu = 四川电信
title = 四川电信
alerts = someloss
host = 61.139.2.69

++ liantong
menu = 联通网络监控
title = 联通网络监控列表
host = /NetMonitor/liantong/liantong-bj

+++ liantong-bj
menu = 北京联通
title = 北京联通
alerts = someloss
host = 61.135.169.121

+++ liantong-gz
menu = 广东联通
title = 广东联通
alerts = someloss
host = 221.5.88.88

++ yidong
menu = 移动网络监控
title = 移动网络监控列表
host = /NetMonitor/yidong/yidong-sc

+++ yidong-sc
menu = 四川移动
title = 四川移动
alerts = someloss
host = 218.201.4.3

+++ yidong-gz
menu = 广东移动
title = 广东移动
alerts = someloss
host = 211.136.192.6

启动http和smokeping

systemctl restart httpd
/usr/local/smokeping/bin/smokeping

通过网页访问

Smokeping安装教程_第1张图片

你可能感兴趣的:(Smokeping安装教程)