After nagios installation end up
- Nagios and plugins is installed in /usr/local/nagios
- Nagios to monitor of your system ( CPU load, disk usage, etc.)
- Nagios web interface at http://localhost/nagios/
Nagios installation the prerequisites
You are sure installed the packages below before install nagios- Apache
- PHP
- GCC compiler
- GD development libraries
Nagios installation
you can check the packages Apache, PHP, GCC compiler and GD development libraries installed in your system use command line below:rpm -qa
[root@localhost ~]# rpm -qa gcc glibc glibc-common httpd php gd gd-develOR
glibc-2.17-55.el7.x86_64
glibc-common-2.17-55.el7.x86_64
gcc-4.8.2-16.el7.x86_64
httpd-2.4.6-17.el7.centos.1.x86_64
php-5.4.16-21.el7.x86_64
yum list installed
[root@localhost ~]# yum list installedyou can install the packages use command line below ( as root):
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.vhost.vn
* extras: mirror.vietoss.com
* updates: mirror.vietoss.com
Installed Packages
ModemManager-glib.x86_64 1.1.0-6.git20130913.el7 @anaconda
NetworkManager.x86_64 1:0.9.9.1-13.git20140326.4dba720.el7 @anaconda
NetworkManager-glib.x86_64 1:0.9.9.1-13.git20140326.4dba720.el7 @anaconda
NetworkManager-tui.x86_64 1:0.9.9.1-13.git20140326.4dba720.el7 @anaconda
acl.x86_64 2.2.51-12.el7 @anaconda
aic94xx-firmware.noarch 30-6.el7 @anaconda
alsa-firmware.noarch 1.0.27-2.el7 @anaconda
alsa-lib.x86_64 1.0.27.2-3.el7 @anaconda
alsa-tools-firmware.x86_64 1.0.27-4.el7 @anaconda
apr.x86_64 1.4.8-3.el7 @anaconda
yum install -y httpd php
yum install -y gcc glibc glibc-common
yum install -y gd gd-devel
Create Account for nagios
useradd -m nagiosCreate group for nagios and nagios user, apache user to group
passwd nagios
groupadd nagiosgroupDownload nagios and the plugins
usermod -a -G nagiosgroup nagios
usermod -a -G nagiosgroup apache
mkdir ~/downloadsCompile and install Nagios
cd ~/downloads
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz
wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
cd ~/downloads
tar zxvf nagios-4.0.8.tar.gz
cd nagios-4.0.8
./configure --with-command-group=nagiosgroup
make all
make install
make install-init
make install-config
make install-commandmode
Configure nagios
Sample configuration file are installed in /usr/local/nagios/etc/ directoryConfigure the web interface
make install-webconfCreate a nagiosadmin account for logging into the web interface
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadminRestart Apapche
service httpd restartCompile and install the nagios Plugins
cd ~/downloads
tar zxvf nagios-plugins-2.0.3.tar.gz
cd nagios-plugins-2.0.3
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
Start Nagios
Enable nagios automatically start when the system bootchkconfig --add nagiosVerify the sample Nagios configuration file
chkconfig nagios on
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgStart nagios
service nagios startYou done! you have nagios installation in centos 7
Modify SELinux
Default SELinux in Enforcing mode. This is result in "Internal Server Erros" message when you access the Nagios CGIs.check SELinux is in mode.
getenforceSet SELinux into Permissive mode use command line
setenforce 0To make this change permanent you edit in /etc/selinux/config file and reboot
Login to the web interface
http://localhost/nagios/Or ip address of nagios
http://192.168.1.132/nagios/
I hope will this help you!
Copyright by: www.linuxoperatingsystem.info http://goo.gl/kMscJ4
0 comments:
Post a Comment