随笔分类 - shell脚本
摘要:#!/bin/bashfunction CPU() { util=`vmstat |awk '{if(NR==3) print $13+$14}'` iowait=`vmstat |awk '{if(NR==3) print $16}'` echo "CPU使用率: ${util}% , 等待磁盘I
阅读全文
摘要:#!/bin/bashUSER_NAME=$@for USER in $USER_NAME;do if ! id $USER &>/dev/null; then PASS=`echo $RANDOM |md5sum |cut -c 1-10` useradd $USER chage -d 0 $US
阅读全文
摘要:1.下载安装mailx yum install mailx -y 2.配置发件服务地址 [root@prometheus-server scripts]# tail -n 4 /etc/mail.rc #测试set from=138xxxx@163.com smtp=smtp.163.comset
阅读全文
摘要:#设置时区ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtimeif ! crontab -l |grep ntpdate &>/dev/null ; then (echo "* 1 * * * ntpdate time.windows.com
阅读全文