tutorial: install nagios in fedora

12
Tutorial: Installing Nagios in Fedora

Upload: filipe-batista

Post on 29-Jan-2018

8.252 views

Category:

Self Improvement


0 download

TRANSCRIPT

Page 1: Tutorial: Install Nagios in Fedora

Tutorial: Installing Nagios in Fedora

Page 2: Tutorial: Install Nagios in Fedora

Before installing Nagios, ensure that the following packages are installed:

Apache

PHP

GCC Compiler

GD development libraries

If not, login as root and install it.

Install Nagios in FedoraInstall Nagios in Fedora

[root@localhost ~]$yum install httpd php gcc glibc glibc­common[root@localhost ~]$:yum install gd gd­devel

Page 3: Tutorial: Install Nagios in Fedora

Install Nagios in FedoraInstall Nagios in Fedora

Now we have to create a user account and a group for Nagios. Also add the apache user account to the created group.

Become root user and type:

[root@localhost ~]$useradd ­m nagios[root@localhost ~]$passwd nagios[root@localhost ~]$groupadd nagcmd[root@localhost ~]$usermod ­a ­G nagcmd nagios[root@localhost ~]$usermod ­a ­G nagcmd apache

Page 4: Tutorial: Install Nagios in Fedora

Install Nagios in FedoraInstall Nagios in Fedora

Create a temporary folder for the downloads and download the latest version of Nagios Core and plugins.

http://www.nagios.com/download

[root@localhost ~]$mkdir downloads[root@localhost ~]$cd downloads

Page 5: Tutorial: Install Nagios in Fedora

Install Nagios in FedoraInstall Nagios in Fedora

Extract the Nagios tarball[root@localhost ~]$cd downloads[root@localhost downloads]$tar xvzf nagios­3.x.x.tar.gz[root@localhost downloads]$cd nagios­3.x.x

After this, we need to compile and install. [root@localhost nagios­3.x.x]$./configure ­–with­command­group=nagcmd[root@localhost nagios­3.x.x]$make all[root@localhost nagios­3.x.x]$make install[root@localhost nagios­3.x.x]$make install­init[root@localhost nagios­3.x.x]$make install­config[root@localhost nagios­3.x.x]$make install­commandmode

Page 6: Tutorial: Install Nagios in Fedora

Install Nagios in FedoraInstall Nagios in Fedora

Install the Nagios web config file in the Apache conf.d directory.

[root@localhost nagios­3.x.x]$make install­webconf

Use the htpasswd to create an account for logging into the Nagios web interface.htpasswd ­c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Page 7: Tutorial: Install Nagios in Fedora

Install Nagios in FedoraInstall Nagios in Fedora

Extract the Nagios plugins tarball[root@localhost ~]$cd downloads[root@localhost downloads]$tar xvzf nagios­plugins­1.4.x.tar.gz[root@localhost ~downloads]$cd nagios­plugins­1.4.x

After this, we need to compile and install. [root@localhost nagios­plugins­1.4.x]$./configure ­­with­nagios­user=nagios ­­with­nagios­group=nagios[root@localhost nagios­plugins­1.4.x]$make[root@localhost nagios­plugins­1.4.x]$make install

Page 8: Tutorial: Install Nagios in Fedora

Install Nagios in FedoraInstall Nagios in Fedora

Check the Nagios configuration for errors.

[root@localhost ~]$/usr/local/nagios/bin/nagios ­v /usr/local/nagios/etc/nagios.cfg

If there are no errors, start Nagios[root@localhost ~]$service nagios start

[root@localhost ~]$/etc/init.d/nagios start

or

Page 9: Tutorial: Install Nagios in Fedora

Install Nagios in FedoraInstall Nagios in Fedora

To start Nagios when the system boots type:

[root@localhost ~]$chkconfig ­­add nagios[root@localhost ~]$chkconfig nagios on

Page 10: Tutorial: Install Nagios in Fedora

Install Nagios in FedoraInstall Nagios in Fedora

If you have SELinux installed and with the enforcing mode by default, you probably get some errors in Nagios web interface.

You'll need to change the SELinux context of some Nagios folders.

chcon ­R ­t httpd_sys_content_t /usr/local/nagios/sbin/chcon ­R ­t httpd_sys_content_t /usr/local/nagios/share/chcon ­R ­t httpd_sys_script_rw_t /usr/local/nagios/var/rw/

Page 11: Tutorial: Install Nagios in Fedora

Install Nagios in FedoraInstall Nagios in Fedora

Page 12: Tutorial: Install Nagios in Fedora

..:: Filipe Batista - 2009 ::..

filipebatista.bitdoo.com