Dans la jungle très lucrative des « NAS appliance », c’est à dire des serveurs NAS intégré dans un hardware et un système spécifique, NetApp fait office de leader pour la qualité prix de ses produits. Nous allons voir ensemble dans ce billet comment superviser une machine NetApp FAS2200 à partir de Nagios ou de Shinken.
Note: ce billet doit également être valable pour l’ensemble des produits NetApp.
Récupération du plugin chek-netapp-ng
En cherchant un peu sur le Web, j’ai trouvé un plugin Nagios permettant de superviser finement ses machines NetApp. Bien que datant un peu, ce plugin est parfaitement fonctionnel.
Une fois connecté en SSH (en root) sur son serveur Nagios / Shinken (la procédure est la même), on commence donc par récupérer le plugin:
mkdir -p ~/tmp cd ~/tmp wget --no-check-certificate https://raw.githubusercontent.com/ranl/monitor-utils/master/nagios/check-netapp-ng.pl chmod a+x check-netapp-ng.pl
Installation du plugin chek-netapp-ng
L’installation différe ici si vous utilisez Nagios ou Shinken.
Pour installer le plugin sur Nagios, il faut saisir:
cp ~/check-netapp-ng.pl /usr/local/nagios/libexec/check-netapp-ng.pl chown nagios:nagios /usr/local/nagios/libexec/check-netapp-ng.pl
Pour Shinken:
cp ~/check-netapp-ng.pl /usr/local/shinken/libexec/check-netapp-ng.pl chown shinken:shinken /usr/local/shinken/libexec/check-netapp-ng.pl
Configuration du plugin chek-netapp-ng
Il faut ensuite éditer le fichier (par exemple /usr/local/shinken/libexec/check-netapp-ng.pl) pour y éditer la ligne numéro 15 avec le chemin vers les librairies:
use lib "/usr/local/shinken/libexec";
Note: Respectivement /usr/local/nagios/libexec pour Nagios.
On doit ensuite faire connaître le plugin à Shinken (ou Nagios) en ajoutant les lignes suivantes dans votre fichier commands.cfg (sous /usr/local/shinken/etc):
################################################################################
# Netapp check
#===============================================================================
# https://github.com/ranl/IT/blob/master/Nagios/check-netapp-ng.pl
################################################################################
define command {
command_name check_netapp_globalstatus
command_line $PLUGINSDIR$/check-netapp-ng.pl -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$ -T GLOBALSTATUS
}
define command {
command_name check_netapp_temp
command_line $PLUGINSDIR$/check-netapp-ng.pl -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$ -T TEMP
}
define command {
command_name check_netapp_fan
command_line $PLUGINSDIR$/check-netapp-ng.pl -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$ -T FAN
}
define command {
command_name check_netapp_ps
command_line $PLUGINSDIR$/check-netapp-ng.pl -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$ -T PS
}
define command {
command_name check_netapp_cpuload
command_line $PLUGINSDIR$/check-netapp-ng.pl -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$ -T CPULOAD
}
define command {
command_name check_netapp_nvram
command_line $PLUGINSDIR$/check-netapp-ng.pl -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$ -T NVRAM
}
define command {
command_name check_netapp_diskused
command_line $PLUGINSDIR$/check-netapp-ng.pl -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$ -T DISKUSED --vol $ARG1$
}
define command {
command_name check_netapp_faileddisk
command_line $PLUGINSDIR$/check-netapp-ng.pl -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$ -T FAILEDDISK
}
Déclaration de votre serveur NAS
Il ne reste plus qu’à définir votre serveur NAS dans la configuration de Shinken (ou de Nagios). Par exemple, j’ai un fichier nas01.cfg qui contient:
define host {
use ssh,generic-host
host_name nas01
address 192.168.1.130
}
define service {
use generic-service
host_name nas01
service_description NetAPP Global status
check_command check_netapp_globalstatus
}
define service {
use generic-service
host_name nas01
service_description NetAPP Temperature
check_command check_netapp_temp
}
define service {
use generic-service
host_name nas01
service_description NetAPP FAN
check_command check_netapp_fan
}
define service {
use generic-service
host_name nas01
service_description NetAPP Power Supply
check_command check_netapp_ps
}
define service {
use generic-service
host_name nas01
service_description NetAPP CPU LOAD
check_command check_netapp_cpuload
}
define service {
use generic-service
host_name nas01
service_description NetAPP NVRAM
check_command check_netapp_nvram
}
define service {
use generic-service
host_name nas01
service_description NetAPP Disk used Home
check_command check_netapp_diskused!/vol/vol0/
}
define service {
use generic-service
host_name nas01
service_description NetAPP Disk used Archive
check_command check_netapp_diskused!/vol/vol_ARCHIVE/
}
define service {
use generic-service
host_name nas01
service_description NetAPP Disk used Install
check_command check_netapp_diskused!/vol/vol_INSTALL/
}
define service {
use generic-service
host_name nas01
service_description NetAPP Failed disk
check_command check_netapp_faileddisk
}
Une fois Shinken (ou Nagios) redémarré et après les premiers checks, vous devriez voir la page de supervision apparaître dans l’interface Web (comme au début de ce billet).
On peut donc superviser les choses suivantes:
- La charge CPU (ce qui peut être utile si votre serveur NAS est trop chargé, par exemple trop d’accès simultanés)
- La taille utilisé par partitions
- L’état des ventilateuts
- L’état des disques (supervision du RAID)
- Le status global
Voilà une bonne chose de faite: la supervision du serveur le plus sensible (il y a toutes vos données dessus normalement) de votre infrastructure.
