Install nagios on linux

http://assets.nagios.com/downloads/nagioscore/docs/Installing_Nagios_Core_From_Source.pdf

-----------------------------------

The Industry Standard in IT Infrastructure Monitoring

Purpose
This document describes how install Nagios Core and Nagios Plugins from source on CentOS and Ubuntu servers.
Target Audience
This document is intended for use by anyone wishing to install Nagios Core from source.
Prerequisites
For Ubuntu users, run all steps from this document with root permissions.  The following command can be run to switch to a root shell.
sudo -i
Package requirements may vary depending on what type of installation platform Nagios is being installed on.   
For RHEL/CentOS users:
yum install -y wget httpd php gcc glibc glibc-common gd gd-devel make net-snmp
For Ubuntu users:
sudo apt-get install wget install build-essential apache2 php5-gd wget libgd2-xpm libgd2-xpm-dev
libapache2-mod-php5
Download Nagios Core and Nagios Plugins Tarballs
For all systems, run the following commands in your terminal:
cd /tmp
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.4.1.tar.gz
wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz
This will download Nagios Core, and it's required plugins.
Adding the Nagios User and Group
Next add the appropriate user and group for the Nagios process to run:
useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
Page 1
Copyright © 2010-2011 Nagios Enterprises, LLC
Revision 1.0 – October, 2012
 Nagios – Installing Nagios Core From Source
Nagios Enterprises, LLC US: 1-888-NAGIOS-1 Web: www.nagios.com
P.O. Box 8154
Saint Paul, MN 55108
USA
Int'l: +1 651-204-9102 Email: sales@nagios.com
Fax: +1 651-204-9103Nagios Core Installation
tar zxvf nagios-3.4.1.tar.gz 
tar zxvf nagios-plugins-1.4.15.tar.gz 
Change to the new Nagios directory and install the packages:
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
All systems:
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 
Create a Default User for Web Access.  
Add a default user for Web Interface Access:
htpasswd –c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Nagios Plugin Installation
cd /tmp/nagios-plugins-1.4.15 
./configure --with-nagios-user=nagios --with-nagios-group=nagios 
make 
make install 
Page 2
Copyright © 2010-2011 Nagios Enterprises, LLC
Revision 1.0 – October, 2012
 Nagios – Installing Nagios Core From Source
Nagios Enterprises, LLC US: 1-888-NAGIOS-1 Web: www.nagios.com
P.O. Box 8154
Saint Paul, MN 55108
USA
Int'l: +1 651-204-9102 Email: sales@nagios.com
Fax: +1 651-204-9103Nagios Service Setup
The following commands will register the Nagios daemon to be run upon system startup.  
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
Nagios Web Interface
After correctly following the procedures you should now be
able to access your Nagios Core installation from a web
browser. 
Simply use the following:
http://<your.nagios.server.ip>/nagios
And log in with the credentials you chose when adding the
nagiosadmin user to the htpasswd.users file.
Finishing Thoughts
If you have further questions please visit our support forum
at:
http://support.nagios.com/forum/
Nagios Core Documentation:
http://library.nagios.com/library/products/nagioscore/manuals/



(

After this, login the web browser, it wil show an internal server error, to solve this, we need to turn off the selinux function
  于是关闭系统的SELINUX安全防护功能,

# vi /etc/selinux/config

设置SELINUX=disabled,即禁用SELINUX安全防护

然后重启服务器,访问nagios也就正常了,不会报Internal Server Error错误


)


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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值