Web Hosting Talk







View Full Version : Need shell script


indianbuddy
12-08-2009, 03:44 PM
I need a 2 shell scripts which can email me for

1) High load
2) DDOS attack
I guess ddos can checked using below command
netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

Cirtex
12-08-2009, 06:13 PM
Hi

This can be very expensive if you're looking for one that work well and not just very basic reporting. I'd try the OFFERS/REQUESTS section for Scripts and also see if anyone would be able to custom code it for you.

You'd need to provide more information however , what server environment etc..

Vinayak_Sharma
12-08-2009, 07:16 PM
Install CSF (http://www.configserver.com/cp/csf.html) it will do your second need, and lot more.

For the first one (high load) contact UNIXy, a member here, he offers custom scripts.

DigitalLinx
12-08-2009, 07:27 PM
load=`uptime | awk '{print $10}' | sed 's/...,//'`

if [ $load -gt 10 ]
then
echo load on server $hostname is $load | mail your@email.com
fi

Define ddos, based on number of connections, number of connections from a single IP, application based dos?

indianbuddy
12-09-2009, 03:00 AM
the script should check if more no.of connections come from an IP atleast 50
It should mail me IP & domain so i can take an action