Nagios系统搭建

来源:互联网 发布:双口网络信息插座 编辑:程序博客网 时间:2024/05/11 12:47

参考并转载: Nagios系统搭建: http://assets.nagios.com/downloads/nagioscore/docs/Installing_Nagios_Core_From_Source.pdf 

http://10.136.149.96/nagios/
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-4.0.2.tar.gz
wget https://www.nagios-plugins.org/download/nagios-plugins-1.5.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

Nagios Core Installation
tar zxvf nagios-4.0.2.tar.gz 
tar zxvf nagios-plugins-1.5.tar.gz 
Change to the new Nagios directory and install the packages:
cd nagios-4.0.2
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.5 
./configure --with-nagios-user=nagios --with-nagios-group=nagios 
make 
make install

Nagios 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
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.

0 0