频道栏目
首页 > 资讯 > 虚拟机 > 正文

Smokeping在Vmware下的搭建

18-07-18        来源:[db:作者]  
收藏   我要投稿

安装环境为Vmware workstation pro 14 + Centos7

一、安装smokeping

安装 repo epel

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

安装smokeping所依赖的环境

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 fping perl-core

用 wget 获取 smokeping 的安装包并编译

wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz
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

cd /usr/local/smokeping/mkdir cache data vartouch /var/log/smokeping.logchown apache:apache cache data varchown apache:apache /var/log/smokeping.logchmod?600?/usr/local/smokeping/etc/smokeping_secrets.distcd /usr/local/smokeping/htdocscp smokeping.fcgi.dist smokeping.fcgicd /usr/local/smokeping/etccp config.dist config??vim /usr/local/smokeping/etc/config主要修改如下内容:#cgiurl = http://some.url/smokeping.cgicgiurl = http://publicIP/smokeping.cgi??*** Database ***#step =?300step =?60?#此处建议改为?60?, 一分钟采集一次数据pings =?20

二、修改 apache 配置文件

htpasswd -c /usr/local/smokeping/htdocs/htpasswd kirito
New password: 
Re-type new password: 
Adding password for user kirito    #设置登陆密码

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"

AllowOverride None
Options All
AddHandler cgi-script .fcgi .cgi
Order allow,deny
Allow from all
AuthName "Smokeping"
AuthType Basic
AuthUserFile /usr/local/smokeping/htdocs/htpasswd
Require valid-user
DirectoryIndex smokeping.fcgi
三、创建 smokeping 启动脚本
touch /etc/init.d/smokeping
vim /etc/init.d/smokeping 
#!/bin/bash
#
# chkconfig: 2345 80 05
# Description: Smokeping init.d script
# Hacked by : How2CentOS - http://www.how2centos.com
# Get function from functions library
. /etc/init.d/functions
# Start the service Smokeping
start() {
        echo -n "Starting Smokeping: "
        /usr/local/smokeping/bin/smokeping >/dev/null 2>&1
        ### Create the lock file ###
        touch /var/lock/subsys/smokeping
        success $"Smokeping startup"
        echo
}
# Restart the service Smokeping
stop() {
        echo -n "Stopping Smokeping: "
        kill -9 `ps ax | grep "/usr/local/smokeping/bin/smokeping" | grep -v grep | awk '{ print $1 }'` >/dev/null 2>&1
        ### Now, delete the lock file ###
        rm -f /var/lock/subsys/smokeping
        success $"Smokeping shutdown"
        echo
}
### main logic ###
case "$1" in
start)
        start
        ;;
stop)
        stop
        ;;
status)
        status smokeping
        ;;
restart|reload|condrestart)
        stop
        start
        ;;
*)
        echo $"Usage: $0 {start|stop|restart|reload|status}"
        exit 1
esac
exit 0
chmod 755 /etc/init.d/smokeping

启动httpd和smokeping/etc/init.d/httpd start/etc/init.d/smokeping start

相关TAG标签
上一篇:firejail sandbox解析Docker核心原理依赖详解
下一篇:es_head插件自动化部署实例教程
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站