Nettoyage et #!

This commit is contained in:
Adrien Bourmault 2022-05-21 00:18:32 +02:00 committed by admin666
parent 74925a1ae7
commit dac2f3fb2d
14 changed files with 13 additions and 67 deletions

View File

@ -1,3 +0,0 @@
#!/bin/bash

View File

@ -1,3 +1,4 @@
#!/bin/bash
count=$1 count=$1
VMs=$(sudo virsh list --state-running --name | sort -R) VMs=$(sudo virsh list --state-running --name | sort -R)

View File

@ -1,3 +1,4 @@
#!/bin/bash
command=$1 command=$1
VMs=$(sudo virsh list --state-running --name) VMs=$(sudo virsh list --state-running --name)

View File

@ -1,3 +1,4 @@
#!/bin/bash
script=$1 script=$1
VMs=$(sudo virsh list --state-running --name | grep chalec) VMs=$(sudo virsh list --state-running --name | grep chalec)

View File

@ -1,3 +1,4 @@
#!/bin/bash
count=$1 count=$1
VMs=$(sudo virsh list --state-running --name | head -n $count | sort -R) VMs=$(sudo virsh list --state-running --name | head -n $count | sort -R)

View File

@ -1,3 +1,4 @@
#!/bin/bash
count=$1 count=$1
VMs=$(sudo virsh list --state-running --name | head -n $count | sort -R) VMs=$(sudo virsh list --state-running --name | head -n $count | sort -R)

View File

@ -1,3 +1,4 @@
#!/bin/bash
vm=$1 vm=$1
if [ -z "$(cat /proc/drbd | grep Connected)" ] if [ -z "$(cat /proc/drbd | grep Connected)" ]

View File

@ -1,3 +1,4 @@
#!/bin/bash
vm=$1 vm=$1
if [ -z "$(cat /proc/drbd | grep Connected)" ] if [ -z "$(cat /proc/drbd | grep Connected)" ]

View File

@ -1,10 +1,7 @@
VMs=$(sudo virsh list --state-running --name) #!/bin/bash
vm=$1
for vm in $VMs
do
echo MIGRATING $vm ... echo MIGRATING $vm ...
virsh migrate --p2p $vm --live --verbose --undefinesource --persistent \ virsh migrate --p2p $vm --live --verbose --undefinesource --persistent --copy-storage-all --abort-on-error qemu+ssh://mother.onlink/system
--copy-storage-all --abort-on-error qemu+ssh://mother.onlink/system
done
sudo mv /var/backups/vm/aunt/* /var/backups/vm/mother sudo mv /var/backups/vm/aunt/* /var/backups/vm/mother

View File

@ -1,27 +0,0 @@
#!/bin/bash
#sudo sed -i 's/destemail = cominfra@a-lec.org/destemail = comchalec@a-lec.org/g' /etc/fail2ban/jail.local
#sudo sed -i 's/destemail = root@localhost/destemail = comchalec@a-lec.org/g' /etc/fail2ban/jail.local
#sudo systemctl restart fail2ban.service
#sudo su -c 'echo Defaults mailto="comchalec@a-lec.org" >> /etc/sudoers'
#sudo sed -i 's/Defaults mailto="cominfra@a-lec.org/ /g' /etc/sudoers
#sudo etckeeper commit "L'infrastructure envoie ses courriels à comchalec@"
#sudo apt-get install qemu-guest-agent -y
#sudo reboot
#sudo rm /etc/icinga2/conf.d/*
sudo su -c 'echo -e "[Definition]\nactionstart =\nactionstop =\n" > /etc/fail2ban/action.d/sendmail-common.local'
sudo etckeeper commit "Désactivation des notifications d'allumage Fail2ban"
#sudo systemctl restart icinga2
sudo systemctl restart fail2ban

View File

@ -1,25 +0,0 @@
NAME=
sudo cat << EOF > /etc/icinga2/zones.d/master/$NAME.conf
object Endpoint "NOM_DE_DOMAINE_DE_VM" {
}
object Zone "NOM_DE_DOMAINE_DE_VM" {
endpoints = [ "NOM_DE_DOMAINE_DE_VM" ]
parent = "master"
}
object Host "NOM_DE_DOMAINE_DE_VM" {
import "generic-host"
address = "NOM_DE_DOMAINE_DE_VM"
address6 = "NOM_DE_DOMAINE_DE_VM"
vars.os = "GNU/Linux"
vars.client_endpoint = name
vars.notification["mail"] = {
groups = [ "icingaadmins" ]
}
}
EOF
sudo sed -i "s/NOM_DE_DOMAINE_DE_VM/${NAME}/g" /etc/icinga2/zones.d/master/$NAME.conf

View File

@ -1,5 +0,0 @@
sudo apt-get install icinga2 monitoring-plugins monitoring-plugins-contrib
sudo sed -i 's/check_mem.pl/check_memory/g' /usr/share/icinga2/include/plugins-contrib.d/operating-system.conf
sudo systemctl restart icinga2

View File

@ -1,3 +1,4 @@
#!/bin/bash
VMs=$(sudo virsh list --all --name) VMs=$(sudo virsh list --all --name)
for vm in $VMs for vm in $VMs

View File

@ -1,3 +1,4 @@
#!/bin/bash
ssh $1 < script_superv.sh ssh $1 < script_superv.sh
sudo sed -i "s/NAME=.*/NAME=$1/g" superv_script_isengard.sh sudo sed -i "s/NAME=.*/NAME=$1/g" superv_script_isengard.sh