To kill Dead process
for i in `ps ax | grep D | awk {'print $1'}`;do kill -9 $(cat /proc/${i}/status | grep [...]
To kill Zombie process
for i in `ps ax | grep Z | awk {'print $1'}`;do kill -9 $(cat /proc/${i}/status | grep [...]
To find ddos attack
netstat -an |grep 80 netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1 netstat -plan|grep :25|awk [...]
Top memory consuming processes
ps aux | head -1;ps aux --no-headers| sort -rn +3 | head
Number of exim connections
tail -1000 /var/log/exim_mainlog |grep '[' |cut -d[ -f2 |cut -d] -f1|sort -n |uniq -c |sort -n
To find cppop attack
tail -1000 /var/log/maillog | grep host= | cut -d= -f2| cut -d" " -f1|sort -n |uniq -c |sort [...]
To find number of httpd connections
netstat -plan|grep :80|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1 or netstat -pan | sort +4 | [...]
Script to search any hacking or malicious script
VECTORS="r57sh c99sh h00ly 0wn3d rst.void.ru" VECTORS_FINAL=$(echo $VECTORS | sed 's/ /|/g') find /home/*/public_html/ -type f -exec grep -Eil [...]
Park domain error
Remove the entry of that park domain from these files and try to park the domain again. /var/cpanel/users [...]
Outllook configuration
Follow the below instructions for configuring the outlook 2003. 1. In outlook, select Tools/Email accounts 2. On the [...]
Nagios swap space
Goto Nagios server cd /usr/local/nagios/libexec wget http://www.mycutelife.net/sanju/newtickethelp/nagiosfullsteps/check_swp chmod +x check_swp You need to do this for each [...]
Nagios ssl
adding service ssl to nagios /usr/local/nagios/etc file checkcommands.cfg # 'check_ssl' command definition define command{ [...]
Nagios proc
Configure number of processes in Nagios : on the server to be monitored, vi /etc/nrpe.conf modify the [...]
Nagios – nrpe
# vi /etc/xinetd.d/nrpe # default: on # description: NRPE service nrpe [...]
Nagios – nrpe.conf
root@westernbbqassociation [~]# vi /etc/nrpe.conf command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10 command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20 command[check_disk1]=/usr/local/nagios/libexec/check_disk -w 20 -c [...]
Nagios password
password given in /usr/local/nagios/etc/htpasswd.users url is http://hostname/cgi-bin/monitor/status.cgi Given entries in contactgroups.cfg and contacts.cfg files (refer doreo [...]
Nagios error – Mysql
mysql create database nagios; grant all privileges on nagios.* to nagios@63.247.77.234 identified by '123dsa'; mysql setup in [...]
Nagios error – Exim mail queue
In nagios server cd /usr/local/nagios/libexec wget http://www.mycutelife.net/sanju/newtickethelp/nagiosfullsteps/check_eximmailqueue chmod +x check_eximmailqueue In remote server cd /usr/local/nagios/libexec wget [...]
Nagios error – DNS
error output parsing /usr/sbin/nslookup (1)For testing from nagios server [nagios@monitor libexec]$ ./check_nrpe -H hostname -c check_load (2) [...]
Nagios setup
In Remote server cd /root wget http://www.mycutelife.net/sanju/newtickethelp/nagios_downloads/nagios-plugins-1.3.1.tar.gz wget http://www.mycutelife.net/sanju/newtickethelp/nagios_downloads/nrpe-1.9.tar.gz tar -zxvf nagios-plugins-1.3.1.tar.gz cd nagios-plugins-1.3.1 ./configure make all make [...]
Install Nagios
How to install nagios In the nagios server 1)Download the tarball of nagios (Here I use nagios-1.0b5 version) [...]
mysql error = cant connect to mysql socket via /var/lib/mysql
cd /var/lib/mysql touch mysql.sock chown mysql:mysql mysql.sock chmod 777 mysql.sock ln -s /var/lib/mysql/mysql.sock /tmp chmod 777 /tmp /scripts/mysqlup [...]
Mysql database restore
mysql backup: var/lib/mysql#mysqldump xx > xx.sql mysql restore: var/lib/mysql#mysql xx < xx.sql
Exim mail queue clear
To clear SPAMS and unwanted mails from the mail queue exim -bp | awk '$6~"frozen" {print $3 }' [...]
Kernel Compilation
Kernel compilation Go to the /usr/src directory Unpack the source code with tar -xvzf linux-2.x.x.tag.gz. Move to the [...]