nagios服务端安装

1.1.1解决perl编译问题:

echo “export LC_ALL=C” >> /etc/profile

source /etc/profile

echo $LC_ALL

1.1.2解决系统时间同步

echo  "*/10 * * * * /usr/sbin/ntpdate pool.ntp.org >/dev/null 2>&1" >> /var/spool/cron/root

1.1.3安装基础包:

yum install gcc glibc-common -y 

yum install gd gd-devel -y

yum install httpd php* -y

1.3创建需要的用户及组

useradd -m nagios    useradd apache

uermod -s /sbin/nologin  nagios

groupadd nacmd

usermod -a -G nagcmd nagios 

usermod -a -G nagcmd apache

编译安装naigos

./configure --with-command-group=nagcmd 

make all;make install;make install-init;make install-config ;make install-commandmode

make install-webconf ;

编译安装的apache --with-httpd-conf=/usr/local/apache2/conf/extra要指定nagios的conf


创建nagios界面用户htpasswd -c /usr/local/nagios/etc/htpasswd.users user1根据nagios配置选择


修改监控报警email,sed -i ‘s#nagios@localhost#your@email .com /usr/local/nagios/etc/objects/contacts.cfg'

service sendemail start


安装插件软件包:

tar zxf nagios-plugins-1.4.13.tar.gz

./configure --with-nagios-user=nagios --with-nagios-group=nagios --enable-perl-modules

   make如果出现错误error 2,需要加上--with-mysql=/usr/local/mysql

加入到开启启动 chkconfig --add nagios

验证配置文件:nagios -v /usr/local/nagios/etc/nagios.cfg

selinux需要把-t设为http的上下文


安装nrpe:make install-plugin;make install-daemon;makeinstalll-daemon-config服务端要安装,不然会缺少插件



转载于:https://my.oschina.net/TJWian/blog/631311

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值