I’ll show you a simple script for easily monitor server



#!/bin/bash
# Monitoring Server with ping

########################################################

# host/ip
HOST="debian-tutorials.com"

# NO ping request
COUNT=3

# Report
SUBJECT="Server Down!"
EMAIL="[email protected]"
for host in $HOST

do
count=$(ping -c $COUNT $HOST | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')

  if [ $COUNT -eq 0 ]; then
# Server is DOWN!

    echo "Host : $HOST is down (ping failed) at $(date)" | mail -s "$SUBJECT" $EMAILID
  fi
done

You probably heard before of the term Denial of Service. What does this mean? How can you stop DOS?

Taking advantage of a known problem with the Operating System or any running services on the target, a good programmer can build an application that sends some data that causes the targeted system to crash.

The worst case scenario is not when a hacker crashes a service, but when it finds a way to maximize the CPU usage causing a total malfunction on the system.

Of course most of the attacks are not initiated by these kind of programmers, but by “script kiddies” who only read about it, find the program’s source over the web and just use it without knowing the mechanisms it uses.

Usually, DoS attacks are closely related to brute force attacks. The brute force attack uses all combinations of possible characters or dictionary word lists to try find out any passwords on the system (eg root accounts). When a root account in a network is found out, any DoS attacks can be done easily over the specific network.

Here are some of the most known DoS attacks:

1. SYN Floods Continue Reading…

Page 1 of 11