smokeping

Smokeping

1.yum groupinstall "Compatibility libraries" "Base" "Development tools" –y

2.yum -y install cpan perl perl-FCGI perl-CGI perl-Digest-HMAC perl-Net-Telnet perl-Net-OpenSSH perl-Net-SNMP perl-LDAP perl-Net-DNS perl-IO-Pty-Easy perl-Test-Simple perl-Sys-Syslog perl-libwww-perl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI perl-FCGI perl-Time-HiRes perl-ExtUtils-MakeMaker rrdtool rrdtool-perl curl fping 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 mod_fcgid screen

3.安装echoping
tar xvf echoping-6.0.2.tar.gz
cd echoping-6.0.2
./configure --prefix=/usr/local/echoping

报错:
configure: error: Missing popt library, get it fromftp://ftp.rpm.org/pub/rpm/dist/rpm-x.y.z
解决办法:
yum install -y popt-devel

继续报错:
configure: error: Get the GNU libidn library (http://www.josefsson.org/libidn/) in order to use Unicode - multi-script - domain names or use --without-libidn to disable it
解决办法:
./configure --prefix=/usr/local/echoping --with-ssl --without-libidn

报错:
configure: error: Get the OpenSSL library (http://www.openssl.org/)
解决办法:
yum install -y openssl openssl-devel

make && make install

4.安装smokeping
下载地址:http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz
tar -xvf smokeping-2.6.11.tar.gz
cd smokeping-2.6.11
#export PERL5LIB=/usr/local/smokeping/thirdparty/lib/perl5/
#./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
#./configure --prefix=/usr/local/smokeping
#gmake install


如果./configure过程中提示找不到某些perl扩展,如下所示
checking checking for perl module‘Config::Grammar‘... Can‘t locate Config/Grammar.pm in @INC (@INC contains:/usr/local/smokeping/thirdparty/lib/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5/usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5/usr/share/perl5 .) at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
请使用以下命令安装对应模块:
perl -MCPAN -e 'install Config::Grammar'
注意:有时候需要重复安装几次才能装上模块。

5.创建相关目录和日志文件(因为这里的web服务器使用的是httpd,所以相关文件的属主属组均为apache)

cd /usr/local/smokeping
mkdir cache data var 
touch /var/log/smokeping.log 
chown apache.apache cache/ data/ var/ /var/log

6.创建相关配置文件
#fcgi文件
cp /usr/local/smokeping/htdocs/smokeping.fcgi.dist /usr/local/smokeping/htdocs/smokeping.fcgi
#主配置文件
cp /usr/local/smokeping/etc/config.dist /usr/local/smokeping/etc/config

7.修改配置文件

#指定cgi的url地址为本机
sed -i 's#cgiurl   = http://some.url/smokeping.cgi#cgiurl   = http://192.168.248.128/smokeping.cgi#g' /usr/local/smokeping/etc/config
#指定检测的时间为60秒
sed -i 's#step     = 300#step     = 60#g' /usr/local/smokeping/etc/config 
#指定ping的次数为60
sed -i 's#pings    = 20#pings    = 60#g' /usr/local/smokeping/etc/config

将step和pings都设置为60表示每60秒ping60次。

8.修改字符集和字体支持中文

vim /usr/local/smokeping/etc/config
***Presentation *** # 加在 ***Presentation *** 后面
charset = utf-8

yum -y install wqy-zenhei-fonts

编辑vim /usr/local/smokeping/lib/Smokeping/Graphs.pm
my $val = 0;
for my $host (@hosts){
my ($graphret,$xs,$ys) = RRDs::graph
 ("dummy",
'--start', $tasks[0][1],
'--end', $tasks[0][2],
'--font TITLE:20"WenQuanYiZen Hei Mono"',
"DEF:maxping=$cfg->{General}{datadir}${host}.rrd:median:AVERAGE",
'PRINT:maxping:MAX:%le' );
my $ERROR = RRDs::error();

9.修改apache配置文件增加登录验证

htpasswd -c /usr/local/smokeping/htdocs/htpasswd smokeping
chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist

10.修改httpd.conf增加smokeping的web界面

在httpd.conf末尾添加如下内容

vim /etc/httpd/conf/httpd.conf 

#########changed by jack 2018/5/03##############
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
AllowOverride AuthConfig
Order allow,deny
Allow from all
AuthName "Smokeping"
AuthType Basic
AuthUserFile /usr/local/smokeping/htdocs/htpasswd
Require valid-user
DirectoryIndex smokeping.fcgi
</Directory>

11.添加监控对象
vim /usr/local/smokeping/etc/config
*** Targets ***
++ Localhost
menu = Localhost
title = Localhost
alerts = someloss
#slaves = boomer slave2
host = 192.168.248.128

12.添加监控节点

注意:每次修改配置文件后需要重启smokeping进程

usr/local/smokeping/bin/smokeping --restart
或
/usr/local/smokeping/bin/smokeping --reload
或
pkill smokeping
/usr/local/smokeping/bin/smokeping

/usr/local/smokeping/bin/smokeping –restart

报错:
ERROR: /usr/local/smokeping/bin/../etc/config, line 109: ERROR: FPing 'binary' does not point to an executable
解决办法:
wget http://www.fping.org/dist/fping-4.0.tar.gz
tar xvf fping-4.0.tar.gz
cd fping-4.0/
./configure
make && make install 
chown root:root /usr/local/sbin/fping
chmod u+s /usr/local/sbin/fping
vim /usr/local/smokeping/etc/config

报错:
WARNING: Hostname 'james.address' does currently not resolve to an IPv6 or IPv4 address
ERROR: Can not read pid from /usr/local/smokeping/var/smokeping.pid: No such file or directory
解决:
touch /usr/local/smokeping/var/smokeping.pid
把下面的几行注释给去掉


可以正常访问:http://192.168.248.128/smokeping


监控节点样例如下,注意+是第一层,++是第二层,+++ 是第三层:

vim /usr/local/smokeping/etc/config
加在最后
+ Other
menu = 三大网络监控
title = 监控统计
++ dianxin
menu = 电信网络监控
title = 电信网络监控列表
host = /Other/dianxin/dianxin-bj /Other/dianxin/dianxin-hlj /Other/dianxin/dianxin-tj /Other/dianxin/dianxin-sc /Other/dianxin/dianxin-sh /Other/dianxin/dianxin-gz
+++ dianxin-bj
menu = 北京电信
title = 北京电信
alerts = someloss
host = 202.96.199.133
 
+++ dianxin-hlj
menu = 黑龙江电信
title = 黑龙江电信
alerts = someloss
host = 219.147.198.242
 
+++ dianxin-tj
menu = 天津电信
title = 天津电信
alerts = someloss
host = 219.150.32.132
 
+++ dianxin-sc
menu = 四川电信
title = 四川电信
alerts = someloss
host = 61.139.2.69
 
+++ dianxin-sh
menu = 上海电信
title = 上海电信
alerts = someloss
host = 116.228.111.118
 
+++ dianxin-gz
menu = 广东电信
title = 广东电信
alerts = someloss
host = 113.111.211.22
 
++ liantong
menu = 联通网络监控
title = 联通网络监控列表
host = /Other/liantong/liantong-bj /Other/liantong/liantong-hlj /Other/liantong/liantong-tj  /Other/liantong/liantong-sc /Other/liantong/liantong-sh /Other/liantong/liantong-gz
 
+++ liantong-bj
menu = 北京联通
title = 北京联通
alerts = someloss
host = 61.135.169.121
 
+++ liantong-hlj
menu = 黑龙江联通
title = 黑龙江联通
alerts = someloss
host = 202.97.224.69
 
+++ liantong-tj
menu = 天津联通
title = 天津联通
alerts = someloss
host = 202.99.96.68
 
+++ liantong-sc
menu = 四川联通
title = 四川联通
alerts = someloss
host = 119.6.6.6
 
+++ liantong-sh
menu = 上海联通
title = 上海联通
alerts = someloss
host = 210.22.84.3
 
+++ liantong-gz
menu = 广东联通
title = 广东联通
alerts = someloss
host = 221.5.88.88
 
++ yidong
menu = 移动网络监控
title = 移动网络监控列表
host = /Other/yidong/yidong-bj /Other/yidong/yidong-hlj /Other/yidong/yidong-tj /Other/yidong/yidong-sc  /Other/yidong/yidong-sh /Other/yidong/yidong-gz
 
+++ yidong-bj
menu = 北京移动
title = 北京移动
alerts = someloss
host = 221.130.33.52
 
+++ yidong-hlj
menu = 黑龙江移动
title = 黑龙江移动
alerts = someloss
host = 211.137.241.35
 
+++ yidong-tj
menu = 天津移动
title = 天津移动
alerts = someloss
host = 211.137.160.5
 
+++ yidong-sc
menu = 四川移动
title = 四川移动
alerts = someloss
host = 218.201.4.3
 
+++ yidong-sh
menu = 上海移动
title = 上海移动
alerts = someloss
host = 117.131.19.23
 
+++ yidong-gz
menu = 广东移动
title = 广东移动
alerts = someloss
host = 211.136.192.6

smokeping会根据配置文件中配置监控节点的内容,在/usr/local/smokeping/data目录下生成对应的moniter文件夹,其下包含website子文件夹。

13.	启动服务并测试

systemctl start httpd
/usr/local/smokeping/bin/smokeping

在浏览器中访问 http://192.168.248.128/smokeping 输入刚才配置的验证账号smokeing和密码123456即可 (就是刚才上面设置的密码)


可以看到添加的节点的相关信息。


可以看到添加的监控点的ping状态

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
智慧校园整体解决方案是响应国家教育信息化政策,结合教育改革和技术创新的产物。该方案以物联网、大数据、人工智能和移动互联技术为基础,旨在打造一个安全、高效、互动且环保的教育环境。方案强调从数字化校园向智慧校园的转变,通过自动数据采集、智能分析和按需服务,实现校园业务的智能化管理。 方案的总体设计原则包括应用至上、分层设计和互联互通,确保系统能够满足不同用户角色的需求,并实现数据和资源的整合与共享。框架设计涵盖了校园安全、管理、教学、环境等多个方面,构建了一个全面的校园应用生态系统。这包括智慧安全系统、校园身份识别、智能排课及选课系统、智慧学习系统、精品录播教室方案等,以支持个性化学习和教学评估。 建设内容突出了智慧安全和智慧管理的重要性。智慧安全管理通过分布式录播系统和紧急预案一键启动功能,增强校园安全预警和事件响应能力。智慧管理系统则利用物联网技术,实现人员和设备的智能管理,提高校园运营效率。 智慧教学部分,方案提供了智慧学习系统和精品录播教室方案,支持专业级学习硬件和智能化网络管理,促进个性化学习和教学资源的高效利用。同时,教学质量评估中心和资源应用平台的建设,旨在提升教学评估的科学性和教育资源的共享性。 智慧环境建设则侧重于基于物联网的设备管理,通过智慧教室管理系统实现教室环境的智能控制和能效管理,打造绿色、节能的校园环境。电子班牌和校园信息发布系统的建设,将作为智慧校园的核心和入口,提供教务、一卡通、图书馆等系统的集成信息。 总体而言,智慧校园整体解决方案通过集成先进技术,不仅提升了校园的信息化水平,而且优化了教学和管理流程,为学生、教师和家长提供了更加便捷、个性化的教育体验。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值