Monitorización de un servidor Netapp en Nagios

Pues ahora vamos a monitorizar un servidor  de almacenamiento Netapp, Para su monitorización vamos a utilizar el protocolo SNMP(Si no lo sabéis activar SNMP en una netapp AQUI tenemos un manual) y los chequeos van a ser de Memoria, CPU, Disco, PING, temperatura, ventiladores, Fallo de disco y batería.

Una vez ya tenemos instalado y configurado  SNMP vamos a empezar a monitorizar.

Definir los comandos: 

para definir tenemos que añadir los siguientes comandos al fichero commands.cfg, este fichero estará… dependiendo de la instalación que habríais realizado:

vi /etc/nagios3/commands.cfg

Y añadimos lo siguiente:

define command {
command_name check_netapp_cpu
command_line /usr/bin/perl $USER1$/check_netapp3.pl -H $HOSTADDRESS$ -C public -v $ARG1$ -w $ARG2$ -c $ARG3$
}

define command{
command_name check_netapp_diskused
command_line /usr/bin/perl $USER1$/check_netapp_disk -H $HOSTADDRESS$ -C $ARG1$ -t $ARG2$ -v DISKUSED -o $ARG3$ -w $ARG4$ -c $ARG5$
}

 

define command{
command_name check_netapp_nvram
command_line $USER1$/check_netapp -H $HOSTADDRESS$ -P 1 -C $ARG1$ -t $ARG2$ -v NVRAM
}

define command{
command_name check_netapp_faileddisk
command_line $USER1$/check_netapp -H $HOSTADDRESS$ -P 1 -C $ARG1$ -t $ARG2$ -v FAILEDDISK
}

define command{
command_name check_netapp_fan
command_line $USER1$/check_netapp -H $HOSTADDRESS$ -P 1 -C $ARG1$ -t $ARG2$ -v FAN
}

define command{
command_name check_netapp_power
command_line $USER1$/check_netapp -H $HOSTADDRESS$ -P 1 -C $ARG1$ -t $ARG2$ -v PS
}

define command{
command_name check_netapp_temp
command_line $USER1$/check_netapp -H $HOSTADDRESS$ -P 1 -C $ARG1$ -t $ARG2$ -v TEMP
}

Creamos las carpetas donde vamos a alojar los archivos de configuración 

mkdir /etc/nagios3/etc/cfg/Netapp/

Accedemos al direcctorio 

cd /etc/nagios3/etc/cfg/Netapp/

Creamos el fichero hosts.cfg con el siguiente contenido

 

hostgroup_name grupo-netapp
alias Almacenamiento Netapp
members redorbitanetapp_192.168.1.18
}

#Ping to hosts

define service {
use netapp-srv
hostgroup_name grupo-netapp
service_description netapp redorbitanetapp – ping
check_command check_ping!100.0,10%!500.0,20%
}
#Hosts Definition

 

define host {
use netapp-srv
host_name redorbitanetapp_192.168.1.18
alias redorbitanetapp
address 192.168.1.18
}

Creamos el fichero templete.cfg en el cual vamos a definir los servicios. 

define host {
name netapp-srv
flap_detection_enabled 1
notification_period 24×7
notification_options d,u,r
retain_status_information 1
retain_nonstatus_information 1
contact_groups grupo-netapp
# check_command check_command_blank
max_check_attempts 3
register 0

}

 

define service {
name netapp-srv
check_period 24×7
flap_detection_enabled 1
notification_period 24×7
notification_options w,u,c,r
parallelize_check 1
retain_status_information 1
retain_nonstatus_information 1
max_check_attempts 3
normal_check_interval 3
retry_check_interval 1
contact_groups grupo-netapp
register 0
}

 Definimos el archivo de contacto contacts.cfg

define contact{
contact_name grupo-netapp
alias grupo-netapp
service_notification_period 24×7
host_notification_period 24×7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-service-by-email
host_notification_commands notify-host-by-email
email root@localhost
}
define contactgroup {
contactgroup_name grupo-netapp
alias Grupo de Linux
members grupo-netapp
}

Y por ultimo definimos los chequeos redorbitanetapp.cfg

 

define service{
use netapp-srv
host_name redorbitanetapp_192.168.1.18
service_description Ocupacion Disco Aggregado0
check_command check_netapp_diskused!public!120!aggr0!80!50
}

 

define service{
use netapp-srv
host_name redorbitanetapp_192.168.1.18
service_description CPULOAD
check_command check_netapp_cpu!CPULOAD!80!90
}

define service{
use netapp-srv
host_name redorbitanetapp_192.168.1.18
service_description Fallo en disco
check_command check_netapp_faileddisk!public!120
}

define service{
use netapp-srv
host_name redorbitanetapp_192.168.1.18
service_description Estado Bateria Nvram
check_command check_netapp_nvram!public!120
}

define service{
use netapp-srv
host_name redorbitanetapp_192.168.1.18
service_description Temperatura
check_command check_netapp_temp!public!120
}

define service{
use netapp-srv
host_name redorbitanetapp_192.168.1.18
service_description Ventiladores
check_command check_netapp_fan!public!120
}

define service{
use netapp-srv
host_name redorbitanetapp_192.168.1.18
service_description Fuente de Alimentacion
check_command check_netapp_power!public!120

}

 

Una vez creado el fichero tenemos que añadir la ruta de los mismos en el archivo nagios.cfg

vi /etc/nagios3/nagios.cfg

