nagios快速部署
2014-01-05 11:25
288 查看
1. 编译安装apache
./configure –prefix=/usr/local/php \ –with-apxs2=/usr/local/apache/bin/apxs \ –with-config-file-path=/usr/local/php \ –enable-mbstring=all –disable-debug –enable-opcache –enable-soap –enable-shmop –enable-sockets –enable-sysvmsg –enable-sysvsem –enable-sysvshm
–enable-bcmath –enable-exif –enable-mysqlnd –enable-xml –enable-inline-optimization –enable-zip –with-iconv –with-zlib –with-curl –with-mcrypt –with-gd –with-xmlrpc –with-openssl –with-mysql=mysqlnd –with-mysqli=mysqlnd –enable-ftp –with-jpeg-dir –with-freetype-dir
–with-png-dir –with-bz2 –with-xpm-dir –enable-mbregex –enable-mbstring
2. 编译安装php
./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache246/bin/apxs –with-config-file-path=/usr/local/php –with-iconv-dir=/usr/local/libiconv1.14 –with-zlib –with-gd –with-mcrypt=/usr/local/libmcrypt-2.5.7 –with-mysql –with-mysqli –enable-mbstring
–with-pcre-dir –with-pear=/usr/local/php/lib/php
3. DNAT测试
sudo /sbin/iptables -t nat -A PREROUTING -p tcp -d 192.168.0.246 –dport 80 -j DNAT –to-destination 192.168.85.224
4. 编译安装nagios
tar xvf nagios-4.6.1.tar.gz -C /usr/local/src/
cd /usr/local/src/nagios-4.6.1
groupadd nagcmd
useradd nagios
usermod -a nagcmd nagios
./configure –prefix=/usr/local/nagios –with-nagios-user=nagios –with-command-group=nagcmd –with-httpd-conf=/usr/local/apache246/conf/extra
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
make install-exfoliation
make install-classicui
cp -R contrib/eventhandlers /usr/local/nagios/libexec/ chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
/usr/local/nagios/bin/nagios -V /usr/local/nagios/etc/nagios.cfg /etc/init.d/nagios start
/etc/init.d/httpd246 start
5. 添加验证用户
/usr/local/apache246/bin/htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
6. 安装nagios-plugin
wget https://www.nagios-plugins.org/download/nagios-plugins-1.5.tar.gz
tar xvf nagios-plugins-1.5.tar.gz -C /usr/local/src/
cd /usr/local/src/nagios-plugins-1.5/
./configure –with-nagios-user=nagios –with-nagios-group=nagios make make install
7. 使服务开机自启动
chkconfig –add nagios
chkconfig –level 35 nagios on
chkconfig –add httpd246
chkconfig –level httpd246 on
8. 在被监控的服务器上安装nrpe
wget http://jaist.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
tar xvf nrpe-2.15.tar.gz -C /usr/local/src/
cd /usr/local/src/nrpe-2.15
./configure –prefix=/usr/local/php \ –with-apxs2=/usr/local/apache/bin/apxs \ –with-config-file-path=/usr/local/php \ –enable-mbstring=all –disable-debug –enable-opcache –enable-soap –enable-shmop –enable-sockets –enable-sysvmsg –enable-sysvsem –enable-sysvshm
–enable-bcmath –enable-exif –enable-mysqlnd –enable-xml –enable-inline-optimization –enable-zip –with-iconv –with-zlib –with-curl –with-mcrypt –with-gd –with-xmlrpc –with-openssl –with-mysql=mysqlnd –with-mysqli=mysqlnd –enable-ftp –with-jpeg-dir –with-freetype-dir
–with-png-dir –with-bz2 –with-xpm-dir –enable-mbregex –enable-mbstring
2. 编译安装php
./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache246/bin/apxs –with-config-file-path=/usr/local/php –with-iconv-dir=/usr/local/libiconv1.14 –with-zlib –with-gd –with-mcrypt=/usr/local/libmcrypt-2.5.7 –with-mysql –with-mysqli –enable-mbstring
–with-pcre-dir –with-pear=/usr/local/php/lib/php
3. DNAT测试
sudo /sbin/iptables -t nat -A PREROUTING -p tcp -d 192.168.0.246 –dport 80 -j DNAT –to-destination 192.168.85.224
4. 编译安装nagios
tar xvf nagios-4.6.1.tar.gz -C /usr/local/src/
cd /usr/local/src/nagios-4.6.1
groupadd nagcmd
useradd nagios
usermod -a nagcmd nagios
./configure –prefix=/usr/local/nagios –with-nagios-user=nagios –with-command-group=nagcmd –with-httpd-conf=/usr/local/apache246/conf/extra
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
make install-exfoliation
make install-classicui
cp -R contrib/eventhandlers /usr/local/nagios/libexec/ chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
/usr/local/nagios/bin/nagios -V /usr/local/nagios/etc/nagios.cfg /etc/init.d/nagios start
/etc/init.d/httpd246 start
5. 添加验证用户
/usr/local/apache246/bin/htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
6. 安装nagios-plugin
wget https://www.nagios-plugins.org/download/nagios-plugins-1.5.tar.gz
tar xvf nagios-plugins-1.5.tar.gz -C /usr/local/src/
cd /usr/local/src/nagios-plugins-1.5/
./configure –with-nagios-user=nagios –with-nagios-group=nagios make make install
7. 使服务开机自启动
chkconfig –add nagios
chkconfig –level 35 nagios on
chkconfig –add httpd246
chkconfig –level httpd246 on
8. 在被监控的服务器上安装nrpe
wget http://jaist.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
tar xvf nrpe-2.15.tar.gz -C /usr/local/src/
cd /usr/local/src/nrpe-2.15
相关文章推荐
- AMI BIOS修改
- iOS Dev (15) TabBarController + NavigationController基础示例
- 【iOS7的一些总结】3、视图控制器ViewControllers之间的数据传递(2)
- Cocoa 框架 For iOS(二)对象的分配初始化、内省、单
- iOS Developer Library Frameworks
- iOS图形处理1(缩小/放大图像)
- iOS7.X越狱工具evasi0n7存重大bug 切勿急于越狱
- IOS之MVC
- iOS Dev (14) NavigationController基础示例
- 程序设计之MVC工作分配,关于客户端开发之我鉴(三)
- xcode5切换IOS7,IOS6,IOS5模拟器
- IOS宏定义汇总
- 小总结
- (转载优质文)定制iOS 7中的导航栏和状态栏
- IOS学习之路 之 icon 启动画面
- IOS 绘制背景色渐变的矩形
- iOS 7: 如何为iPhone 5s编译64位应用
- IOS开发入门之设计模式
- IOS 之 界面开发设计的一些资料
- nagios笔记