#!/bin/bash#jiankongServer(){timeout=10faile=0success=0whiletruedo/usr/bin/wget--timeout=$timeout--tries=1http://www.baidu.com/-q-o/dev/nullif[$?-ne0]thenletfaile=faile+1success=0elsefaile=0success=1f
#!/bin/bash#if[“‘netstat-lnt|grep3306|awk-F"[:]+"'{print$5}'’”="3306"]#if['ps-ef|grepmysql|grep-vgrep|wc-l'-gt0]#if['nc-w210.0.0.23306&>/dev/null&&am
#!/bin/bash#提取性能监控指标(磁盘占用,CPU占用,内存使用)DUG=$(df-h|grep"/$"|awk'{print$5}'|awk-F%'{print$1}')CUG=$(expr100-$(mpstat|tail-1|awk'{print$11}'|awk-F.'{print$1}'))MUG
#!/bin/bash$inotify=/usr/local/inotify/bin/inotifywait$inotify-mrq--timefmt'%d%m%y%H:%M'--format'%T%w%f'-ecreate,delete,close_write/backup\|whilereadfiledocd/backupif[-f$file]thenrsync
#!/bin/bash#servicescriptmenu(){cat<<END1[installlamp]2[installlnmp]3[exit]plsinputthenumyouwant:END}menuscript1=/server/scripts/lamp.shscript2=/server/scripts/lnmp.shreadintcase"$int"
#!/bin/bashprint_usage(){printf"pleaseenteraninteper\n"}read-p"Pleaseinputfirstnumber:"firstnumwhile["echo"$firstnum"|sed-r's#[^0-9]##g'"!="$firstn
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号