Al final del archivo añadimos lo siguiente:


############## Monitorización Neapp #############

cfg_file=/etc/nagios3/etc/cfg/Netapp/templete.cfg
cfg_file=/etc/nagios3/etc/cfg/Netapp/hosts.cfg
cfg_file=/etc/nagios3/etc/cfg/Netapp/redorbitanetapp.cfg
cfg_file=/etc/nagios3/etc/cfg/Netapp/contacts.cfg

 

Chequeamos para ver si no hay ningún error en los archivos de configuración

rokitoh@nagios:/etc/nagios3/etc/cfg/Netapp# /etc/init.d/nagios3 check

 

Nagios Core 3.2.1
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 03-09-2010
License: GPL

Website: http://www.nagios.org
Reading configuration data…
Read main config file okay…
Processing object config file ‘/etc/nagios3/commands.cfg’…
Processing object config directory ‘/usr/lib/nagios/plugins’…
Processing object config file ‘/usr/lib/nagios/plugins/mailq.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/snmp_storage.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/ifstatus.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/snmp_load.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/breeze.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/ftp.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/apt.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/tcp_udp.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/ntp.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/dummy.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/mrtg.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/rpc-nfs.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/users.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/games.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/real.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/pgsql.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/snmp_vrrp.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/flexlm.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/snmp_win.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/ssh.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/ping.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/news.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/telnet.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/radius.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/fping.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/netware.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/snmp_cpfw.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/snmp.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/snmp_process.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/procs.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/ldap.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/mysql.cfg’…
Processing object config directory ‘/usr/lib/nagios/plugins/doc’…
Processing object config file ‘/usr/lib/nagios/plugins/snmp_int.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/snmp_mem.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/snmp_env.cfg’…
Processing object config file ‘/usr/lib/nagios/plugins/load.cfg’…
Processing object config directory ‘/etc/nagios3/conf.d’…
Processing object config file ‘/etc/nagios3/conf.d/timeperiods_nagios2.cfg’…
Processing object config file ‘/etc/nagios3/conf.d/contacts.cfg’…
Processing object config file ‘/etc/nagios3/conf.d/generic-host_nagios2.cfg’…
Processing object config file ‘/etc/nagios3/conf.d/generic-service_nagios2.cfg’…
Processing object config file ‘/etc/nagios3/etc/cfg/Windows/templete.cfg’…
Processing object config file ‘/etc/nagios3/etc/cfg/Windows/hosts.cfg’…
Processing object config file ‘/etc/nagios3/etc/cfg/Windows/cpd01.cfg’…
Processing object config file ‘/etc/nagios3/etc/cfg/Windows/contacts.cfg’…
Processing object config file ‘/etc/nagios3/etc/cfg/Linux/templete.cfg’…
Processing object config file ‘/etc/nagios3/etc/cfg/Linux/hosts.cfg’…
Processing object config file ‘/etc/nagios3/etc/cfg/Linux/cacti.cfg’…
Processing object config file ‘/etc/nagios3/etc/cfg/Linux/contacts.cfg’…
Processing object config file ‘/etc/nagios3/etc/cfg/Netapp/templete.cfg’…
Processing object config file ‘/etc/nagios3/etc/cfg/Netapp/hosts.cfg’…
Processing object config file ‘/etc/nagios3/etc/cfg/Netapp/redorbitanetapp.cfg’…
Processing object config file ‘/etc/nagios3/etc/cfg/Netapp/contacts.cfg’…
Warning: Duplicate definition found for service ‘Uso CPU’ on host ‘cacti_192.168.1.111’ (config file ‘/etc/nagios3/etc/cfg/Linux/cacti.cfg’, starting on line 23)
Warning: Duplicate definition found for service ‘Uso CPU’ on host ‘cacti_192.168.1.111’ (config file ‘/etc/nagios3/etc/cfg/Linux/cacti.cfg’, starting on line 16)
Read object config files okay…

Running pre-flight check on configuration data…

Checking services…
Checked 24 services.
Checking hosts…
Checked 3 hosts.
Checking host groups…
Checked 3 host groups.
Checking service groups…
Checked 0 service groups.
Checking contacts…
Checked 4 contacts.
Checking contact groups…
Checked 4 contact groups.
Checking service escalations…
Checked 0 service escalations.
Checking service dependencies…
Checked 0 service dependencies.
Checking host escalations…
Checked 0 host escalations.
Checking host dependencies…
Checked 0 host dependencies.
Checking commands…
Checked 193 commands.
Checking time periods…
Checked 4 time periods.
Checking for circular paths between hosts…
Checking for circular host and service dependencies…
Checking global event handlers…
Checking obsessive compulsive processor commands…
Checking misc settings…

Total Warnings: 0
Total Errors: 0

Things look okay – No serious problems were detected during the pre-flight check

Y reiniciamos nagios

rokitoh@nagios:/etc/nagios3/etc/cfg/Netapp# /etc/init.d/nagios3 reload
Reloading nagios3 monitoring daemon configuration files: nagios3.
rokitoh@nagios:/etc/nagios3/etc/cfg/Netapp#

Abrimos nagios en nuestro navegador favorito y si todo a salido bien lo tendríamos que tener OK!

 

 

Un saludo, rokitoh!

 

One thought on “Monitorización de un servidor Netapp en Nagios

  1. Pingback: Monitorizar Cluster Netapp en Nagios | Red-Orbita

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

*