smokeping

目录

安装脚本

#!/bin/bash

/etc/init.d/iptables stop
chkconfig iptables off
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config



yum install wget httpd rrdtool fping echoping curl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-CGI-SpeedyCGI perl-libwww-perl perl-RadiusPerl perl-IO-Socket-SSL perl-Socket perl-Socket6 dig perl  perl-Socket6perl-CGI-SpeedyCGI rrdtool-perl -y
yum install cpan -y



mkdir -p /data/soft/
cd /data/soft/
wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.8.tar.gz
mv smokeping-2.6.8.tar.gz\?a\=1 smokeping-2.6.8.tar.gz


tar zxf smokeping-2.6.8.tar.gz
cd smokeping-2.6.8

#install 
#可能需要反复多执行几次
./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
./configure --prefix=/usr/local/smokeping
/usr/bin/gmake install


#config
cp /usr/local/smokeping/etc/config.dist /usr/local/smokeping/etc/config
mkdir -p /usr/local/smokeping/{var,cache,data}
chmod 400 /usr/local/smokeping/etc/smokeping_secrets.dist
chown -R apache:apache  /usr/local/smokeping/cache
chown -R apache:apache /usr/local/smokeping/htdocs/
cp /usr/local/smokeping/bin/smokeping_cgi /usr/local/smokeping/htdocs/index.cgi

wget http://oss.oetiker.ch/smokeping/pub/contrib/smokeping-start-script 
mv smokeping-start-script /etc/init.d/smokeping
chmod +x /etc/init.d/smokeping

#配置http
sed -i '/index.cgi/!s/^DirectoryIndex\(.*\)/DirectoryIndex\1 index.cgi/g' /etc/httpd/conf/httpd.conf
cat >>/etc/httpd/conf/httpd.conf<< EOF
Listen 8080
<VirtualHost *:8080>
Alias /cache/ "/usr/local/smokeping/cache/"
DocumentRoot  /usr/local/smokeping/htdocs
<Directory "/usr/local/smokeping/htdocs">
Options FollowSymLinks ExecCGI
AllowOverride None
AddHandler cgi-script cgi
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
EOF

/etc/init.d/smokeping start
/etc/init.d/httpd start





目录