This setup is intended to provide you with simple instructions on how to install Nagios on Fedora , Redhat and Centos and have it monitoring your local machine. Nagios is very easy to setup and monitor.
We would require the following packages to install Nagios.
Apache --> yum -y install httpd*
PHP --> yum -y install php*
GCC --> yum -y install gcc, yum -y install gcc-c++, yum -y install glibc
GD --> yum -y install gd gd-level
* -y will not prompt you for an yes/no input.
Create a new nagios user account and give it a password.
useradd nagios
Create a new nag group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to that group.
groupadd nag
usermod -a -G nag nagios
usermod -a -G nag apache
Download nagios tar file along with the plugins
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.0.tar.gz
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz
Now go to the folder or directory where you have downloaded the files. In my case it is /root
cd /root
tar xzf nagios-3.2.0.tar.gz
cd nagios-3.2.0
./configure --with-command-group=nag
make all
make install
make install-init
make install-config
make install-commandmode
cd /root
tar xzf nagios-plugins-1.4.11.tar.gz
cd nagios-plugins-1.4.11
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
Now start Nagios and add it to the list of system services.
service nagios start
chkconfig nagios on
We are done with the basic installation of nagios and its corresponding plugins. Now, I will show you how to monitor a group of hosts. I cannot explain you all the configuration files but will try to throw light on those we require. On successful completion of the installation you will find localhost.cfg in the following path.
/usr/local/nagios/etc/objects/localhost.cfg
In short localhost.cfg is used to define the hosts and services that we want to monitor on the host system.(Host system here refers to the one we want to monitor)
open this file and add the following next to host definition lines.
define host{
use linux-server
host_name www.testing-server.com
address 192.168.36.1
}
use - uses the default template defined in templates.cfg
host_name - hostname can be anything
address- address of the host
Now save the file and restart Nagios.
service nagios restart
NOTE: Make sure you dont add anything to this file because if you are new to nagios debugging would be difficult.
Now you can check the output in the browser.
http://localhost/nagios (Create the password using the htpasswd command)
You can see the host that you have mentioned in the localhost.cfg file. You can add any number of hosts and by default it will check whether the host is alive or not using the check_host_alive plug in. If the host is dead it will display in red and you can click on that to see the details. This is the most basic configuration of Nagios one can configure it according to their requirements. There are lot many features which sets nagios apart from the crowd. Go through the official documentation for further information.
Linux administration , Unix administration , Vmware Vsphere administration , Oracle DBA ,apache, backup, dhcp, dns, kvm, xen, kernel, ldap, kvm, monitoring, ticketing, networking, Mail servers, SAN,troubleshooting
Labels
- Amanda (2)
- Ansible (2)
- Answer these Questions (2)
- antivirus (2)
- apache (3)
- Bash (16)
- Chef (3)
- Citrix (2)
- clusters (2)
- Concept (22)
- DatabaseAdminstration (11)
- DevOps (1)
- dhcp (2)
- Downloads (3)
- ELK (1)
- ELK stack (1)
- encryption (1)
- Free trainings (1)
- Frequently Used Commands (46)
- FTP (1)
- git (1)
- gpg (2)
- Hardware (1)
- httpd (2)
- Interview Questions (53)
- iptables (1)
- IT NEWS (3)
- java (1)
- kibana (2)
- knife (1)
- KVM (2)
- linux (17)
- Linux installations (22)
- Linux Jobs (4)
- Linux Links (2)
- logstash (1)
- Mac (1)
- MediaWiki (1)
- MySql (2)
- Nagios (2)
- Networking (3)
- open Nebula (5)
- Open Source tools (12)
- OpenNMS (1)
- openSSL (1)
- Oracle on Linux (5)
- Performance Monitoring (1)
- php (1)
- postfix (1)
- postgres (1)
- postgres-XL (1)
- Product Reviews (1)
- Python (2)
- rssh (1)
- Samba (2)
- Scripting (16)
- security (4)
- selinux (1)
- Server (1)
- SFTP (1)
- Social Awareness (1)
- Solaris (1)
- SSL (1)
- svn (1)
- TCP/IP (1)
- Technology (1)
- Tips and Tricks (32)
- Training and materials (8)
- Troubleshooting (6)
- Ubuntu (18)
- unix (1)
- virtualization (17)
- Vmware (25)
- Vyatta (1)
- windows7 (1)
- xml (1)
No comments:
Post a Comment