Created
January 16, 2015 14:11
-
-
Save anonymous/b9f6a035f9bac95adf71 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
IDRAC_PWD=calvin | |
IDRAC_LOGIN=root | |
IDRAC_IP_LIST="10.90.220.10 10.90.200.105" | |
sshracadm() | |
{ | |
ip=$1 | |
shift | |
sshpass -p "$IDRAC_PWD" ssh -oStrictHostKeyChecking=no -l $IDRAC_LOGIN $ip "$*" | |
} | |
prereq() | |
{ | |
type ssh || exit 1 | |
type sshpass || exit 1 | |
} | |
prereq || exit 1 | |
for ip in $IDRAC_IP_LIST | |
do | |
echo '#######' $ip '#######' | |
sshracadm $ip racadm getsysinfo | egrep -i '(Service Tag|Mac Address|^NIC.|Model|Current IP Address *=)' | |
done | |
for ip in $IDRAC_IP_LIST | |
do | |
# affichage des paramtètres IPMI, Boot(PXE=NIC.Integrated.1-1-1), BootRetry | |
sshracadm $ip << EOC | grep '=' | |
racadm get BIOS.BiosBootSettings.BootSeqRetry | |
racadm get BIOS.BiosBootSettings.BootSeq | |
racadm get iDRAC.IPMILan.Enable | |
EOC | |
done | |
for ip in $IDRAC_IP_LIST | |
do | |
# ----- PXE ----- | |
# Boot en PXE en boucle (jusqu'à qu'un srv de boot réponde) | |
#sshracadm $ip set BIOS.BiosBootSettings.BootSeqRetry Enabled | |
# Boot un PXE (uniquement PXE, pas de tentative sur disque) | |
#sshracadm $ip set BIOS.BiosBootSettings.BootSeq NIC.Integrated.1-1-1 | |
# Creation d'un job d'aactivation des nouveaux paramètres au prochain reboot | |
#sshracadm $ip jobqueue create BIOS.Setup.1-1 | |
# ----- IPMI ----- | |
# activation de IPMI over LAN | |
#sshracadm $ip set iDRAC.IPMILan.Enable Enabled | |
# ----- RAID ----- | |
#sshracadm $ip raid resetconfig:RAID.Integrated.1-1 | |
# Raid1 | |
#sshracadm $ip raid createvd:RAID.Integrated.1-1 -rl r1 -pdkey:Disk.Bay.0:Enclosure.Internal.0-1:RAID.Integrated.1-1,Disk.Bay.1:Enclosure.Internal.0-1:RAID.Integrated.1-1 -name "system" | |
# JBOD | |
#sshracadm $ip raid converttononraid:Disk.Bay.2:Enclosure.Internal.0-1:RAID.Integrated.1-1 | |
#sshracadm $ip jobqueue create RAID.Integrated.1-1 -s TIME_NOW --realTime | |
#sshracadm $ip serveraction hardreset | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment