#!/bin/sh
status_squid_connection="$(ssh root@192.168.0.2 netstat -tun | grep '80' | wc -l)"
#echo $status_squid_connection
status_apache_connection="$(netstat -tun | grep '80' | wc -l)"
#echo $status_apache_connection
status_mysql_connection="$(netstat -tun | grep '3306' | wc -l)"
#echo $status_mysql_connection
LANG=C
for (( i=0;i<15;i=i+1 ))
do
date_regular_exp=`date --date="$i minutes ago" +\%a\ %b\ %d\ %H:%M`
if [ $i -gt 0 ]; then
str_pipe="|"
fi
str="${str}${str_pipe}${date_regular_exp}"
done
status_httpd_error_num="$(cat /var/log/httpd/httpd_urcosme/httpd-error.log | egrep "(${str})" | wc -l)"
/usr/bin/lynx --dump "http://DomainName/updateURL?status_squid_connection=$status_squid_connection&status_apache_connection=$status_apache_connection&status_mysql_connection=$status_mysql_connection&status_httpd_error_num=$status_httpd_error_num"
2009年9月1日 星期二
系統監控Shell Script
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言