One, Nagios installation:
1 , install the following command:
This is a few system commands that I use to define my own plugin when I monitor my service. Do not install.
(1)iostat: monitoring disk IO information:
Apt-getinstall Sysstat
(2)Ifstat: monitoring network information:
Apt-getinstall Ifstat
(3)gnuplot: Drawing:
Apt-getinstall gnuplot
2 , ensure that the following packages are installed:
assuming no installation, use Apt-get to install these packages, use the following command:
sudo apt-get install apache2sudo apt-get install libapache2-mod-php5sudo apt-get install build-essentialsudo apt-get install Libgd2-devOrsudo apt-get install Libgd2-xpm-dev3, create user information:BecomeRootUser. Create aNagiosUser and Set Password:/usr/sbin/useradd-m-s/bin/bash Nagiospasswd Nagios
To add a new nagcmd Group:
/usr/sbin/groupadd Nagcmd/usr/sbin/usermod-a-G nagcmd Nagios/usr/sbin/usermod-a-G nagcmd www-data4, downloadNagiosand its plugins:wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.3.tar.gz http://www.nagios.org/download/plugins/ Download Nagios inPluginsThese two compressed packages are Zctech The file folder has been downloaded well.5 , compiling and installing Nagios :
Installation path is /usr/local/
Cd/usr/local
nagios-3.2.3.tar.gz < Span style= "FONT-SIZE:14PX;" > Copy to /usr/local
tar xzf nagios-3.2.3.tar.gz CD nagios-3.2.3 ./configure--with-command-group=nagcmd make all Make Install Make install-init Make install-config Make Install-commandmode
6 , define your own configuration:
The configuration file is installed in the /usr/local/nagios/etc folder .
The specific configuration is added to the service after the installation is complete.
7 , configure the Web interface
To install the Nagios web configuration file:
Make install-webconf
To create an account login Web interface, remember password:
Htpasswd-c/usr/local/nagios/etc/htpasswd.users Nagiosadmin
Restart Apache :
/etc/init.d/apache2 Reload
8 , compile and install nagiosplugins :
Installation path is /usr/local/
Cd/usr/local
tar xzf nagios-plugins-2.0.3.tar.gz CD nagios-plugins-2.0.3 make make install 9 , start Nagios :
Boot start:
Ln-s/etc/init.d/nagios/etc/rcs.d/s99nagios
To verify the configuration file:
/usr/local/nagios/bin/nagios-v/usr/local/nagios/etc/nagios.cfg
If there are no errors, start Nagios.
/etc/init.d/nagios StartTen, LoginWebInterface:Address bar Enter the following URL. You can log in. In this case, use the account set earlier, for example nagiosadmin and password.http://localhost/nagios/ Successful login means Nagios successfully installed.
Nagios installation configuration (includes Nrpe side) full (one)