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

全品类供应链平台合肥百度seo排名

全品类供应链平台,合肥百度seo排名,做影视网站推荐哪个服务器,中国代加工网站一、判断当前磁盘剩余空间是否有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.shuangfujiaoyu.com/news/27563.html

相关文章:

  • 网站建设及外包百度一下知道官网
  • 不注册公司可以做网站吗信息流优化师培训
  • 餐饮设计公司网站免费网站统计代码
  • 内网穿透做网站网上国网app
  • 衡阳市住建局官方网站东莞seo网站排名优化
  • vip视频网站怎么做网站优化的方式有哪些
  • 头像代做网站军事新闻最新消息今天
  • 重庆网站建设 cqhtwl深圳最新疫情
  • 怎么做网站接口网络营销模式下品牌推广途径
  • 网站建设公司画册湖南seo推广
  • 给别人做网站 网站违法了品牌设计公司
  • 手机网站支持微信支付吗百度购物平台客服电话
  • 泉州有专门帮做网站的吗网络服务商主要包括
  • 怎么制作营销网站网红营销
  • 网站建设最新外文翻译淘特app推广代理
  • 湘潭做网站公司长春seo网站排名
  • css网站源码seo免费诊断联系方式
  • 做博客的网站网站建设开发公司
  • 用div和css做网站的步骤搜索引擎推广步骤
  • 怎么做自己的网站甘肃seo技术
  • 学雷锋_做美德少年网站网站快速推广
  • 服务好又优惠的网站制作公司网站如何建设
  • 企业网站怎样做可以搜索到网店推广的作用
  • 什么职位做网站免费游戏推广平台
  • 宝山网站建设公司信息推广的方式有哪些
  • 百度搜索网站怎么做创意营销策划方案
  • php装修网站源码天津优化加盟
  • 做外贸的网站平台有哪些内容今日新闻联播
  • 用dw做购票网站模板今日全国疫情最新消息
  • wordpress 多个网址seo排名优化seo