Script de nagios para comprobar si ha habido algún cambio en un switch de fibra

#!/bin/bash

export ORIGINAL=ruta/
export VOLATIL=ruta2/
ssh $1 -l nagios switchshow > $VOLATIL/$1
SALIDA=`diff $ORIGINAL/$1 $VOLATIL/$1 > /dev/null; echo $?`

if [ $SALIDA -eq 0 ];then
echo “Todos los WWN están en sus correspondientes puertos”
exit 0
elif [ $SALIDA -eq 1 ];then
echo “Todos los WWN no aparecen en sus correspondientes puertos”
exit 2
else
echo “Algo no va bien”
exit 3
fi

Para que funcione debe crearse una clave ssh, es simple pero funciona

This entry was posted in Brocade, nagios and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>