Monday, May 25, 2015

Nagios - How to install Nagios on Centos

■ Install the libraries
$ yum install gd gd-devel gcc glibc glibc-common
Transaction Summary
=============================================================================================================================
Install      34 Package(s)
Upgrade       3 Package(s)

Total size: 44 M
Is this ok [y/N]: y
Downloading Packages:
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
 Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
 Package: centos-release-6-5.el6.centos.11.1.x86_64 (@CentOS6-Base/$releasever)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Is this ok [y/N]: y
Running rpm_check_debug

■ There is no epel in the yum, so install the following manually
$ wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
$ rpm -Uvh epel-release-6-8.noarch.rpm

■ Now list out the installed repositories
$ yum repolist

■ Install the packages bugzilla. (personally, I need to check that why)
$ yum install bugzilla

■ Install Nagios
$ yum install nagios*


■ 1. Set user name in the system environment
export REMOTE_USER=nagiosadmin

■ 2. - Disable notifications for a host
export QUERY_STRING='cmd_typ=25&cmd_mod=2&host=localhost'

■ 3. - Enable notifications for a host
export QUERY_STRING='cmd_typ=24&cmd_mod=2&host=localhost'

■ 4. Execute
/usr/lib64/nagios/cgi-bin/cmd.cgi

■ Reference
http://www.unixmen.com/install-and-configure-nagios-in-centos-6-4-rhel-6-4/
http://lesstif.com/pages/viewpage.action?pageId=6979743