shell脚本使用钉钉来进行mysql主从监控报警
1 | #!/bin/bash |
2 | mysql_binfile=/usr/ local /mysql/bin/mysql |
3 | m... |
1 | #!/bin/bash |
2 | mysql_binfile=/usr/ local /mysql/bin/mysql |
3 | m... |
01 | #!/bin/bash |
02 | file =` find ./ -name "*.txt" ` |
03 | user= "root" |
04 | passwd = "rocdk890" |
05 | database= "rocdk890" |
06 |
07 | cat $ file | while read line |
08 | do |
09 | num1=` echo $line | awk '{print $1}' ` |
10 | num2=` echo $line | awk '{print $2}' ` |
11 | num3=` echo ... |
1 | #!/bin/bash |
2 | musicPath=/root/music |
3 | music= "*.mp3" |
4 | cd $musicPath |
5 | mplayer -loop 0 $music |
6 | #music="*.mp3 ../../下载/one night in 北京.mp3 ../../下载/怒放的生命.mp3" |
7 |
8 | mplayerID=` ps ... |
1 | #!/bin/bash |
2 | # By rocdk890 |
4 | #Check the network is online |
5 | cat /dev/null > ip_yes.txt |
6 | cat /dev/null > ip_no.txt |
7 | ip_num= "192.168.1" |
8 | read -p "Enter your network segment(Default ip: 192.168.1):" ip_num |
9 | if ... |
1 | #!/bin/bash |
2 | . /etc/profile |
3 | pid=` ps aux | grep tomcat | grep - v grep | grep - v retomcat | awk '{print $2}' ` |
4 | path= "/usr/local/tomcat" |
5 |
6 | if [ -n... |
1 | #!/bin/bash |
2 | # |
3 | #date :Wed May 3 15:51:34 CST 2017 |
4 | #author: gaogd |
5 | # |
6 | ## 说明: ip为容器的ip,hostname为容器主机名,已经容器识别名称,hostname=itemname-servername-owner-ip |
7 | ## 可以自己选择镜像,如果参数中木有指定镜像名称,那么就在脚本中展示出来,让用户选择, |
8 | ## 如果用户也不选择,就是默认的sshd进行 |
9 | ## 用法: sh createcontainter.sh ... |
1 | #!/bin/bash |
2 | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:~/bin |
3 | export PATH |
4 |
5 | # Check if user is root |
6 | if [ $( id -u) != "0" ]; then |
7 | echo "Error: You must b... |
1 | #!/bin/bash |
2 | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/ local /bin:/usr/ local /sbin:~/bin |
3 | export ... |
1 | #!/bin/bash |
2 | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:~/bin |
3 | export PATH |
4 |
5 | # Check if user is root... |
1 | #!/bin/bash |
2 | read -p "Enter mysql password" : newpasswd |
3 | sed -i "s/rocdk890/$newpasswd/g" /etc/init.d/mysqld_multi |
4 | chmod +x /etc/init... |
1 | #!/bin/sh |
2 | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:~/bin |
3 | export PATH |
4 |
5 | # Check the network status |
6 | NET_NUM=` ping -c 4 www.baidu.com | awk '/pac... |
1 | #!/bin/bash |
2 | PATH=/bin:/sbin:/usr/bin:... |
1 | #!/bin/bash |
2 | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:~/bin |
3 | export PATH |
4 |
5 | # Check if user is root |
6 | if [ $( id -u) != "0" ... |
1 | #!/bin/bash |
2 | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin:~/bin |
3 | export PATH |
4 |
5 | # Check if user is root |
6 | if [ $( id -u) != "0" ]; then |
7 | echo "... |