设为首页 收藏本站
查看: 2165|回复: 0

[经验分享] Smokeping安装

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-9-20 10:40:38 | 显示全部楼层 |阅读模式
系统centos6.X
1、配置固定IP地址
2、关闭iptables
3、关闭selinux
4、安装其他yum源
rpm -Uvh http://ftp.pbone.net/mirror/apt. ... 1.el6.rf.x86_64.rpm
5、安装依赖包
        yum -y install perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-RadiusPerl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI perl-FCGI perl-CGI-SpeedCGI perl-Time-HiRes perl-ExtUtils-MakeMaker perl-RRD-Simple rrdtool rrdtool-perl curl fping echoping  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_fastcgi screen httpd

注:perl-CGI-SpeedyCGI,perl-CGI-SpeedCGI这两个包在安装过程中会提示找不到,但没关系
注:用yum安装大量的依赖包还是很方便的,而百度上有些关于安装smokeping的文档要求使用wget下载后再用make,make install方式安装,虽然make方式不复杂,但通过make编译再安装几十个包就显得有点繁锁了。

6、下载安装smokeping
        wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.8.tar.gz
        tar zxvf smokeping-2.6.8.tar.gz
        cd smokeping-2.6.8
        ./configure --prefix=/usr/local/smokeping
        出现问题是因为需要安装perl的模块,所以运行下面内容即可
        ./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
        ./configure --prefix=/usr/local/smokeping
        /usr/bin/gmake install

7、配置smokeping
         cd /usr/local/smokeping
         mkdir cache data var
        touch /var/log/smokeping.log
        chown apache:apache cache data var
        chown apache:apache /var/log/smokeping.log
cd /usr/local/smokeping/htdocs/
mv smokeping.fcgi.dist smokeping.fcgi
cd /usr/local/smokeping/etc
mv config.dist config
vim config
cgiurl   = http://some.url/smokeping.cgi
主要是修改这行,把some.url修改为你的ip或者域名
*** Database ***
step  = 300
pings  = 60
然后修改step,从300改为60,这是检测的时间, pings 从20 改为60, 即60秒ping 60次

8、修改密码权限
chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist

9、安装网站服务
        yum -y install httpd*
已经做过了·······


10、修改网站服务配置文件

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
DirectoryIndex smokeping.fcgi
</Directory>

11、设置开启启动httpd、smokeping、关闭iptables
echo "/usr/local/smokeping/bin/smokeping --logfile=/var/log/smokeping.log 2>&1 &" >> /etc/rc.local
        chkconfig httpd on      #开机启动httpd进程
        chkconfig iptables off  #开机不启动iptables服务

12、启动服务

/etc/init.d/httpd start
/usr/local/smokeping/bin/smokeping --logfile=/var/log/smokeping.log 2>&1 &

13、打开web验证
在Web浏览器里输入 http://您的监控主机IP/smokeping


注:
如果遇到500错误:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
--------------------------------------------------------------------------------
Apache/2.2.15 (CentOS) Server at 192.168.2.101 Port 80

说明没有关闭SElinux 选项,关闭就正常了
vi /etc/sysconfig/selinux
SELINUX=permissive

临时关闭selinux
setenforce 0
[iyunv@localhost ~]# getenforce     #查看SElinux 的命令
Permissive                      #返回的结果是Permissive, 表示已经关闭SElinux了



特别注意如果web界面出现软件错误那么需要执行一条命令即可
mv /usr/local/smokeping/thirdparty/lib/perl5/Carp/Heavy.pm /usr/local/smokeping/thirdparty/lib/perl5/Carp/Heavy.pm.bak


13、添加密码验证


修改httpd.conf里的内容

<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>

进入cd /usr/local/smokeping/htdocs目录, 执行命令:htpasswd -c /usr/local/smokeping/htdocs/htpasswd admin
这个是设置登录账户为admin,密码在后面输入,然后重启httpd就可以实现密码验证登录



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-274864-1-1.html 上篇帖子: smokeping报警问题探讨? 下篇帖子: Centos6.5搭建smokeping服务
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表