daily pastebin goal
5%
SHARE
TWEET

Untitled

a guest May 31st, 2017 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #! /bin/bash
  2.  
  3.  
  4. set user=epullum
  5. set mysqluser=opsmonitor
  6. set mysqlpass=0psm0n1
  7. set folder=/root/Desktop/opsource/mysql_automation/serverlist
  8. let ipaddress
  9. let i
  10.  
  11. function mysql_running
  12. {
  13.     echo "$global_ipaddress"
  14.     ssh -l "$user" "$ipaddress" "pidof mysqld"
  15.     let thepid = ssh-l "user" "ipaddress" "pidof mysqld"
  16.     mysql --user="$mysqluser" --password="$mysqlpass" --host="ipaddress" -e "show global variables like 'innodb_buffer_pool_size';"
  17. }
  18.  
  19.  
  20. function mysql_down
  21. {
  22.     echo please verify that all the rpm has been installed and install the reqired rpms.
  23.     ssh -l "$user" "$ipaddress" "rpm -qa | grep mysql" echo
  24. }
  25.  
  26.  
  27.  
  28. let amount='sed -n "$=' "$folder" '
  29.  
  30. for ((i=0;i-eq"$amount";i++ ));
  31. do
  32.     $global_ipaddress='sed -n $ip "$folder"'
  33.     echo "$ipaddress"
  34.     if [ ssh -l "$user" "$ipaddress" "ps aux | grep mysqld | awk '{print $9}'" -eq null ]
  35.     then
  36.         mysql_running
  37.     else
  38.         mysql_down
  39.     fi
  40. done
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top