first commit
This commit is contained in:
19
Man_tool/change_pass.sh
Executable file
19
Man_tool/change_pass.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
#scrpit to change root password from a csv file
|
||||
#<hostname>,<passwd>
|
||||
|
||||
if [ $# -lt 1 ]
|
||||
then
|
||||
echo "Syntax: ./$(basename $0) <file name>"
|
||||
exit
|
||||
fi
|
||||
|
||||
for csv in $(cat $1)
|
||||
do
|
||||
|
||||
HOST=$(echo $csv |cut -d "," -f1)
|
||||
PASS=$(echo $csv |cut -d "," -f2)
|
||||
|
||||
ssh ansible@$HOST "echo root:$PASS |sudo chpasswd"
|
||||
|
||||
done
|
31
Man_tool/command_loop.sh
Executable file
31
Man_tool/command_loop.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
#if [ $# -lt 1 ]
|
||||
#then
|
||||
# echo "Syntax: ./$(basename $0) <file name>"
|
||||
# exit
|
||||
#fi
|
||||
|
||||
for csv in $(cat $1)
|
||||
do
|
||||
|
||||
HOST=$(echo $csv |cut -d "," -f1)
|
||||
HASH=$(echo $csv |cut -d "," -f2)
|
||||
|
||||
# echo -e $host "root:$HASH/"
|
||||
echo $HOST "vgs"
|
||||
|
||||
|
||||
#scp root@$host:/var/log/glusterfs/glustershd.log .
|
||||
#ssh -o ConnectTimeout=10 -n root@$host "tail -n 100 /var/log/glusterfs/glustershd.log" > gluster/$host
|
||||
|
||||
done
|
||||
|
||||
#cat gluster/*| grep "All subvolumes are down" | grep "0-vol"|cut -d " " -f7|sort|uniq
|
||||
|
||||
|
||||
#cat gluster/*| grep "failed" | grep "0-vol"|cut -d " " -f 7,8|sort|uniq
|
||||
|
||||
#rm gluster/*
|
||||
#cat bricks_down |sort|uniq
|
16
Man_tool/uptime_loop.sh
Executable file
16
Man_tool/uptime_loop.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
FILE=$1
|
||||
|
||||
if [ $# -lt 1 ]
|
||||
then
|
||||
echo "Syntax: ./$(basename $0) <file name>"
|
||||
exit
|
||||
fi
|
||||
|
||||
for host in $(cat ${FILE})
|
||||
do
|
||||
|
||||
ssh -o ConnectTimeout=3 -n root@$host "hostname && uptime "
|
||||
|
||||
done
|
1
Man_tool/ww
Normal file
1
Man_tool/ww
Normal file
@ -0,0 +1 @@
|
||||
127.0.0.1,DlXOTJUdJ8TdaqXh,$1$xyz$uNKesoUDbo.Uh7Ei3E8cn1
|
Reference in New Issue
Block a user