1,apache的源码安装脚本#!/bin/bash
##autherxiaosonglin
##date2013-06-08
###apacheinstall
PATH=`echo$PATH`
rpm-qa|grephttpd
if[$?-eq0];then
echo”apachealredyinstall”>apac.log
rpm-ehttpd
elseecho”apachenotinstall”>>apac.log
wgethttp://192.168.18.254/abc/httpd免费云主机域名-2.2.16.tar.bz2局域网类的地址
if[$?-ne0];then
echo”wgetERROR”>>apac.log
else
tarfjvxhttpd-2.2.16.tar.bz2
cdhttpd-2.2.16
./configure
make&&makeinstall
fi
fi#######一个httpd启动脚本,放到/etc/init.d/下,可以使用serviceapache2start|restart|status|stop中apache可自定义#!/bin/bash
##apachereplacehttpd
##autherxsl
##date
start(){
/usr/sbin/httpd
}
stop(){
kill-sQUIThttpd
}
status(){
elinkshttp://192.168.18.213-dump>/dev/null本机
if[$?-eq0];then
echo”apacheisrunning”
else
echo”apacheisdown”
fi
}
restart(){
kill-sQUIThttpd
sleep3
/usr/sbin/httpd
}
##main
case$1in
start)
start;;
stop)
stop;;
status)
status;;
restart)
restart;;
*)
echo”Usage:./casestart|stop|restart|status”
esac
######2,监控磁盘#DISK#disk(){
#showdiskIP=`ifconfigeth0|awk’NR==2’|awk'{print$2}’|awk-F:'{print$2}’`
DISK_LIST=`fdisk-l|grepDisk|awk-F,'{print$1}’>disk_list`
DISK_COUNT1=`catdisk_list|wc-l`
letDISK_COUNT2=”$DISK_COUNT1+1″for((i=1;ido
DISK_NAME=`awkNR==$idisk_list|awk'{print$2}’|tr-d”:”`
echo”`awkNR==$idisk_list`”
df-Th|grep$DISK_NAME
#echo-e”n”##disk_use_mom
df-Th|grep$DISK_NAME|awk'{print$6}’|tr-d”%”>disk_use
foriin`catdisk_use`
do
if[$i-gt90]
then
echo”$IPdiskfull,pleasecheck”
fidone
done#}#######3,监控内存#!/bin/bash
IP=`ifconfigeth0|awk’NR==2’|awk'{print$2}’|awk-F:'{print$2}’`
#Mem_mom
#mem(){
MEM_TOTAL=`free|awk’NR==2’|awk'{print$2}’`
MEM_USE=`free|awk’NR==2’|awk'{print$3}’`
MEM_FREE=`free|awk’NR==2’|awk'{print$4}’`
letUSE=”$MEM_USE*100/$MEM_TOTAL”
echo-e”ttt$IP”
echo
echomem_total=$MEM_TOTAL
echomem_use=”$MEM_USEuse”$USE”%”
echomem_free=$MEM_FREE
#}
####
本文小编为大家详细介绍“linux有没有内核级线程”,内容详细,步骤清晰,细节处理妥当,希望这篇“linux有没有内核级线程”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。 linux有内核级线程,linux支持内核级的多线程。Lin…
免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。