#!/usr/bin/ksh
# Surveillance par OPC des basculement HA
#
/opt/SUNWhadf/bin/haget -f mastered > /tmp/haget.result
cat /tmp/haget.result | awk ' { if ( $2 != "" ) { \
                               printf "%s\n%s\n", $1, $2 \
                               } else { \
                                        printf "%s\n", $1 ; \
                               }}' > /tmp/haget.result.bis
n_tot=`cat /tmp/haget.result.bis | wc -l|awk '{ print $1}'`
echo $n_tot > /tmp/toto
/logiciel/OpC/opcmon ESO_HABascule=$n_tot
