Let us discuss the overview, installation and configuration of Nagios, a powerful open source monitoring solution for host and services. II. 8 steps for installing nagios on Linux: III. Configuration files overview . Following is a partial screenshot of the nagios web dashboard: Download following files from Nagios.org and move to /home/downloads.
Following are some additional parameters that you can pass to ./configure to customize your installation. I used only --with-command-group as shown above. At the end of the configure output, it will display a summary as shown below: Note: On Red Hat, the ./configure command mentioned above did not work and was hanging at the when it was displaying the message: checking for redhat spopen problem… Add –enable-redhat-pthread-workaround to the ./configure command as a work-around for the above problem as shown below. Nagios Web URL: http://localhost/nagios/ . Following are the three major configuration files located under /usr/local/nagios/etc Following are the other configuration files under /usr/local/nagios/etc/objects directory:
I. Overview of nagios
I. Overview of Nagios
Nagios is a host and service monitor tool. Following are some of the features of nagios.
II. 8 steps for installing nagios on Linux:
1. Download the nagios and plugins
nagios-3.0.1.tar.gz2. Take care of the prerequisites
[root@localhost]#rpm -qa | grep gcc
gcc-3.4.6-8
compat-gcc-32-3.2.3-47.3
libgcc-3.4.6-8
compat-libgcc-296-2.96-132.7.2
compat-gcc-32-c++-3.2.3-47.3
gcc-c++-3.4.6-8
[root@localhost]# rpm -qa gd
gd-2.0.28-5.4E3. Create user and group for nagios
[root@localhost]# useradd nagios
[root@localhost]# passwd nagios
[root@localhost]# groupadd nagcmd
[root@localhost]# usermod -G nagcmd nagios
[root@localhost]# usermod -G nagcmd apache4. Install nagios
[root@localhost]# tar xvf nagios-3.0.1.tar.gz
[root@localhost]# cd nagios-3.0.1
[root@localhost]# ./configure --with-command-group=nagcmd
[root@localhost]# make all
[root@localhost]# make install
[root@localhost]# make install-config
[root@localhost]# make install-commandmode --prefix /opt/nagios Where to put the Nagios files
--with-cgiurl /nagios/cgi-bin Web server url where the cgi's will be available
--with-htmurl /nagios Web server url where nagios will be available
--with-nagios-user nagios user account under which Nagios will run
--with-nagios-group nagios group account under which Nagios will run
--with-command-group nagcmd group account which will allow the apache user to submit
commands to Nagios*** Configuration summary for nagios 3.0.1 05-28-2008 ***:
General Options:
-------------------------
Nagios executable: nagios
Nagios user/group: nagios,nagios
Command user/group: nagios,nagcmd
Embedded Perl: no
Event Broker: yes
Install ${prefix}: /usr/local/nagios
Lock file: ${prefix}/var/nagios.lock
Check result directory: ${prefix}/var/spool/checkresults
Init directory: /etc/rc.d/init.d
Apache conf.d directory: /etc/httpd/conf.d
Mail program: /bin/mail
Host OS: linux-gnu
Web Interface Options:
------------------------
HTML URL: http://localhost/nagios/
CGI URL: http://localhost/nagios/cgi-bin/
Traceroute (used by WAP): /bin/traceroute5. Configure the web interface.
[root@localhost]# make install-webconf
[root@localhost# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
New password:
Re-type new password:
Adding password for user nagiosadmin6. Compile and install nagios plugins
[root@localhost]# tar xvf nagios-plugins-1.4.11.tar.gz
[root@localhost]# cd nagios-plugins-1.4.11
[root@localhost]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
[root@localhost]# make
[root@localhost]# make install[root@localhost]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios --enable-redhat-pthread-workaround
7. Start Nagios
[root@localhost]# chkconfig --add nagios
[root@localhost]# chkconfig nagios on
[root@localhost]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
[root@localhost]# service nagios start
Starting nagios: done.8. Login to web interface
Use the userid, password that was created from step#5 above.
III. Configuration files overview
The first configuration to modify is to change the default value of email address in /usr/local/nagios/etc/objects/contacts.cfg file to your email address.
Fig: Nagios Web UI (click on the image to enlarge)
- 95 Users Found This Useful