#!/bin/bash
Apache_Status=`nmap -sT  10.0.0.121 | grep  tcp  | grep  http  | awk  '{print  $2}'`
if  [ Apache_Status=="open" ];then
        echo "`date` httpd id ok!" >> /tmp/apache_status.log
else
        /etc/rc.d/init.d/httpd start &>/dev/null
        echo "`date` restart  httpd server!!" >> /tmp/apache_err_status.log
fi