這個(gè)簡(jiǎn)易監(jiān)控系統(tǒng)具體是由html實(shí)現(xiàn)的
為湞江等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計(jì)制作服務(wù),及湞江網(wǎng)站建設(shè)行業(yè)解決方案。主營(yíng)業(yè)務(wù)為成都網(wǎng)站設(shè)計(jì)、網(wǎng)站制作、湞江網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠(chéng)的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!
后臺(tái)沒有數(shù)據(jù)庫,只有從各臺(tái)機(jī)器收集并上傳過來的html文件
通過定時(shí)shell腳本整理并分類到各個(gè)目錄,然后通過apache被網(wǎng)頁調(diào)用
具體更新頻率取決于各數(shù)據(jù)同步服務(wù)器的定時(shí)任務(wù)運(yùn)行頻率
OGG進(jìn)程狀態(tài)整理腳本
這個(gè)腳本用于整理進(jìn)程信息上傳腳本收集到的文件,將其合并為html文件
pcsindex.sh
#!/bin/bash cd /root/gg/ggscript/pcsindex ls -lrt /root/gg/gginfo/*.gginfo|awk '{print $9}' > temp sed '/^$/d' temp > tempc cat tempc|sort -n > temp rm -f tempc echo "The data was collected by RenYi
" > /var/www/virtual/index2.html echo "
" >> /var/www/virtual/index2.html echo "
" >> /var/www/virtual/index2.html i=1 num=`sed -n '$=' temp` cd /root/gg/gginfo while [ "$i" -le "$num" ] do filename=`sed -n $i'p' /root/gg/ggscript/pcsindex/temp` cat $filename >> /var/www/virtual/index2.html ((i++)); done
OGG 錯(cuò)誤日志整理腳本
該腳本用于整理 錯(cuò)誤日志上傳腳本收集到的錯(cuò)誤日志信息
gglog.sh
#!/bin/bash cd /root/gg/ggscript/gglog ls -lrt /root/gg/gglog/*.gglog|awk '{print $9}' > /root/gg/ggscript/gglog/temp sed '/^$/d' temp > tempc cat tempc|sort -n > temp rm -f tempc i=1 num=`sed -n '$=' temp` cd /root/gg/gglog while [ "$i" -le "$num" ] do filename=`sed -n $i'p' /root/gg/ggscript/gglog/temp` file=${filename%.*} file=${file##*/} cat $filename > /var/www/virtual/gglog/$file.html ((i++)); done
lgglog.sh
#!/bin/bash cd /root/gg/ggscript/gglog ls -lrt /var/www/virtual/gglog/* |awk '{print $9}' > /root/gg/ggscript/gglog/temp2 sed '/^$/d' temp2 > tempc cat tempc|sort -n > temp2 rm -f tempc i=1 i=1 num=`sed -n '$=' temp2` cd /var/www/virtual/gglog while [ "$i" -le "$num" ] do filename=`sed -n $i'p' /root/gg/ggscript/gglog/temp2` file=${filename%.*} file=${file##*/} cat $filename > /var/www/virtual/lgglog/$file.html ((i++)); done
附加日志錯(cuò)誤信息整理腳本
該腳本用于整理分類 附加日志錯(cuò)誤信息收集腳本從不同機(jī)器收集來的附加日志信息,并發(fā)送到不同的目錄
ggchk.sh
#!/bin/bash cd /root/gg/ggscript/ggchk ls -lrt /root/gg/ggtbchk/*.tbcheck|awk '{print $9}' > /root/gg/ggscript/ggchk/temp sed '/^$/d' temp > tempc cat tempc|sort -n > temp rm -f tempc i=1 num=`sed -n '$=' temp` cd /root/gg/ggtbchk while [ "$i" -le "$num" ] do filename=`sed -n $i'p' /root/gg/ggscript/ggchk/temp` file=${filename%.*} file=${file##*/} cat $filename > /var/www/virtual/ggchk/$file.html ((i++)); done
寫入錯(cuò)誤日志整理腳本
用于整理寫入進(jìn)程異常日志收集腳本收集到的異常日志
ggdsc.sh
#!/bin/bash cd /root/gg/ggscript/ggdsc ls -lrt /root/gg/ggdcs/*.dcsinfo|awk '{print $9}' > /root/gg/ggscript/ggdsc/temp sed '/^$/d' temp > tempc cat tempc|sort -n > temp rm -f tempc i=1 num=`sed -n '$=' temp` cd /root/gg/ggdcs while [ "$i" -le "$num" ] do filename=`sed -n $i'p' /root/gg/ggscript/ggdsc/temp` file=${filename%.*} file=${file##*/} cat $filename > /var/www/virtual/ggdsc/$file.html ((i++)); done
錯(cuò)誤數(shù)量統(tǒng)計(jì)腳本
用于統(tǒng)計(jì)各個(gè)系統(tǒng)日志中錯(cuò)誤以及異常信息,生成頁面上的ERROR 或者錯(cuò)誤數(shù)量等數(shù)據(jù)
count.sh
#!/bin/bash cd /root/gg/ggscript/ggcount #gginfo ls -lrt /var/www/virtual/gginfo/*.html|awk '{print $9}' > /root/gg/ggscript/ggcount/temp sed '/^$/d' temp > tempc cat tempc|sort -n > temp rm -f tempc i=1 num=`sed -n '$=' temp` cd /root/gg/ggscript/ggcount while [ "$i" -le "$num" ] do filename=`sed -n $i'p' /root/gg/ggscript/ggcount/temp` file=${filename%.*} file=${file##*/} filename=${filename##*/} nux=`grep -oi "red" /var/www/virtual/gginfo/$filename |wc -l` if [ $nux -gt 0 ];then echo "ALERT" > /var/www/virtual/txt/gginfo/$file.html else echo "NORMAL" > /var/www/virtual/txt/gginfo/$file.html fi ((i++)); done
crontab 計(jì)劃任務(wù)配置
#GGscript */7 * * * * sh/root/gg/ggscript/pcsindex/pcsindex.sh > /root/gg/ggscript/pcsindex.log */6 * * * * sh /root/gg/ggscript/gglog/gglog.sh */15 * * * * sh /root/gg/ggscript/ggdsc/ggdsc.sh */8 * * * * sh /root/gg/ggscript/gginfo/gginfo.sh */5 * * * * sh /root/gg/ggscript/ggcount/count.sh 1 0 1 * * sh /root/gg/ggscript/gglog/lgglog.sh */10 * * * * sh /root/gg/ggscript/ggchk/ggchk.sh