DELL RACADM COLLECT
Ir para navegação
Ir para pesquisar
DELL RACADM DATA COLLECT
#!/bin/bash
export USER=xxxxxx
export PASSWORD=xxxxxx
export PATHOUT=/home/user/racadm
function COLETA() {
echo $1\;RacADM $4
/opt/dell/srvadmin/bin/idracadm -r $1 -u $2 -p $3 $4 -f $5
}
function RANGE() {
seq $2 $3 | xargs -i echo $1.{} | \
while read ADDRESS
do
date
echo $ADDRESS\;Teste ping
ping -i 0.2 -c 2 -qn $ADDRESS
RETURN=$?
if [ $RETURN -eq 0 ]
then
echo $ADDRESS\;Sucesso ping
COLETA $ADDRESS $USER $PASSWORD $4 $PATHOUT/$ADDRESS.$4
else
echo $ADDRESS\;Falha ping
fi
done
}
seq 0 1 | \
while read SEQ
do
RANGE 1.2.3$SEQ 0 255 getconfig
done
seq 5 15 | \
while read SEQ
do
RANGE 1.3.$SEQ 0 255 getconfig
done