Donnerstag, 28. August 2014

Nagios: NetApp Plugin check_netapp_sdk.pl

Written in Perl, using NetApp Manageability SDK


Functions
  • check-volume
  • check-lun
  • check-snapmirror
  • check-aggr
  • check-cluster
  • check-shelf
  • check-license

Dependencies:
- NetApp 7-Mode
- Nagios::Plugins (Perl)
- NetApp Manageability SDK (Perl)
- At line 24 adjust your lib path:
use lib "/usr/lib/perl5/site_perl/5.8.8/NetApp";
- Warning/Critical defaults to 85/95%


check-volume [-n VOLUME_NAME] - List volumes use -n to specify volume
-> size in percent (-w/-c)
check-lun [-n LUN_NAME] - List LUNs, use -n to specify lun
-> size in percent (-w/-c)
-> misalignment results to warning
-> offline state and is mapped results to critical
check-snapmirror [-n SNAPMIRROR_NAME] - List snapmirrors, use -n to specify snapmirror
-> lag_time in seconds (-w/-c)
-> transfer error -> CRITICAL
check-aggr [-n AGGREGATE_NAME] - List aggregates, use -n to specify lun
-> size in percent (-w/-c)
-> mount state: warning on creating, mounting, unmounting, quiescing; ok on online consistent quiesced; critical for the rest!
-> mirror state: warning on 'CP count check in progress'; ok on mirrored, unmirrored; critical for the rest!
-> raid state: warning on resyncing, copying, growing, reconstruct; ok on normal, mirrored; critical for the rest
-> inconsistency results on critical
check-cluster - checks for cluster state
-> warning/critical on other state than connected
-> warning on inactive hwassist (if available)
-> interconnect state
check-shelf
-> critical on failed power-supply
-> critical on failed voltage sensor
-> critical on failed temp sensor
-> temperature (values provided by netapp, is needed due to different sensor locations)
-> shelf state : warning on informational, non_critical; ok on normal; critical for the rest!
check-license - checks license
-> expiry date (excludes demo, auto_enabled and non expiry lics)

Sample Output:


$ check_netapp_sdk.pl -H snapmirror1 -U $USER1$ -P $USER2$ -S -C check-snapmirror -w 43200 -c 86400
CRITICAL - 1 failed snapmirror found: C->netapp1->snapmirror1: nfs_ds2_snapmirror: Lag-time: 10.2 days Error: - | netapp1_snapmirror1_nfs_ds2_snapmirror_xfer_size=36609B;; netapp1_snapmirror1_nfs_ds2_snapmirror_lag_time=885023s;43200;86400

$ check_netapp_sdk.pl -H netapp1 -U $USER1$ -P $USER2$ -S -C check-cluster
OK - Cluster is fine! Partner netapp2 is connected

$ check_netapp_sdk.pl -H netapp1 -U $USER1$ -P $USER2$ -S -C check-lun -n /vol/lun_1_vol/lun_1
WARNING - 1 suspicious luns found: W->lun_1: 85.66% | lun_1_size_used=44911216B;44564480;47185920;;52428800 lun_1_size_pct=85.66%;85;9

$ check_netapp_sdk.pl -H netapp1 -U $USER1$ -P $USER2$ -S -C check-volume -n lun_1_vol
WARNING - 1 suspicious volumes found: W->lun_1_vol: 88.56% | lun_1_vol_size_used=52653680B;50537015;53509781;;59455312 lun_1_vol_size_pct=88.56%;85;9

$ check_netapp_sdk.pl -H netapp1 -U $USER1$ -P $USER2$ -S -C check-aggr
OK - 0 suspicious aggregate found | aggr_unmirrored_size_used=3161408134.68B;3274284218;3466889172;;3852099080 aggr_unmirrored_size_pct=82.07%;85;90 aggr0_size_used=10676546580.44B;11114697879;11768503637;;13076115152 aggr0_size_pct=81.65%;85;90

$ check_netapp_sdk.pl -H netapp1 -U $USER1$ -P $USER2$ -S -C check-license
OK - 0/48 expired licenses found

$ check_netapp_sdk.pl -H netapp1 -U $USER1$ -P $USER2$ -S -C check-version
OK - System-Name: netapp1 System-ID: 123456789 Model: FAS3240 Serial: 123456789 Version: NetApp Release 8.1.2P4 7-Mode: Fri Apr 26 19:57:25 PDT 2013
 
 
 

4 Kommentare:

  1. check-snapmirror gives me the following errror

    Can't call method "children_get" on an undefined value at ./check_netapp_sdk.pl line 763.






    AntwortenLöschen
  2. I get the following error when I run the script using "check-snapmirror"

    Can't call method "children_get" on an undefined value at ./check_netapp_sdk.pl line 763


    Also in the output. "CHECK_NETAPP_SDK.PL" is displayed before the actual output.

    root@op5:/opt/plugins/custom# ./check_netapp_sdk.pl -H 10.0.1.8 -U mon -P xxxxx
    CHECK_NETAPP_SDK.PL OK - System-Name: n-ba-f1 System-ID:.......


    AntwortenLöschen
    Antworten
    1. That output comes from Nagios::Plugins, its easy to fix:

      in line: 42 remove
      shortname => uc($PROGNAME),

      In http://cpansearch.perl.org/src/TONVOON/Nagios-Plugin-0.36/lib/Nagios/Plugin/Functions.pm at line 124 you'll see the actual code where our shortname is used.

      Löschen