Hello, nous allons voir dans ce chapitre la supervision des baies de stockage NetApp SANtricity via RestAPI avec Centreon et les plugins packs. Je vous donne comme d’habitude, la commande CLI/Centreon web et un exemple de service.
Ce qu’il vous faut :
- Plateforme de supervision Centreon
- Centreon Plugin Packs: installation-mise-a-jour-centreon-plugin-packs/
- Compte de monitoring Netapp : monitor
- (Setting > Access Management > Local User Roles)
Documentation NetAPP :
- Doc API: library.netapp.com
- NetApp GitHub: github.com/NetApp
Les macros personnalisées : Configuration > Collecteurs > Ressources
- $_SERVICEPLUGIN$
- $_SERVICEMODE$
- $_SERVICEUSERNAME$
- $_SERVICEPASSWORD$
- $_SERVICETIMEOUT$
- $_SERVICEWARNING$
- $_SERVICECRITICAL$
- $_SERVICEEXTRAOPTIONS$
Supervision NetAPP SANtricity (CLI)
Commençons en ligne de commande depuis le serveur Centreon.
Recherche de plugin de supervision pour Netapp SANtricity :
[root@pixelabs plugins]# perl centreon_plugins.pl --list-plugin | grep netapp | grep PLUGI PLUGIN: apps::backup::netapp::snapcenter::restapi::plugin PLUGIN: storage::netapp::ontap::oncommandapi::plugin PLUGIN: storage::netapp::ontap::restapi::plugin PLUGIN: storage::netapp::ontap::snmp::plugin PLUGIN: storage::netapp::santricity::restapi::plugin [root@pixelabs plugins]#
C’est le dernier dans la lise : PLUGIN: storage::netapp::santricity::restapi::plugin
Afficher les modes disponible :
[root@pixelabs plugins]# ./centreon_plugins.pl --plugin=storage::netapp::santricity::restapi::plugin --list-mode Plugin Description: Check Netapp storages with Santricity using Rest API. Global Options: --mode Choose a mode. --dyn-mode Specify a mode with the path (separated by '::'). --list-mode List available modes. --mode-version Check minimal version of mode. If not, unknown error. --version Display plugin version. --custommode Choose a custom mode. --list-custommode List available custom modes. --multiple Multiple custom mode objects (required by some specific modes) --pass-manager Use a password manager. Modes Meta: multi Modes Available: hardware storage-controllers storage-pools storage-systems storage-volumes [root@pixelabs plugins]#
Les modes dispo dans ce plugin :
Modes Available: hardware storage-controllers storage-pools storage-systems storage-volumes
Sélectionner un mode et afficher les paramètres. Exemple : Hardware
[root@pixelabs plugins]# ./centreon_plugins.pl --plugin=storage::netapp::santricity::restapi::plugin --mode=hardware --help Plugin Description: Check Netapp storages with Santricity using Rest API. Global Options: --mode Choose a mode. --dyn-mode Specify a mode with the path (separated by '::'). --list-mode List available modes. --mode-version Check minimal version of mode. If not, unknown error. --version Display plugin version. --custommode Choose a custom mode. --list-custommode List available custom modes. --multiple Multiple custom mode objects (required by some specific modes) --pass-manager Use a password manager. Output Options: --verbose Display long output. --debug Display also debug messages. --filter-perfdata Filter perfdata that match the regexp. --explode-perfdata-max Put max perfdata (if it exist) in a specific perfdata (without values: same with '_max' suffix) (Multiple options) --change-perfdata --extend-perfdata Change or extend perfdata. Syntax: --extend-perfdata=searchlabel,newlabel,target[,[newuom],[min],[m ax]] Common examples: Change storage free perfdata in used: --change-perfdata=free,used,invert() Change storage free perfdata in used: --change-perfdata=used,free,invert() Scale traffic values automaticaly: --change-perfdata=traffic,,scale(auto) Scale traffic values in Mbps: --change-perfdata=traffic_in,,scale(Mbps),mbps Change traffic values in percent: --change-perfdata=traffic_in,,percent() --extend-perfdata-group Extend perfdata from multiple perfdatas (methods in target are: min, max, average, sum) Syntax: --extend-perfdata-group=searchlabel,newlabel,target[,[newuom],[m in],[max]] Common examples: Sum wrong packets from all interfaces (with interface need --units-errors=absolute): --extend-perfdata-group=',packets_wrong,sum(packets_(discard |error)_(in|out))' Sum traffic by interface: --extend-perfdata-group='traffic_in_(.*),traffic_$1,sum(traf fic_(in|out)_$1)' --change-short-output Change short output display. --change-short-output=pattern~replace~modifier --range-perfdata Change perfdata range thresholds display: 1 = start value equals to '0' is removed, 2 = threshold range is not display. --filter-uom Filter UOM that match the regexp. --opt-exit Optional exit code for an execution error (i.e. wrong option provided, SSH connection refused, timeout, etc) (Default: unknown). --output-ignore-perfdata Remove perfdata from output. --output-ignore-label Remove label status from output. --output-xml Display output in XML format. --output-json Display output in JSON format. --output-openmetrics Display metrics in OpenMetrics format. --output-file Write output in file (can be used with json and xml options) --disco-format Display discovery arguments (if the mode manages it). --disco-show Display discovery values (if the mode manages it). --float-precision Set the float precision for thresholds (Default: 8). --source-encoding Set encoding of monitoring sources (In some case. Default: 'UTF-8'). Rest api Options: Netapp Santricity Rest API --hostname Santricity hostname. --port Port used (Default: 8080) --proto Specify https if needed (Default: 'http') --api-username Santricity API username. --api-password Santricity API password. --api-path Specify api path (Default: '/devmgr/v2') --timeout Set timeout in seconds (Default: 10). Http Global Options: --http-peer-addr Set the address you want to connect (Useful if hostname is only a vhost. no ip resolve) --proxyurl Proxy URL --proxypac Proxy pac file (can be an url or local file) --insecure Insecure SSL connections. --http-backend Set the backend used (Default: 'lwp') For curl: --http-backend=curl Backend lwp Options: --ssl-opt Set SSL Options (--ssl-opt="SSL_version => TLSv1" --ssl-opt="SSL_verify_mode => SSL_VERIFY_NONE"). --ssl Set SSL version (--ssl=TLSv1). Backend Curl Options: --curl-opt Set CURL Options (--curl-opt="CURLOPT_SSL_VERIFYPEER => 0" --curl-opt="CURLOPT_SSLVERSION => CURL_SSLVERSION_TLSv1_1" ). Mode: Check hardware. --component Which component to check (Default: '.*'). Can be: 'storage', 'ctrl', 'battery', 'board', 'cbd', 'cmd', 'drive', 'psu', 'fan', 'thsensor'. --filter Exclude some parts (comma seperated list) Can also exclude specific instance: --filter='drive,010000005000C500C244251B0000000000000000' --no-component Return an error if no compenents are checked. If total (with skipped) is 0. (Default: 'critical' returns). --threshold-overload Set to overload default threshold values (syntax: section,[instance,]status,regexp) It used before default thresholds (order stays). Example: --threshold-overload='drive,OK,preFailCopy' --warning Set warning threshold for 'temperature' (syntax: type,regexp,threshold) Example: --warning='drive.temperature,.*,40' --critical Set critical threshold for 'drive.temperature' (syntax: type,regexp,threshold) Example: --critical='drive.temperature,.*,50' [root@pixelabs plugins]#
NetAPP SANtricity Hardware
Check NetAPP SANtricity Hardware.
Si vous n’avez pas de certificat valide, désactiver la vérification SSL avec le paramètre : --ssl-opt="SSL_verify_mode => SSL_VERIFY_NONE"
[root@pixelabs plugins]# perl centreon_plugins.pl --plugin=storage::netapp::santricity::restapi::plugin --mode=hardware --hostname=NETAPP-SAN --api-username=monitor --api-password=password --ssl-opt="SSL_verify_mode => SSL_VERIFY_NONE" --verbose CRITICAL: Drive 'NETAPP-SAN:23:23' status is 'failed' WARNING: Storage '' status is 'needsAttn' | [ ... ] checking storages storage 'NETAPP-SAN' status is 'needsAttn' [instance = 721905500206] checking controllers controller 'NETAPP-SAN:2:2' status is 'optimal' [instance = 070000000000000000000002] controller 'NETAPP-SAN:1:1' status is 'optimal' [instance = 070000000000000000000001] checking batteries battery 'NETAPP-SAN:1:1' status is 'optimal' [instance = 0900000000000000000001000000000000000000] battery 'NETAPP-SAN:1:2' status is 'optimal' [instance = 0900000000000000000002000000000000000000] checking boards board 'NETAPP-SAN:1:1' status is 'optimal' [instance = 1E00000000000000000001000000000000000000] board 'NETAPP-SAN:1:2' status is 'optimal' [instance = 1E00000000000000000002000000000000000000] checking cache backup devices cache backup device 'NETAPP-SAN:2:3' status is 'optimal' [instance = 24000000380184003D4999000000000000000000] cache backup device 'NETAPP-SAN:1:1' status is 'optimal' [instance = 240000003001840039B999000000000000000000] checking cache memory dimms cache memory dimm 'NETAPP-SAN:1:1' status is 'optimal' [instance = 2600000000000000000001000000000000000000] cache memory dimm 'NETAPP-SAN:1:3' status is 'optimal' [instance = 2600000000000000000003000000000000000000] cache memory dimm 'NETAPP-SAN:2:2' status is 'optimal' [instance = 2600000000000000000002000000000000000000] cache memory dimm 'NETAPP-SAN:2:4' status is 'optimal' [instance = 2600000000000000000004000000000000000000] checking drives drive 'NETAPP-SAN:22:22' status is 'optimal' [instance = 010000005000C5009A50666F0000000000000000] [temperature: 18] drive 'NETAPP-SAN:2:2' status is 'optimal' [instance = 010000005000C500BCAA78BB0000000000000000] [temperature: 17] drive 'NETAPP-SAN:8:8' status is 'optimal' [instance = 010000005000C500BCAA79470000000000000000] [temperature: 17] drive 'NETAPP-SAN:19:19' status is 'optimal' [instance = 010000005000C500BCAA7AA30000000000000000] [temperature: 18] drive 'NETAPP-SAN:9:9' status is 'optimal' [instance = 010000005000C500BCAA7C9B0000000000000000] [temperature: 18] drive 'NETAPP-SAN:7:7' status is 'optimal' [instance = 010000005000C500BCAA801F0000000000000000] [temperature: 17] drive 'NETAPP-SAN:18:18' status is 'optimal' [instance = 010000005000C500BCAA803B0000000000000000] [temperature: 18] drive 'NETAPP-SAN:5:5' status is 'optimal' [instance = 010000005000C500BCAA81BF0000000000000000] [temperature: 18] drive 'NETAPP-SAN:14:14' status is 'optimal' [instance = 010000005000C500BCAA89330000000000000000] [temperature: 18] drive 'NETAPP-SAN:13:13' status is 'optimal' [instance = 010000005000C500BCAA8E870000000000000000] [temperature: 18] drive 'NETAPP-SAN:24:24' status is 'optimal' [instance = 010000005000C500BCAA958F0000000000000000] [temperature: 18] drive 'NETAPP-SAN:10:10' status is 'optimal' [instance = 010000005000C500BCAA95FB0000000000000000] [temperature: 18] drive 'NETAPP-SAN:1:1' status is 'optimal' [instance = 010000005000C500BCAA967F0000000000000000] [temperature: 18] drive 'NETAPP-SAN:15:15' status is 'optimal' [instance = 010000005000C500BCAA97AF0000000000000000] [temperature: 18] drive 'NETAPP-SAN:11:11' status is 'optimal' [instance = 010000005000C500BCAA9B2B0000000000000000] [temperature: 18] drive 'NETAPP-SAN:21:21' status is 'optimal' [instance = 010000005000C500BCAAA73B0000000000000000] [temperature: 18] drive 'NETAPP-SAN:16:16' status is 'optimal' [instance = 010000005000C500BCAAAC6B0000000000000000] [temperature: 18] drive 'NETAPP-SAN:12:12' status is 'optimal' [instance = 010000005000C500BCAAAC7F0000000000000000] [temperature: 18] drive 'NETAPP-SAN:3:3' status is 'optimal' [instance = 010000005000C500BCAADD970000000000000000] [temperature: 17] drive 'NETAPP-SAN:23:23' status is 'failed' [instance = 010000005000C500BCAAE02B0000000000000000] [temperature: 255] drive 'NETAPP-SAN:20:20' status is 'optimal' [instance = 010000005000C500BCAAE12B0000000000000000] [temperature: 18] drive 'NETAPP-SAN:4:4' status is 'optimal' [instance = 010000005000C500BD7A96570000000000000000] [temperature: 17] drive 'NETAPP-SAN:17:17' status is 'optimal' [instance = 010000005000C500C1985CA70000000000000000] [temperature: 18] drive 'NETAPP-SAN:6:6' status is 'optimal' [instance = 010000005000C500CE25182B0000000000000000] [temperature: 17] checking power supplies power supply 'NETAPP-SAN:1:1' status is 'optimal' [instance = 0A00000000000000000001000000000000000000] power supply 'NETAPP-SAN:1:2' status is 'optimal' [instance = 0A00000000000000000002000000000000000000] checking fans fan 'NETAPP-SAN:2:2' status is 'optimal' [instance = 0800000000000000000002000000000000000000] fan 'NETAPP-SAN:2:4' status is 'optimal' [instance = 0800000000000000000004000000000000000000] fan 'NETAPP-SAN:1:3' status is 'optimal' [instance = 0800000000000000000003000000000000000000] fan 'NETAPP-SAN:1:1' status is 'optimal' [instance = 0800000000000000000001000000000000000000] checking thermal sensors thermal sensor 'NETAPP-SAN:1:5' status is 'optimal' [instance = 0B00000000000000000005000000000000000000] thermal sensor 'NETAPP-SAN:1:6' status is 'optimal' [instance = 0B00000000000000000006000000000000000000] thermal sensor 'NETAPP-SAN:inlet:2:2' status is 'optimal' [instance = 0B00000000000000000002000000000000000000] thermal sensor 'NETAPP-SAN:inlet:2:4' status is 'optimal' [instance = 0B00000000000000000004000000000000000000] thermal sensor 'NETAPP-SAN:CPU:1:1' status is 'optimal' [instance = 0B00000000000000000001000000000000000000] thermal sensor 'NETAPP-SAN:CPU:1:3' status is 'optimal' [instance = 0B00000000000000000003000000000000000000] [root@pixelabs plugins]#
La commande Centreon web : Configuration > commandes > Vérifications
- Nom de commande : Netapp-SANtricity-Hardware
- Type : Vérifications (check)
$USER2$/centreon_plugins.pl --plugin=$_SERVICEPLUGIN$ --mode=$_SERVICEMODE$ --hostname=$HOSTADDRESS$ --api-username=$_SERVICEUSERNAME$ --api-password=$_SERVICEPASSWORD$ --timeout=$_SERVICETIMEOUT$ --component=$_SERVICECOMPONENT$ $_SERVICEEXTRAOPTIONS$
NetAPP SANtricity Controllers
Check NetAPP SANtricity storage Controllers :
[root@pixelabs plugins]# perl centreon_plugins.pl --plugin=storage::netapp::santricity::restapi::plugin --mode=storage-controllers --hostname=NETAPP-SAN --api-username=monitor --api-password=password --ssl-opt="SSL_verify_mode => SSL_VERIFY_NONE" --verbose OK: storage system 'NETAPP-SAN' controllers are ok | [ ... ] checking storage system 'NETAPP-SAN' controller 'A' status: optimal, cpu usage: 34.34 %, read: 19.26 MB/s, write: 6.00 MB/s, read: 130.46 iops, write: 126.46 iops controller 'B' status: optimal, cpu usage: 34.28 %, read: 15.10 MB/s, write: 5.68 MB/s, read: 117.52 iops, write: 117.15 iops [root@pixelabs plugins]#
La commande Centreon web : Configuration > commandes > Vérifications
- Nom de commande : Netapp-SANtricity-Controllers
- Type : Vérifications (check)
$USER2$/centreon_plugins.pl --plugin=$_SERVICEPLUGIN$ --mode=$_SERVICEMODE$ --hostname=$HOSTADDRESS$ --api-username=$_SERVICEUSERNAME$ --api-password=$_SERVICEPASSWORD$ --timeout=$_SERVICETIMEOUT$ --warning-controller-status=$_SERVICEWARNING$ --critical-controller-status=$_SERVICECRITICAL$ $_SERVICEEXTRAOPTIONS$
NetAPP SANtricity Pools
Check NetAPP SANtricity storage Pools.
[root@pixelabs plugins]# perl centreon_plugins.pl --plugin=storage::netapp::santricity::restapi::plugin --mode=storage-pools --hostname=NETAPP-SAN --api-username=monitor --api-password=password --ssl-opt="SSL_verify_mode => SSL_VERIFY_NONE" --verbose OK: storage system 'NETAPP-SAN' pools are ok | [ ... ] pool 'Aggr_01' state: complete [raid status: optimal], space usage total: 16.32 TB used: 16.32 TB (100.00%) free: 152.11 MB (0.00%) pool 'Aggr_02' state: complete [raid status: optimal], space usage total: 16.32 TB used: 16.32 TB (100.00%) free: 152.11 MB (0.00%) [root@pixelabs plugins]#
La commande Centreon web : Configuration > commandes > Vérifications
- Nom de commande : Netapp-SANtricity-Pools
- Type : Vérifications (check)
$USER2$/centreon_plugins.pl --plugin=$_SERVICEPLUGIN$ --mode=$_SERVICEMODE$ --hostname=$HOSTADDRESS$ --api-username=$_SERVICEUSERNAME$ --api-password=$_SERVICEPASSWORD$ --timeout=$_SERVICETIMEOUT$ --warning-pool-status=$_SERVICEWARNING$ --critical-pool-status=$_SERVICECRITICAL$ $_SERVICEEXTRAOPTIONS$
NetAPP SANtricity Systems
Check NetAPP SANtricity storage systems.
[root@pixelabs plugins]# perl centreon_plugins.pl --plugin=storage::netapp::santricity::restapi::plugin --mode=storage-systems --hostname=NETAPP-SAN --api-username=monitor --api-password=password --ssl-opt="SSL_verify_mode => SSL_VERIFY_NONE" --verbose CRITICAL: storage system 'NETAPP-SAN' status: needsAttn | [ ... ] storage system 'NETAPP-SAN' status: needsAttn, space usage total: 32.64 TB used: 32.64 TB (100.00%) free: 304.22 MB (0.00%) [root@pixelabs plugins]#
La commande Centreon web : Configuration > commandes > Vérifications
- Nom de commande : Netapp-SANtricity-Systems
- Type : Vérifications (check)
$USER2$/centreon_plugins.pl --plugin=$_SERVICEPLUGIN$ --mode=$_SERVICEMODE$ --hostname=$HOSTADDRESS$ --api-username=$_SERVICEUSERNAME$ --api-password=$_SERVICEPASSWORD$ --timeout=$_SERVICETIMEOUT$ --critical-status=$_SERVICECRITICAL$ $_SERVICEEXTRAOPTIONS$
NetAPP SANtricity Volumes
Check NetAPP SANtricity storage Volumes.
[root@pixelabs plugins]# ./centreon_plugins.pl --plugin=storage::netapp::santricity::restapi::plugin --mode=storage-volumes --hostname=NETAPP-SAN --api-username=monitor --api-password=password --ssl-opt="SSL_verify_mode => SSL_VERIFY_NONE" --verbose OK: storage system 'NETAPP-SAN' volumes are ok | [ ... ] checking storage system 'NETAPP-SAN' volume 'SRV_PIXEL_01_L1' status: optimal, read: 971.57 KB/s, write: 1003.61 KB/s, read: 11.49 iops, write: 18.89 iops volume 'SRV_PIXEL_01_L2' status: optimal, read: 2.96 MB/s, write: 650.41 KB/s, read: 17.84 iops, write: 15.79 iops volume 'SRV_PIXEL_01_L3' status: optimal, read: 759.82 KB/s, write: 922.78 KB/s, read: 11.24 iops, write: 17.38 iops volume 'SRV_PIXEL_01_L4' status: optimal, read: 2.86 MB/s, write: 798.45 KB/s, read: 17.59 iops, write: 17.69 iops volume 'SRV_PIXEL_01_L5' status: optimal, read: 2.98 MB/s, write: 575.30 KB/s, read: 16.09 iops, write: 11.35 iops volume 'SRV_PIXEL_01_L6' status: optimal, read: 1.07 MB/s, write: 963.63 KB/s, read: 15.69 iops, write: 19.39 iops volume 'SRV_PIXEL_01_L7' status: optimal, read: 3.09 MB/s, write: 714.40 KB/s, read: 17.55 iops, write: 14.04 iops volume 'SRV_PIXEL_01_L8' status: optimal, read: 2.41 MB/s, write: 194.56 KB/s, read: 10.63 iops, write: 3.14 iops volume 'SRV_PIXEL_02_L1' status: optimal, read: 3.41 MB/s, write: 948.25 KB/s, read: 21.81 iops, write: 19.83 iops volume 'SRV_PIXEL_02_L2' status: optimal, read: 3.25 MB/s, write: 828.43 KB/s, read: 18.63 iops, write: 17.25 iops volume 'SRV_PIXEL_02_L3' status: optimal, read: 1.40 MB/s, write: 644.03 KB/s, read: 7.32 iops, write: 14.92 iops volume 'SRV_PIXEL_02_L4' status: optimal, read: 549.24 KB/s, write: 543.27 KB/s, read: 7.30 iops, write: 14.02 iops volume 'SRV_PIXEL_02_L5' status: optimal, read: 825.80 KB/s, write: 648.72 KB/s, read: 11.71 iops, write: 12.33 iops volume 'SRV_PIXEL_02_L6' status: optimal, read: 1.29 MB/s, write: 737.10 KB/s, read: 18.86 iops, write: 16.94 iops volume 'SRV_PIXEL_02_L7' status: optimal, read: 2.75 MB/s, write: 781.06 KB/s, read: 19.13 iops, write: 17.28 iops volume 'SRV_PIXEL_02_L8' status: optimal, read: 4.23 MB/s, write: 1.36 MB/s, read: 25.96 iops, write: 17.81 iops [root@pixelabs plugins]#
La commande Centreon web : Configuration > commandes > Vérifications
- Nom de commande : Netapp-SANtricity-Volumes
- Type : Vérifications (check)
$USER2$/centreon_plugins.pl --plugin=$_SERVICEPLUGIN$ --mode=$_SERVICEMODE$ --hostname=$HOSTADDRESS$ --api-username=$_SERVICEUSERNAME$ --api-password=$_SERVICEPASSWORD$ --timeout=$_SERVICETIMEOUT$ --warning-volume-status=$_SERVICEWARNING$ --critical-volume-status=$_SERVICECRITICAL$ $_SERVICEEXTRAOPTIONS$
Supervision NetAPP SANtricity (Centreon-Web)
Un exemple pour la supervision depuis Centreon WEB. Supervision des controllers :
- Ajouter l’hôte : NETAPP-SAN
- Création de service
- Description : NetAPP SANtricity Controllers
- Hôte : NETAPP-SAN
- Commande de vérification : NetAPP-SANtricity-Controllers
Comment trouver les seuils Warning & Critical :
- WARNING & CRITICAL :
'%{status} =~ /rpaParErr|degraded/i'
&'%{status} =~ /failed/i'
[root@hd-centreon plugins]# perl centreon_plugins.pl --plugin=storage::netapp::santricity::restapi::plugin --mode=storage-controllers --help [...] Mode: Check storage controllers. [...] --warning-controller-status Set warning threshold for status (Default: '%{status} =~ /rpaParErr|degraded/i'). Can used special variables like: %{status}, %{display} --critical-controller-status Set critical threshold for status (Default: '%{status} =~ /failed/i'). Can used special variables like: %{status}, %{display} [...] [root@hd-centreon plugins]#
- EXTRAOPTIONS :
--ssl-opt="SSL_verify_mode => SSL_VERIFY_NONE"
[root@hd-centreon plugins]# perl centreon_plugins.pl --plugin=storage::netapp::santricity::restapi::plugin --mode=storage-controllers --help [...] [...] Backend lwp Options: --ssl-opt Set SSL Options (--ssl-opt="SSL_version => TLSv1" --ssl-opt="SSL_verify_mode => SSL_VERIFY_NONE"). --ssl Set SSL version (--ssl=TLSv1). [...] [...]
C’est la même chose pour tous les autres services. Vous avez ce qu’il faut dans la page --help
C’est terminé. Amusez-vous bien
Bonne journée et à bientôt.