What is Nagios?Nagios® is a system and network monitoring application. It watches hosts and services that you specify, alerting you when things go bad and when they get better. Nagios was originally designed to run under Linux, although it should work under most other unices as well. Some of the many features of Nagios® include:
System RequirementsThe following software packages is required to run Nagios server.
Steps to install NagiosBecome a super user user@server:~# sudo su - Password: Install the GCC compiler and GD libraries root@server:~# apt-get install build-essential libgd2-dev Create "nagios" user and "nagios" group root@server:~# useradd -d /opt/nagios -m nagios root@server:~# groupadd nagios Now we add Apache user (www-data) and Nagios user (nagios) to Nagios group (nagios) root@server:~# usermod -G nagios nagios root@server:~# usermod -G nagios www-data Download latest source code tarball of Nagios from http://www.nagios.org/download. You may create a directory to store this files. root@server:~# mkdir ~/downloads root@server:~# cd ~/downloads root@server:~# wget <url_to_download> Extract the Nagios tar file. root@server:~# tar zxfv nagios-<version>.tar.gz root@server:~# cd nagios-<version> Run the Nagios configure script. root@server:~# ./configure --prefix=/opt/nagios --with-cgiurl=/nagios/cgi-bin --with-htmurl=/nagios --with-command-group=nagios If the previous command comes back without reporting any errors you can run the following commands. If errors are reported, fix them and run “make clean” before running the previous command again. root@server:~# make all root@server:~# make install root@server:~# make install-init root@server:~# make install-config root@server:~# make install-commandmode root@server:~# make install-webconfig Create nagiosadmin account for logging into Nagios web interface. root@server:~# htpasswd -c /opt/nagios/etc/htpasswd.users nagiosadmin Password: Now you may reload Apache's configuration to make new settings take effect. root@server:~# /etc/init.d/apache2 reload Nagios plugin installationDownload latest source code tarball of Nagios plugin from http://www.nagios.org/download. root@server:~# cd ~/downloads root@server:~# wget <url_to_download> Extract the Nagios plugin tar file. root@server:~# tar zxfv nagios-plugin-<version>.tar.gz root@server:~# cd nagios-plugin-<version> Run the Nagios plugin configure script. root@server:~# ./configure --prefix=/opt/nagios --with-cgiurl=/nagios/cgi-bin --with-htmurl=/nagios --with-command-group=nagios Now compile and install it. root@server:~# make root@server:~# make install Verify and start the NagiosVerify the Nagios configuration files. root@server:~# /opt/nagios/bin/nagios -v /opt/nagios/etc/nagios.cfg If no errors, you can start the Nagios server. root@server:~# /etc/init.d/nagios start
|
|||

Post new comment