首页 > 代码库 > CentOS 6.5搭建Smokeping平台(下)
CentOS 6.5搭建Smokeping平台(下)
1、添加监控点
[root@i-uiiyw0xz ~]# vi /usr/local/smokeping/etc/config ##添加以下内容## + Other menu = 三大网络监控 title = 监控统计 ++ dianxin menu = 电信网络监控 title = 电信网络监控列表 host = /Other/dianxin/dianxin-bj +++ dianxin-bj menu = 北京电信 title = 北京电信 alerts = someloss host = 202.96.199.133 ++ liantong menu = 联通网络监控 title = 联通网络监控列表 host = /Other/liantong/liantong-bj +++ liantong-bj menu = 北京联通 title = 北京联通 alerts = someloss host = 61.135.169.121 ++ yidong menu = 移动网络监控 title = 移动网络监控列表 #host = /Other/yidong/yidong-bj +++ yidong-bj menu = 北京移动 title = 北京移动 alerts = someloss host = 221.130.33.52
2、处理中文乱码
[root@i-uiiyw0xz ~]# yum -y install wqy-zenhei-fonts [root@i-uiiyw0xz ~]# vi /usr/local/smokeping/lib/Smokeping/Graphs.pm if ($mode =~ /[anc]/){ 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:"WenQuanYi Zen Hei Mono"‘, ##增加该行 "DEF:maxping=$cfg->{General}{datadir}${host}.rrd:median:AVERAGE", ‘PRINT:maxping:MAX:%le‘ ); my $ERROR = RRDs::error(); return "<div>RRDtool did not understand your input: $ERROR.</div>" if $ERROR; $val = $graphret->[0] if $val < $graphret->[0]; } $val = 1e-6 if $val =~ /nan/i; $max = { $tasks[0][1] => $val * 1.5 }; }
3、用户认证
[root@i-uiiyw0xz ~]# vi /etc/httpd/conf/httpd.conf <Directory "/usr/local/smokeping"> AllowOverride None Options All AddHandler cgi-script .fcgi .cgi Order allow,deny Allow from all AllowOverride AuthConfig ##添加用户认证 AuthName "smokeping" AuthType Basic AuthUserFile /usr/local/smokeping/htdocs/htpasswd Require vaild-user DirectoryIndex smokeping.fcgi </Directory> [root@i-uiiyw0xz ~]# htpasswd -c /usr/local/smokeping/htdocs/htpasswd admin New password: ##设置账号口令 Re-type new password: Adding password for user admin
4、重启httpd和smokeping
[root@i-uiiyw0xz ~]# /usr/sbin/httpd -t httpd: Could not reliably determine the server‘s fully qualified domain name, using 127.0.1.1 for ServerName Syntax OK [root@i-uiiyw0xz ~]# /usr/sbin/httpd -k graceful httpd: Could not reliably determine the server‘s fully qualified domain name, using 127.0.1.1 for ServerName [root@i-uiiyw0xz ~]# ps aux |grep smokeping root 8785 0.0 0.0 103244 852 pts/0 S+ 09:36 0:00 grep smokeping root 15722 0.0 0.2 231860 10384 ? Ss Aug09 0:23 ./smokeping [FPing] [root@i-uiiyw0xz ~]# kill 15722 [root@i-uiiyw0xz ~]# /usr/local/smokeping/bin/smokeping WARNING: Hostname ‘james.address‘ does currently not resolve to an IPv6 or IPv4 address Note: logging to syslog as local0/info. Daemonizing /usr/local/smokeping/bin/smokeping ...
5、验证效果
本文出自 “Gorilla City” 博客,请务必保留此出处http://juispan.blog.51cto.com/943137/1956095
CentOS 6.5搭建Smokeping平台(下)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。