Installation

Installation Steps

  1. Prerequisites: Make sure the following are in place before you start:

    • A valid contract number for Check NetApp-REST
    • gpg (GnuPG) installed on the target system (optional, required for signature verification)
  2. Download the archive and its detached signature from releases.monitoring-plugins.pro. Your contract number is required to log in.

    Download both files for your target version:

    check-netapp-rest-<version>.tar.gz
    check-netapp-rest-<version>.tar.gz.asc
    
  3. (Optional) Verify the signature of the downloaded archive before installing. Full details and the public key fingerprint are in Release Archive Verification.

    Quick reference:

    curl -O https://docs.monitoring-plugins.pro/release-signing-key.asc
    gpg --import release-signing-key.asc
    gpg --verify check-netapp-rest-<version>.tar.gz.asc check-netapp-rest-<version>.tar.gz
    
  4. Create the directory /usr/local/monitoring-plugins.pro/netapp-rest/etc (if it does not already exist) and untar the downloaded archive to its parent.

    mkdir -p /usr/local/monitoring-plugins.pro/netapp-rest/etc
    tar -xzf check-netapp-rest-<version>.tar.gz --directory /usr/local/monitoring-plugins.pro/netapp-rest/
    
    Explanation of the commands ...
  5. Copy the license file to its default directory

    cp <your-CNR>_check_netapp_pro.dat /usr/local/monitoring-plugins.pro/netapp-rest/etc
    

    The example-configuration directory contains a license.cfg that will monitor the above directory for expiring licenses. More information about the license file and how to check for expiration can be found in the chapter License File.

  6. Create a storedir

    mkdir -p /usr/local/monitoring-plugins.pro/netapp-rest/var/store
    

    The above typescript creates the storedir at its default location. If you prefer it somewhere else you can either symlink the default-storedir to an other place or use the --storedir parameter.

    For customers who also use the Perl checks (Check NetApp-ZAPI): The checks from Check NetApp-REST have no explicit getter anymore but still use an auto-getter function to cache results locally. Therefore we still need a storedir.

  7. Change the owner of the files to the monitoring-daemons user. (In the example below, change the username from nagios to e.g. icinga or whatever your daemon runs with.)

    cd /usr/local/monitoring-plugins.pro
    chown -R nagios netapp-rest/
    
  8. Copy and adapt the example configuration for Nagios, Icinga 1 or Naemon. At least the hosts.cfg will need your attention. For Icinga2 skip this step and the next one: set up the configuration as described in Icinga2 below, then come back and continue with the step »Create a monitoring role and user«.

    cd /usr/local/monitoring-plugins.pro/netapp-rest/etc/
    cp ../etc.example/*.cfg ../etc.example/netapp_credentials .
    vi hosts.cfg
    ...
    
  9. Let the monitoring system know about the location of the configuration files. Add the following line to its main configuration file (nagios.cfg for Nagios, icinga.cfg for Icinga 1, /etc/naemon/naemon.cfg for Naemon):

    cfg_dir=/usr/local/monitoring-plugins.pro/netapp-rest/etc
    

    With Naemon, verify the configuration as the user of the daemon (Naemon refuses to run as root, see Naemon: Verifying Your Configuration):

    sudo -u naemon naemon -v /etc/naemon/naemon.cfg
    
  10. Create a monitoring role and user on your NetApp-system as described in Filer Configuration. Write the credentials of this user into the default authfile (/usr/local/monitoring-plugins.pro/netapp-rest/etc/netapp_credentials). The minimum authfile is:

    [default]
    user = monitoring_user_name
    pass = monitoring_user_password
    

    The keys are user and pass. The keys username and password (known from Check NetApp-ZAPI) are not read.

  11. Test one check on the command line before you reload the monitoring system. Run it as the user of the monitoring daemon (here nagios), so that missing permissions on the storedir or the license show up now:

    sudo -u nagios /usr/local/monitoring-plugins.pro/netapp-rest/bin/check_netapp_health --host=<cluster-mgmt-lif>
    echo $?
    

    A working installation returns something like:

    NETAPP HEALTH OK - 7 (sub)systems checked
    system.health: ok
    subsystem.switch_health: ok
    subsystem.cifs_ndo: ok
    subsystem.metrocluster: ok
    subsystem.metrocluster_node: ok
    subsystem.fhm_switch: ok
    subsystem.fhm_bridge: ok
    0
    

    The number and names of the subsystems depend on your system. CRITICAL or WARNING (exit code 2 or 1) means the installation works and the check found a problem on the NetApp. Exit code 3 (UNKNOWN) with one of the messages listed under Troubleshooting means the installation needs attention.

    Do not test as root or as your own user against the productive storedir. The check creates a directory per host in the storedir and lock files in it, readable only by their owner. The monitoring daemon cannot open them afterwards, and its checks for this host turn UNKNOWN (see Storedir not writable). For tests as another user, use a separate storedir, e.g. --storedir=/tmp/netapp-test.

  12. Reload the configuration of the monitoring system (Icinga2: systemctl reload icinga2). You should see the first results after the next check interval.

Icinga2

The archive contains the file icinga2/check_netapp_rest.conf. It defines a CheckCommand for every check, so you do not have to write them yourself.

The CheckCommands expect the plugins in /usr/local/monitoring-plugins.pro/netapp-rest/bin. For another directory define the constant NetappRestPluginDir in /etc/icinga2/constants.conf, e.g. const NetappRestPluginDir = "/opt/netapp-plugins".

If you used the Icinga2 configuration file of 4.0.0-beta.3 or beta.4: the names of the custom variables have changed. Adjust your services as described below; the old names are not evaluated anymore.

  1. Link this file into the directory /etc/icinga2/conf.d, which Icinga2 includes by default (see Icinga2: The conf.d Directory). Do not copy or edit the file: every release replaces it, and thanks to the link an update of the plugins also updates the CheckCommands. Your own definitions go into a separate file (next step).

    ln -s /usr/local/monitoring-plugins.pro/netapp-rest/icinga2/check_netapp_rest.conf /etc/icinga2/conf.d/check_netapp_rest.conf
    
  2. Define the NetApp system as a host and add services, e.g. in /etc/icinga2/conf.d/netapp.conf. The CheckCommands are named after the plugin and its subcommands, e.g. check_netapp_health or check_netapp_volume_usage for check_netapp_volume usage. --host gets the address of the host. Every other option --some-flag is set with the custom variable netapp_some_flag:

    object Host "filer01" {
      import "generic-host"
      address = "192.0.2.10"
    }
    
    object Service "netapp-health" {
      import "generic-service"
      host_name = "filer01"
      check_command = "check_netapp_health"
    }
    
    object Service "netapp-volume-usage" {
      import "generic-service"
      host_name = "filer01"
      check_command = "check_netapp_volume_usage"
      vars.netapp_warning = "80%"
      vars.netapp_critical = "90%"
      vars.netapp_exclude = [ "~^vol0$$" ]
    }
    
    • Options which can be repeated, like --include and --exclude, take a list: [ "vol1", "~^data" ].
    • Switches are set with true, e.g. vars.netapp_no_ssl = true.
    • vars.netapp_host on the host or service replaces the address as value of --host.

    Write a $ in a value as $$, e.g. at the end of a regular expression: "~^vol0$$". Otherwise Icinga2 takes it as the start of a macro and the validation fails with Closing $ not found in macro format string. The plugin receives a single $.

  3. Validate the configuration (see Icinga2: Configuration Validation):

    icinga2 daemon -C
    
  4. Go back to the Installation Steps and continue with the step »Create a monitoring role and user«.

Troubleshooting

The checks report setup problems with exit code 3 (UNKNOWN) and a single line of text. The messages below are taken from the checks; <…> stands for your values.

Timeout

plugin timed out (timeout: <n>s)

The NetApp system did not answer within --timeout (default 10 seconds). Check that --host is the cluster management LIF and that a firewall allows HTTPS (port 443) from the monitoring server to it.

Host name not resolvable

could not send request with http client: Get "https://<host>/api/…": dial tcp: lookup <host>: no such host

The host name given with --host cannot be resolved. Use the IP address or fix the DNS entry.

Authfile missing

could not load auth file: open <authfile>: no such file or directory

The authfile does not exist. Create it (see the step above) or name it with --authfile.

No user in the authfile

could not find user for entry '<entry>' in file '<authfile>'

The authfile has no user key in the section for this host or in [default]. Most often the file still uses username/password; rename them to user/pass.

License file missing

No license-file (*.dat) found in '<license-dir>'. Please copy the license-file into the directory specified by --license-dir.

Copy the license file into /usr/local/monitoring-plugins.pro/netapp-rest/etc or name its directory with --license-dir.

Storedir not writable

failed to acquire API lock: mkdir <storedir>/<host>: permission denied
failed to acquire API lock: open <storedir>/<host>/<object>.lock: permission denied

The user of the monitoring daemon cannot write to the storedir. Change the owner as described in the installation steps above.

The second message usually appears after a check ran on the command line as another user (e.g. root): the directory <storedir>/<host> and its lock files now belong to that user. Give them back to the user of the monitoring daemon; there is no need to delete them:

chown -R nagios /usr/local/monitoring-plugins.pro/netapp-rest/var/store

The lock files (<object>.lock, since 3.3.1) prevent checks running at the same time from querying the filer twice or writing a store file simultaneously. They are the same for the single binary and the individual binaries.

Additional Notes

Single Binary

Users who want to save disk space can use the single-binary check_netapp and delete all other binaries (check_netapp_*) from the tarball. Checks are then called as subcommands. E.g. instead of check_netapp_volume type check_netapp volume. All following subcommands, parameters and options are identical.

check_netapp --help lists only the subcommands. The options of a check, e.g. --storedir, are shown by the help of the check itself: check_netapp volume usage --help (or check_netapp health --help). Both variants use the same storedir and can run side by side.

Compatibility with ZAPI Checks

The syntax of Check NetApp-REST is quite similar to the former get_netapp_cm.pl/check_netapp_pro.pl (now part of Check NetApp-ZAPI) with these exceptions:

  • --authfile|-f expects the new ini-format. The older text-format is not supported any more. The minimum authfile is now:

    [default]
    user = monitoring_user_name
    pass = monitoring_user_password
    
  • --port has been removed.

  • All underscores in the parameters have been replaced by dashes (e.g. --max_age is now written --max-age).

Using the authfile from the ZAPI Checks

Of course you can use the eventually already existing authfile from Check NetApp-ZAPI for Check NetApp-REST as well (if it is in the ini-format). Just symlink it into the above mentioned default-location or explicitly name it with the --authfile parameter. You can then administrate all NetApp hosts in one file for both of our monitoring products.

For customers migrating from Check NetApp-ZAPI: If you have used the option-alias username instead of user in the authfile, please change it to user now. This option can be read by both products. The same goes for password, which should be changed to pass.