Nagios on CentOS

来自开放百科 - 灰狐
跳转到: 导航, 搜索

Prerequisites

  • Apache HTTP Server
  • GCC compiler
  • GD development libraries
yum install httpd
yum install gcc
yum install glibc glibc-common
yum install gd gd-devel

Create a new nagios user account and give it a password.

/usr/sbin/useradd nagios
passwd nagios

Create a new nagcmd group

/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -G nagcmd nagios
/usr/sbin/usermod -G nagcmd apache

Download

wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0rc2.tar.gz
wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz
tar xzf nagios-3.0rc2.tar.gz
cd nagios-3.0rc2

Build

./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode

Configuration

vi /usr/local/nagios/etc/objects/contacts.cfg

Configure the Web Interface

make install-webconf
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
service httpd restart

Compile and Install the Nagios Plugins

tar xzf nagios-plugins-1.4.11.tar.gz
cd nagios-plugins-1.4.11
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

Start Nagios

chkconfig --add nagios
chkconfig nagios on
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
service nagios start

Modify SELinux Settings

getenforce
setenforce 0
chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
chcon -R -t httpd_sys_content_t /usr/local/nagios/share/

Login to the Web Interface

http://localhost/nagios/
username (nagiosadmin) and password you specified earlier

参考: http://nagios.sourceforge.net/docs/3_0/quickstart-fedora.html

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