Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1840262
  • 博文数量: 293
  • 博客积分: 10127
  • 博客等级: 上将
  • 技术积分: 3029
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-12 19:05
文章分类

全部博文(293)

文章存档

2011年(11)

2010年(282)

我的朋友

分类: BSD

2010-08-20 23:22:35

#!/bin/sh
ipfw add allow ip from any to any
fetch
fetch
#add user
pw adduser nagios -w random
#passwd nagios
#nagios-plugins-1.4.9.tar.gz
tar xzvf nagios-plugins-1.4.15.tar.gz
tar xzvf nrpe-2.12.tar.gz
cd nagios-plugins-1.4.15
./configure --prefix=/usr/local/nagios  &&make &&make install
chown nagios:nagios /usr/local/nagios
chown -R nagios:nagios /usr/local/nagios/libexec
cd ..
#nrpe-2.8.1.tar.gz
cd nrpe-2.12
./configure     
make all 
make install-plugin
make install-daemon
make install-daemon-config
#ipfw
ipfw add allow tcp from 121.9.211.44 to me 5666
ipfw add allow tcp from me 5666 to 121.9.211.44
echo "ipfw add allow tcp from 121.9.211.44 to me 5666" >> /etc/ipfw.conf
echo "ipfw add allow tcp from me 5666 to 121.9.211.44" >>/etc/ipfw.conf
                                           
#mkdir -p /opt/nagios/etc                             
#mkdir -p /opt/nagios/bin                             
#cp sample-config/nrpe.cfg /opt/nagios/etc/           
#cp src/nrpe  /opt/nagios/bin/                        
#sed -i 's/127.0.0.1/127.0.0.1,121.9.13.195/' /usr/local/nagios/etc/nrpe.cfg
#sed -i 's/usr\/local/opt/g' /opt/nagios/etc/nrpe.cfg 
sed -in-place -e 's/127.0.0.1/127.0.0.1,121.9.211.44/g' /usr/local/nagios/etc/nrpe.cfg
sed -in-place -e 's/hda1/da0s1f/g' /usr/local/nagios/etc/nrpe.cfg
 
#start                                                    
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d"   >>/etc/rc.local
ipfw delete `ipfw list | grep "allow ip from any to any" | awk '{print $1}'`
阅读(1238) | 评论(0) | 转发(0) |
0

上一篇:cut命令的用法

下一篇:非常经典的取IP

给主人留下些什么吧!~~