nagios服务端搭建

原文链接: http://hi.baidu.com/liuchangwengo/item/c837b5681c6cbb92c4d2492b

 

1.环境搭建(centos\redhat    和 ubuntu)

yum install -y wget httpd phpgcc glibc glibc-common gd gd-devel make net-snmp

(For Ubuntu users:

sudo apt-get install wgetinstall build-essential apache2 php5-gd wget libgd2-xpm libgd2-xpm-dev

libapache2-mod-php5)

 


useradd nagios

groupadd nagcmd

usermod -a -G nagcmd nagios

 


2.软件包下载:

cd /tmp

wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.4.1.tar.gz

wgethttp://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz

 


3.两个软件包的安装


tar zxvf nagios-3.4.1.tar.gz

tar zxvfnagios-plugins-1.4.15.tar.gz

cd nagios

For RHEL/CentOS users:

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

For Ubuntu users:

./configure--with-nagios-group=nagios --with-command-group=nagcmd -–with-mail=/usr/bin/sendmail

Allsystems:

make all

make install

make install-init

make install-config

make install-commandmode

make install-webconf


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

For RHEL/CentOS users:

/etc/init.d/httpd start

htpasswd –c/usr/local/nagios/etc/htpasswd.users nagiosadmin

cd /tmp/nagios-plugins-1.4.15

./configure--with-nagios-user=nagios --with-nagios-group=nagios

make

make install

chkconfig --add nagios

chkconfig --level 35 nagios on

chkconfig --add httpd

chkconfig --level 35 httpd on

 


For Ubuntu:

ln -s /etc/init.d/nagios/etc/rcS.d/S99nagios

http://<your.nagios.server.ip>/nagios


联入Nagios的CGI时导致一个"内部服务错误"消息。
如果是SELinux处于强制安全模式时需要做
getenforce
令SELinux处于容许模式
setenforce 0
如果要永久性更变它,需要更改/etc/selinux/config里的设置并重启系统。
不关闭SELinux或是永久性变更它的方法是让CGI模块在SELinux下指定强制目标模式:
chcon ‐R ‐t httpd_sys_content_t /usr/local/nagios/sbin/
chcon ‐R ‐t httpd_sys_content_t /usr/local/nagios/share/

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值