對(duì)服務(wù)器進(jìn)行日常巡檢,發(fā)到指定ftp服務(wù)器
腳本垃圾
工作需要一個(gè)很垃圾的腳本
#!/bin/bash
##check-script
IP=`ifconfigeth0|grep"inetaddr"|awk'{print$2}'|awk-F:'{print$2}'`
echo"HOST=$IP">/$IP.txt
echo"Time=`date`">>/$IP.txt
touch/$IP.txt
echo"1.#Uptime">>/$IP.txt
uptime>>/$IP.txt
echo"-----------------------------------------------------------------------------------">>/$IP.txt
echo"2.#Vmstat">>/$IP.txt
vmstat|sed1d>>/$IP.txt
echo"-----------------------------------------------------------------------------------">>/$IP.txt
echo"3.Meminfo">>/$IP.txt
cat/proc/meminfo|grepMem>>/$IP.txt
echo"-----------------------------------------------------------------------------------">>/$IP.txt
echo"4.#WarningDiskInformation">>/$IP.txt
df-h|grep1,""8,9,00-9%>>/$IP.txt
echo"-----------------------------------------------------------------------------------">>/$IP.txt
echo"5.#SystemLogsInformation">>/$IP.txt
cat/var/log/messages|grepfail|tail-n5>>/$IP.txt
cat/var/log/messages|greperror|tail-n5>>/$IP.txt
cat/var/log/messages|grepwarn|tail-n5>>/$IP.txt
unix2dos/$IP.txt
cd/
ftp-n<
useranonymouspassword
cdcheck
put$IP.txt
bye
EOF
unsetIP
Tags:腳本垃圾,對(duì)服務(wù)器進(jìn)行日常巡檢,發(fā)到指定ftp服務(wù)器
版權(quán)聲明:本站文章來(lái)源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來(lái)源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來(lái)源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來(lái),僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。
關(guān)注官方微信