- 浏览: 524781 次
- 性别:
- 来自: 广州
文章分类
最新评论
-
xuyifeng:
[img][/img][b][/b][/i]玩儿[i][u][ ...
win/linux 网关绑定MAC,ARP攻击 -
icarusli:
一般是要根据具体情况来分析,只不过基本都会是上面所说的原因,但 ...
nginx 502 bad故障原因及解决方法收集 -
haohetao:
博主有Mydigit邀请码吗,给送个haohetao@gmai ...
U盘量产功能增多
#!/bin/sh
# Nagios V3.03 install script
# Write by zhengyp
#Date:2008-10-8
# Softwares are all store in /usr/local/src
cd /usr/local/src
#Install LAMP for Nagios
# Step 1. Install Apache
tar zxvf httpd-2.2.9.tar.gz
cd httpd-2.2.9
./configure --prefix=/usr/local/apache --enable-so --enable-mods-shared=all
make && make install
#Configure the apache server for PHP
sed -i 's#DirectoryIndex index.html#& index.php#' /usr/local/apache/conf/http.conf
sed -i '/AddType application\/x-gzip .gz .tgz/i\AddType application/x-httpd-php .php\
AddType application/x-httpd-php-source .phps' /usr/local/apache/conf/http.conf
#Step 2. Install Mysql As a server
#Add a mysql user
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
cd ..
tar zxvf mysql-5.1.26-rc.tar.gz
cd mysql-5.1.26-rc/
./configure --prefix=/usr/local/mysql/ --without-debug --with-unix-socket-path=/usr/local/mysql/mysql.sock --with-client-ldflags=-all-static --with-mysqld-ldflags=-all-static --enable-assembler --with-extra-charsets=gbk,gb2312,utf8 --with-pthread --enable-thread-safe-client
make && make install
chmod +w /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql
cp support-files/my-medium.cnf /usr/local/mysql/my.cnf
cd ../
#Initialize the database
#You can change the data directory by set "--datadir="
#mkdir /data
#chown -R mysql:mysql /data
/usr/local/mysql/bin/mysql_install_db --defaults-file=/usr/local/mysql/my.cnf --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/local/mysql/mysql.pid --skip-locking --port=3306 --socket=/tmp/mysql.sock
#Start Mysql
/bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/usr/local/mysql/my.cnf &
#Step 3. Install PHP
#If you use CentOS, Please run yum to check that the graphics library have installed.Also it will update for these softwares
#If you use Redhat , Install the graphics library by "rpm" command
cd ..
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libpng libpng-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc- devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel
tar zxvf php-5.2.6.tar.gz
cd php-5.2.6
./configure --prefix=/usr/local/php5 --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-apxs2=/usr/local/apache/bin/apxs --with-freetype --with-jpeg --with-png --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --with-curl --with-curlwrappers --with-gd --enable-gd-native-ttf --with-openssl
make && make install
cd ..
#Step 4.Install Nagios 3.03
#Add nagios user
adduser nagios
mkdir /usr/local/nagios
chown nagios:nagios /usr/local/nagios
groupadd nagcmd
usermod -G nagcmd nagios
tar zxvf nagios-3.0.3.tar.gz
cd nagios-3.0.3
sed -i 's#wav#x-mplayer2#' cgi/status.c
#Configure and make
./configure --prefix=/usr/local/nagios --with-command-group=nagcmd --with-httpd-conf=/usr/local/apache/conf/httpd.conf --with-gd
make all
make install
make install-init
make install-config
make install-commandmode
#Add a user for nagios ,You can change the passwd for the user you add
/usr/local/apache/bin/htpasswd -c /usr/local/nagios/etc/htpasswd nagios <<EOF
123
123
EOF
sed -i '/AddType application\/x-gzip .gz .tgz/i\AddType application/x-httpd-php .php\
AddType application/x-httpd-php-source .phps' /usr/local/apache/conf/http.conf
sed -i '/<\/IfModule>/a\Alias /nagios/cgi-bin/images/ "/usr/local/nagios/share/images/"\
<Directory "/usr/local/nagios/share/images/">\
AllowOverride None\
Options None\
Order allow,deny\
Allow from all\
AuthType Basic\
AuthName "Login User"\
AuthUserFile /usr/local/nagios/etc/htpasswd\
require user nagios\
</Directory>\
ScriptAlias /nagios/cgi-bin/ "/usr/local/nagios/sbin/"\
<Directory "/usr/local/nagios/sbin/">\
AllowOverride None\
Options None\
Order allow,deny\
Allow from all\
AuthType Basic\
AuthName "Login User"\
AuthUserFile /usr/local/nagios/etc/htpasswd\
require user nagios\
</Directory>\
Alias /nagios/ "/usr/local/nagios/share/"\
<Directory "/usr/local/nagios/share/">\
AllowOverride None\
Options None\
Order allow,deny\
Allow from all\
AuthType Basic\
AuthName "Login User"\
AuthUserFile /usr/local/nagios/etc/htpasswd\
require user nagios\
</Directory>' /usr/local/apache/conf/http.conf
sed -i 's#ServerName www.temple.com:80#ServerName 127.0.0.1#' /usr/local/apache/conf/http.conf
/usr/local/apache/bin/apachectl start
#Step 5. Install Naigos plugins
#Install plugins
cd /usr/local/src
tar xvzf nagios-plugins-1.4.12.tar.gz
cd nagios-plugins-1.4.11
./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios --enable-redhat-pthread-workaround --with-nagios-user=nagios --with-mysql=/usr/local/mysql
make && make install
# Install nrpe
cd /usr/local/src
tar zxvf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure --enable-ssl --with-ssl-lib=/usr/local/nagios/openssl/lib --with-kerberos-inc=/usr/local/nagios/openssl/include --enable-command-args
make;make install
make install-plugin
make install-daemon
make install-daemon-config
chown nagios:nagios /usr/local/nagios/etc/nrpe.cfg
sed 's#dont_blame_nrpe=0#dont_blame_nrpe=1#' /usr/local/nagios/etc/nrpe.cfg
#Add nrpe to service
echo "nrpe 5666/tcp # NRPE" >>/etc/service
echo " " > /etc/xinetd.d/nrpe
sed -i '/ /i\service nrpe\
{\
disable = no\
flags = REUSE\
socket_type = stream\
wait = no\
user = nagios\
server = /usr/local/nagios/bin/nrpe\
server_args = -c /usr/local/nagios/etc/nrpe.cfg --inetd\
log_on_failure += USERID\
only_from = 192.168.0.200 #nagiosServer IP\
}' /etc/xinetd.d/nrpe
#Step 6. Configure Naigos
#Add the user who you've create in step 4 by htpasswd for nagios
cd /usr/local/nagios/etc
sed -i 's#default_user_name=guest#default_user_name=nagios' cgi.cfg
sed -i 's#=nagiosadmin#=nagiosadmin,nagios' cgi.cfg
#Start nagios
/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg
service nagios start
#Step 7 . Set all servers start after system boot
echo "/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg" >> /etc/rc.local
echo "service nagios start" >> /etc/rc.local
echo "/bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/usr/local/mysql/my.cnf &" >> /etc/rc.local
echo "/usr/local/apache/bin/apache/bin/apachectl start" >> /etc/rc.local
发表评论
-
重启Drac卡
2013-01-10 22:54 1502Drac重启。 有个卡的WEb也连不上,重启后正常了。 s ... -
Nginx下WordPress设置Rewrite(含二级域名跳转)
2011-09-28 16:05 15993Apache 在Apache下,利用mod_rewrite来实 ... -
NFS 性能调优
2011-10-10 23:11 1687NFS 性能调优 在 NFS 网络中,服务器是调优的主要目标, ... -
NFS 檔案分享
2011-09-27 03:13 01 NFS 的用途 2 掛 ... -
NFS,Memcached,Tokyo tyrant实现session共享性能测试
2011-09-27 03:04 0<p>在我负责的某个 ... -
php open_basedir安全与性能的取舍
2011-09-27 02:53 9677open_basedir 严重影响PHP I/O性能 这是昨 ... -
php include 和io流的效率
2011-09-27 02:36 2534之前看了,平凡的世界大大的一篇文章 <a href=&q ... -
eAccelerator 配置(PHP代码加速器)
2011-09-27 02:33 1546eAccelerator是一个自 ... -
php-cgi日志php-fpm出现setrlimit(RLIMIT_NOFILE) failed 错误
2011-09-15 18:40 12288tail -n 100 php-fpm.log[WARNI ... -
Centos下安装rrdtool
2011-01-29 12:46 1540yum install ruby*rpm -ivh rr ... -
Linux环境下不重新编译php添加扩展模块
2011-01-29 12:41 3944添加ftp模块为例子进入源码目录cd php-5.2.8 ... -
IIS出现HTTP500内部错误以及COM+8004e00f错误的解决办法(MSDTC) COM+无法与Microsoft分布式事务协调程序交谈
2010-07-23 11:38 1644IIS出现HTTP500内部错误以 ... -
应用程序池 'DefaultApppool' 提供服务的进程意外终止
2010-06-23 17:13 4775问题描述:1,机器中毒,杀过毒。2,IIS6方式重启服务是正常 ... -
nfs 共享session方式 session_start 慢 问题解决
2010-06-13 15:30 4456近几天php搭建了个新的运行平台,但出了个问题, ... -
nginx的rewrite 参数和例子
2010-06-11 14:19 2160正则表达式匹配,其中: * ~ 为区分大小写匹配 * ... -
no input file specified nginx 多个虚拟主机
2010-06-11 03:12 11211今天配置nginx rewrite 的时候遇到一个问题,就是访 ... -
nginx 502 bad故障原因及解决方法收集
2010-06-11 01:09 17999如题,最近网站频繁出现502错误,简直无法正常运转 ... -
Nginx的Rewrite配置
2010-06-08 01:21 1951Nginx的Rewrite经过网上 ... -
nginx二级域名匹配根目录下的子文件夹
2010-05-24 00:23 12194绑定域名 server_name *.abcd.com; 获取 ... -
nginx虚拟目录(alias与root的区别)
2010-05-24 00:20 2387nginx貌似没有虚拟目录的说法,因为它本来 ...
相关推荐
一个全攻略的Nagios+Centreon+Nrpe+PHP+Mysql+NSClient完全安装
nagios+cacti+npc需要的软件
nagios+cacti 安装教程
组合监控,可以满足各种需求,功能较多,缺点是安装过于麻烦,
手把手实现企业级开源监控软件cacti+nagios+ntop整合(无图)
nagios+mysql 安装文档
nagios服务端ndoutile+nagios+nagios_plugins.rarnagios服务端ndoutile+nagios+nagios_plugins.rar
本文档的手册是本人安装的时候一步步写的,文件包含了(nagios+php+Apache)+安装配置手册一份;
nagios+centreon是一款新型的运维监控工具,图文并茂的教你如何监控好自己的服务器的各种应用。
Nagios+nagiosql配置的配置文档,欢迎交流
Nagios+Cacti短息报警+邮件转发
Nagios+Centreon+Nrpe+NSClient++完全配置笔记
nagios+cacti+ndoutils+NPC.docx
手把手实现企业级开源监控软件cacti+nagios+ntop整合(图解).doc手把手实现企业级开源监控软件cacti+nagios+ntop整合(图解).doc
服务器状态监控软件安装部署和配置指导文档
Nagios+Cacti详细配置及应用 望对大家有帮助
nagios centreon详述了nagios+centreon详细配制方法和 使用
实现企业级开源监控软件cacti+nagios+ntop整合
很好的一篇文章,真的很好,超好,good