With Nagios using check_icmp is the way to go, it better and faster, below is an example configuration directive for setting the check-host-alive command which will be used by each host check.

# ‘check-host-alive’ command definitiondefine command{command_name    check-host-alivecommand_line    $USER1$/check_icmp -H $HOSTADDRESS$ -w 30,5% -c 100,20% -p 1}


time ./check_icmp -H -n 5

OK […]

VI – Search and Replace with a pathname

Find and replace with VI on a pathname is a bit tricky you ned to use escape characters.

In this case /bin/mail should be replaced with /usr/bin/mail

The command below would do it:



Find and Replace Example

Here is an example of find and replace with VI, this will replace every instance of the “findthistext” string […]

Detecting DDoS attacks with Nagios

DDOS attacks are under the limelight (and the media) from the Wikileaks affair.It is quite difficult to detect attack because unlike most “traditional” attacks, it is based on the fact that flood the target machine requests from a large number of zombie machines (ie infected a program that will launch an attack).In this post we […]

Rebuild corrupt RPM database

Sometimes RPM databases become corrupt. You will no longer be able to install/upgrade/remove programs using YUM or RPM command. Even RPM quey simply gets hung.This is the case when you need to repair RPM databases. 

To repair do the following:

  cp -rp /var/lib/rpm{,`data +%F`.bk} This command is to take a backup of  ‘ /var/lib/rpm‘ directory […]

Apache logs

irst locate the log file for your site. The generic log is generally at /var/log/httpd/access_log or/var/log/apache2/access_log (depending on your distro). For virtualhost-specific logs, check the conf files or (if you have one active site and others in the background) run ls -alt /var/log/httpd to see which file is most recently updated.

cat access.log| awk ‘{print $1}’ | sort | uniq -c |sort […]



DDOS – Distributed Denial of service attack 

DDOS or DOS (Denial of service ) is an attack in the server , where the server resources become unavailable to the users. It can be typically defined as the loss of network connectivity and services by […]

Convert RHEL 6.2 to CentOS 6.x

yum clean all# rpm -e subscription-manager

# mkdir /root/centos# cd /root/centos

# wget wget wget wget wget

# rpm –import RPM-GPG-KEY-CentOS-6# rpm -e –nodeps redhat-release-server# rpm -e yum-rhn-plugin rhn-setup rhn-check rhn-setup-gnome rhnsd (if this is not removing you can do yum remove yum-rhn-plugin rhn-setup rhn-check rhn-setup-gnome rhnsd)# rpm -Uhv –force *.rpm

Not you can try […]

Rsync Tips

Synchronizing data beetween two directories

# rsync -rv <src> <dst> –progress

Rsync two directories with filtered extensions

# rsync -rv –include ‘*/’ –include ‘*.txt’ –exclude ‘*’ srcDir/ desDir/

Rsync a directory excluding pesky .svn dirs

# rsync -rv –exclude .svn src/dir/ dest/dir/

Sync Source Directory to Destination Directory

# rsync -avzE -e  –process /var/www/html/deploy root@X.X.X.X/backup/testing/project


How to hide web server version in Tomcat

Add the following attributes to the <Connector> in Tomcat’s server.xml to hide web server version in Tomcat at line no- 73 :-

# vim apache-tomcat/conf/server.xml

<Connector port=”8080? protocol=”HTTP/1.1?connectionTimeout=”20000?redirectPort=”8443?server=”Tomcat” />

Email Linux

@reboot /bin/mail -s “$HOSTNAME – rebooted” <<< “$HOSTNAME has rebooted on $(date)” 


The ability to know when a system reboot. The tips below will send out an email when a Linux system is reboot. This should indicate to the Administrator that something went wrong with the shutdown. The tips below are for a […]

Page 1 of 212