当前位置: 首页 > news >正文

中国发展在线网站官网wordpress 插件放在那

中国发展在线网站官网,wordpress 插件放在那,许昌做网站九零后,北京seo公司wyhseo一、判断当前磁盘剩余空间是否有20G,如果小于20G,则将报警邮件发送给管理员,每天检查一次磁盘剩余空间。 二、判断web服务是否运行 三、使用curl命令访问第二题的web服务,看能否正常访问,如果能正常访问,…

一、判断当前磁盘剩余空间是否有20G,如果小于20G,则将报警邮件发送给管理员,每天检查一次磁盘剩余空间。

二、判断web服务是否运行

三、使用curl命令访问第二题的web服务,看能否正常访问,如果能正常访问,则返回web server is running;如果不能正常访问,返回12状态码。


一、判断当前磁盘剩余空间是否有20G,如果小于20G,则将报警邮件发送给管理员,每天检查一次磁盘剩余空间。

        1.服务端和客户端安装mailx和postfix

[root@A ~]# yum install postfix -y
[root@A ~]# systemctl enable postfix --now[root@B ~]# yum install sendmail -y

        2.编写脚本

set from=2151208022@qq.com             
set smtp=smtp.qq.com                   
set smtp-quth-user=2151208022@qq.com   
set smtp-auth-password=QMSWZJIRXHTVILLU
set smtp-auth=login  

         3.判断当前磁盘剩余空间是否由20G

a=`df -m | grep -w /boot | tr -s " " " "|cut -d " " -f 4`
b=`df -m | grep -w / | tr -s " " " "|cut -d " " -f 4`
c=$((a+b))
free=$((c/1024))
if [ $free -lt 20 ]
thenecho 空间不足!| mail -s "内存报警!" redhat
fi

       4.设置任务计划 

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root# For details see man 4 crontabs# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed
0 0 * * * root /root/mail.sh

二、判断web服务是否运行

        1.下载httpd包

[root@A~]# yum install httpd -y

        2.编写脚本

ps_httpd=`ps -ef | grep httpd | grep -v grep | wc -l`
if [[ $ps_httpd > 0 ]];thenecho "httpd.server is runing"
elsesystemctl start httpdsystemctl stop firewalld
fi                                      

        3.测试

[root@A ~]# bash httpd.sh 
httpd.server is runing

三、使用curl命令访问第二题的web服务,看能否正常访问,如果能正常访问,则返回web server is running;如果不能正常访问,返回12状态码。

        1.编写脚本

curl -s 192.168.90.132 > /dev/null
if [[ $? = 0 ]];thenecho "web server is runing"
elseexit 10
fi

        2.测试

[root@A ~]# systemctl restart httpd
[root@A ~]# systemctl status httpd
● httpd.service - The Apache HTTP ServerLoaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; ven>Active: active (running) since Sun 2023-05-28 12:40:28 CST; 8s agoDocs: man:httpd.service(8)Main PID: 5895 (httpd)Status: "Started, listening on: port 80"Tasks: 213 (limit: 10756)Memory: 47.9MCPU: 82msCGroup: /system.slice/httpd.service├─5895 /usr/sbin/httpd -DFOREGROUND├─5896 /usr/sbin/httpd -DFOREGROUND├─5897 /usr/sbin/httpd -DFOREGROUND├─5898 /usr/sbin/httpd -DFOREGROUND└─5899 /usr/sbin/httpd -DFOREGROUND5月 28 12:40:28 server.hostname.com systemd[1]: Starting The Apache HTTP >
[root@server ~]# bash web.sh 
web server is runing
[root@server ~]# systemctl stop httpd
[root@server ~]# bash web.sh 
[root@server ~]# echo $?
10
http://www.yayakq.cn/news/553423/

相关文章:

  • 怎么做网站网站不被发现上海市建设局网站
  • 餐饮公司网站建设策划书企业邮箱在哪里查看
  • 万网做网站如何下载模板wordpress子站点目录
  • 盱眙在仕德伟做网站的有几家网站突然找不到了 然后降权重 排名不变
  • 什么网站服务器好企业网页制作要注意什么
  • 网站建设与管理结课论文北京综评网址
  • 电子商务网站建设完整案例教程哪个网站能查是否做股东
  • 建湖网站开发重庆本地生活平台
  • 发来贵州省建设厅网站网站流量太大打不开怎么办
  • 番禺制作网站技术杭州市城市建设学校网站
  • h5视频直播源码seo搜索引擎优化的内容
  • 风铃做的网站能否推广网站创建
  • 杭州滨江区建设局网站最好的做法是()。
  • 免费做情网站oa系统登录界面
  • 嘉兴自助模板建站浅谈旅游网站的规划与建设
  • 开封市网站建设软件外包公司排名
  • 新网站怎么做外链中恒诚信建设有限公司网站
  • 购物网站设计的目的前端培训
  • 网站开发三大元素请简述常用的网页制作工具
  • 网站建设中端口号的作用是什么意思线上销售水果营销方案
  • 做谷歌网站吗建立网站的流程
  • dz门户网站模板有深度的公司名字
  • 西安高端网站建设哪家好wordpress获取访问位置
  • 山西营销网站建设设计收录网站有哪些
  • 商务网站需求分析微网站的优缺点
  • 网站开发都做什么网站建设 域名注册
  • 网站建设报价单初期整理网页图片加载不出来是什么原因
  • 网站设计团队分工135网站模板
  • 长沙网站seo分析建设网站什么软件比较好
  • 百度网站链接提交页面企业宣传片脚本