miércoles, 25 de septiembre de 2013

Disk Storage IBM Storwize V3700 Monitoring with Nagios:


Descargué el plugin llamado check_ibm_v7000.sh de:

http://exchange.nagios.org/components/com_mtree/attachment.php?link_id=3157&cf_id=24


Probé primero que funcione desde el bash ejecutando, lo siguiente, donde -M es la ip del storage, -U user (debe existir en el storage) y -Q la consulta:

# /ruta/del/plugins/check_ibm_v7000.sh -M 192.168.0.100 -U nagios -Q lsdrive
Password:


En este caso me devolvió que tengo el disco 9 dañado en el storage:

CRITICAL: Disk OFFLINE
 OK: Drive 0 is online
 OK: Drive 1 is online
 OK: Drive 2 is online
 OK: Drive 3 is online
 OK: Drive 4 is online
 OK: Drive 5 is online
 OK: Drive 6 is online
 OK: Drive 7 is online
 OK: Drive 8 is online
 ATTENTION: Disk 9
status:
role: failed
type: sas_hdd
capacity: 558.4GB
enclosure:
slot:   OK: Drive 10 is online
 OK: Drive 11 is online
 OK: Drive 12 is online
 OK: Drive 13 is online
 OK: Drive 14 is online
 OK: Drive 15 is online
 OK: Drive 16 is online
 OK: Drive 17 is online
 OK: Drive 18 is online
 OK: Drive 19 is online
 OK: Drive 20 is online
 OK: Drive 21 is online
 OK: Drive 22 is online
 OK: Drive 23 is online
 OK: Drive 24 is online
 OK: Drive 25 is online
 OK: Drive 26 is online
 OK: Drive 27 is online
 OK: Drive 28 is online
 OK: Drive 29 is online
 OK: Drive 30 is online
 OK: Drive 31 is online
 OK: Drive 32 is online
 OK: Drive 33 is online
 OK: Drive 34 is online
 OK: Drive 35 is online
 OK: Drive 36 is online
 OK: Drive 37 is online
 OK: Drive 38 is online
 OK: Drive 39 is online
 OK: Drive 40 is online
 OK: Drive 41 is online
 OK: Drive 42 is online
 OK: Drive 43 is online
 OK: Drive 44 is online
 OK: Drive 45 is online
 OK: Drive 46 is online
 OK: Drive 47 is online


Nos logueamos al server donde tenemos instalado nagios con el usuario nagios y generamos las keys para que no nos pida password:

# su - nagios
$ cd /home/nagios/.ssh/
$ ssh-keygen
$ ls
id_rsa  id_rsa.pub  known_hosts


Copiamos la llave pública por winscp a nuestro equipo: id_rsa.pub para luego importarla al storage por web, vamos a usuarios:



Creamos un nuevo usuario en el grupo monitor:


Le asignamos un nombre, en mi caso nagios, que use autenticación local:


Importamos la llave pública generada en el server de monitoreo para el usuario nagios:


Quedándonos así:



Agregamos el host al nagios:

# vim /ruta/del/nagios/hosts.cfg
define host{
        use                     linux-server
        host_name               STORAGE
        alias                   STORAGE
        address                 192.168.0.100
        }


Parametrizamos el comando:

# vim /ruta/del/nagios/commands.cfg
define command{
command_name check_storage
command_line $USER1$/check_ibm_v7000.sh -M $HOSTADDRESS$ -U $ARG1$ -Q $ARG2$
}


Configuramos el Servicio:

# vim /ruta/del/nagios/services.cfg
define service{
use                             generic-service
host_name                       STORAGE
service_description             STORAGE_DISKs
check_command                   check_storage!nagios!lsdrive
}