Let's Share Knowledge And Make A Difference

  • Monitor your network and systems like a hawk

    There are some perfact open souce solution for monitoing your Network devices and server system's health. Nagios, Cacti, WhatsUpGold and Smokeping are the leading monitoring tools among them...

    Read More
  • Email service and Security

    Now a days life without email service is unthinkable and E-mail service is quite expensive. As always linux gives us the answer with a strong mail service named postfix...

    Read More
  • Data Center Solution

    A data centre is a facility where companies can keep and operate most of the ICT infrastructure that supports their business. IT host the most critical systems that are vital to the continuity of daily operations...

    Read More

Tuesday, June 25, 2013

How to Install locate package in RedHat 6


How to Install locate package in RedHat 6

Check whether locate or slocate or mlocate RPM is installed in your machine.
[root@app2 ~]# rpm -qa| grep -i locate

If its not installed then search for the locate package from yum repository.
[root@app2 ~]# yum search locate
=============================== Matched: locate ================================
mlocate.x86_64 : An utility for finding files by name

Now install the locate package. In old version it may be slocate.
[root@app2 ~]# yum install mlocate

[root@app2 ~]# locate testfile
locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory

To resolve the database update issue we need to update database manually. Though cronjob would create it after a restart.
[root@app2 ~]# updatedb

Now you should be able to use locate command in redhat 6.04 or centos 6.04.

Monday, June 17, 2013

Troubleshooting some nagios error

Troubleshooting Experience:
Troubleshooting some Nagios error:

Recently I was trying to deploy nagios to a RedHat 6 Server which I am use to deploy it in debian box. And as usual I found many problems in the installation procedure. One of the unusal thing is that I use latest nagios 3.5 and it does not have statusmap.cgi file and have some dependency issue. It gave me a hard time to solve the issue :D. So, This is how I fixed those problems-

1. snmp plugin fails due to perl dependency:
Error: Can't locate Net/SNMP.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at ./check_snmp_storage.pl line 15. BEGIN failed--compilation aborted at ./check_snmp_storage.pl line 15.

Solution:

To solve the problem we need to install perl-Net-SNMP which we can implement by following two ways:

Install from rpm:
[root@centoshost01 ~]# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/perl-Net-SNMP-5.2.0-4.el6.noarch.rpm
[root@centoshost01 ~]# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/perl-Crypt-DES-2.05-9.el6.x86_64.rpm
[root@centoshost01 ~]# rpm -ivh perl-Net-SNMP-5.2.0-4.el6.noarch.rpm
[root@centoshost01 ~]# rpm -ivh perl-Crypt-DES-2.05-9.el6.x86_64.rpm

Or
Install from yum:
[root@centoshost01 ~]# vim /etc/yum.repos.d/perl.repo
[Perl]
name=Perl Client
baseurl=http://dl.fedoraproject.org/pub/epel/6/x86_64/
enabled=1
gpgcheck=0

[root@centoshost01 ~]# yum list
[root@centoshost01 ~]# yum install perl-Net-SNMP

2. Error: "Nagios HTTP WARNING: HTTP/1.1 403 Forbidden" shows from the nagios web panel.


Solution:
[root@app1 ~]# vim /var/www/html/index.html
This is local app1 server.
[root@app1 ~]# service httpd restart

3. Error: Not Found - The requested URL /nagios/cgi-bin/statusmap.cgi was not found on this server.

Solution:
This problem happens with the new nagios version 3.5. First check the /usr/local/nagios/sbin folder if it contains the statusmap.cgi file. If not copy the file from the untar nagios folder to /usr/local/nagios/sbin. If nagios 3.5 does not have the statusmap.cgi then download the nagios 3.4.1 and copy the statusmap.cgi to your /usr/local/nagios/sbin location. If still not showing the map from nagios then follow the below steps-

[root@centoshost01 ~]# yum install gd gd-devel

or install it from rpm,
# Download and install gd which is a graphics library for quick creation of PNG or JPEG images
[root@centoshost01 ~]# yum remove gd
[root@centoshost01 ~]# wget http://rpm.pbone.net/index.php3/stat/4/idpl/15161687/dir/redhat_el_6/com/libgd2-2.0.33-2_11.el6.x86_64.rpm.html && wget ftp://ftp.pbone.net/mirror/atrpms.net/sl6-x86_64/atrpms/testing/gd-devel-2.0.33-2_11.el6.x86_64.rpm && wget http://dl.atrpms.net/el6-x86_64/atrpms/testing/gd-2.0.33-2_11.el6.x86_64.rpm
[root@centoshost01 ~]# rpm -ivh libgd2-2.0.33-2_11.el6.x86_64.rpm
[root@centoshost01 ~]# rpm -ivh gd-2.0.33-2_11.el6.x86_64.rpm
[root@centoshost01 ~]# rpm -ivh gd-devel-2.0.33-2_11.el6.x86_64.rpm

[root@centoshost01 ~]# cd /nagios-3.4.1/
[root@centoshost01 ~]# ./configure -with-gd-lib=/usr/local/lib/
[root@centoshost01 ~]# make cgis
[root@centoshost01 ~]# cp /nagios-3.4.1/cgi/*.cgi /usr/local/nagios/sbin
[root@centoshost01 ~]# chown nagios:nagios /usr/local/nagios/sbin/*.cgi


Thursday, June 13, 2013

syslog location in Redhat 6


Troubleshooting Experience:

What is syslog?
- Syslog keeps all the error report of the system. It is extremely necessary for the system administrators to monitor the system status to find out/ troubleshoot any system related issue.

Where is the syslog location in Redhat 6?
- Silly question. But amazingly I didn't find any syslog location in redhat. After some googling I find out that by defaults syslog is not enabled in redhat. We need to enable it manually for the first time. And this is how I did it:

First check that sysconfig package in installed to your system:
[root@mahidul ~]# rpm -qa | grep syslog
rsyslog-gssapi-4.6.2-12.el6.x86_64
rsyslog-mysql-4.6.2-12.el6.x86_64
rsyslog-relp-4.6.2-12.el6.x86_64
rsyslog-4.6.2-12.el6.x86_64
rsyslog-gnutls-4.6.2-12.el6.x86_64
sblim-cmpi-syslog-0.8.0-1.el6.x86_64
rsyslog-pgsql-4.6.2-12.el6.x86_64

If its not installed by default then install it like this way:
[root@mahidul ~]# yum install -y rsyslog

Check the syslog status:
[root@mahidul ~]# service rsyslog status

Restart the service:
[root@mahidul ~]# service rsyslog restart

Start syslog after every time system restart:
[root@mahidul ~]# chkconfig rsyslog on

Optional, If you try to change/customize the syslog settings edit the below location:
[root@mahidul ~]# vim /etc/rsyslog.conf

At last check the syslog:
[root@mahidul ~]# tail -f /var/log/messages