martes, 29 de julio de 2008

AoE

Hoy hablaré como verl estado de un raid (Coraid) a través de ATA Over Ethernet (aoe)

Para ello utilizaremos Coraid Ethernet Console client

Una vez descomprimido, compilado podemos ejecutar para ver el estado:


datos:~/cec-8# ./cec -s 1 eth1
Probing for shelves ... shelf 1 found.
connecting ... done.
Escape is Ctrl-\

SR shelf 1> show -l
1.0 500.108GB up
1.1 500.108GB up
1.2 500.108GB up
1.3 500.108GB up
1.4 500.108GB up
1.5 500.108GB up
1.6 500.108GB up
1.7 500.108GB up
1.8 0.000GB down
1.9 0.000GB down
1.10 0.000GB down
1.11 0.000GB down
1.12 0.000GB down
1.13 0.000GB down
1.14 0.000GB down
SR shelf 1> list
1 2000.431GB online
2 1000.216GB online
SR shelf 1> list -l
1 2000.431GB online
1.0 2000.431GB raid5 normal
1.0.0 normal 500.108GB 1.0
1.0.1 normal 500.108GB 1.1
1.0.2 normal 500.108GB 1.2
1.0.3 normal 500.108GB 1.3
1.0.4 normal 500.108GB 1.4
2 1000.216GB online
2.0 1000.216GB raid5 normal
2.0.0 normal 500.108GB 1.5
2.0.1 normal 500.108GB 1.6
2.0.2 normal 500.108GB 1.7


Yo me he hecho un pequeño script en expect para que compruebe si el estado del raid es "online". Lo que hace es lanzar el "cec", hacer un list y salir.

#!/usr/bin/expect -f
set send_slow {1 .1}
proc send {ignore arg} {
sleep .3
exp_send -s -- $arg
}

set timeout -1
spawn /root/cec-8/cec -s 1 eth1
match_max 100000
expect -exact "Probing for shelves ... shelf 1 found.\r
connecting ... done.\r
Escape is Ctrl-\\\r
"
send -- "\r"
expect -exact "\r\r
SR shelf 1> "
send -- "list\r"
send -- "\r"
expect -exact "\r\r
SR shelf 1> "
send -- ""
expect -exact ">>> "
send -- "q\r"
expect eof

No hay comentarios: