5.0 KiB
Description
check_netapp is a command line tool to request information about the health of your NetApp e.g. for icinga.
This tool offers ability to check the used space of volumes, failed disk, gathering the product version and firmware version.
Usage
./check_netapp (version|fw|fansfailed|elecfailed|diskfailed)
Examples
Available disk space
List all available volumes (same if you walk over OID: .1.3.6.1.4.1.789.1.5.4.1.2.):
./check_netapp df -H netapp.example.com -C public -l
returns the following
SNMPv2-SMI::enterprises.789.1.5.4.1.2.1046 = STRING: "/vol/datastore01"
SNMPv2-SMI::enterprises.789.1.5.4.1.2.1047 = STRING: "/vol/datastore02"
SNMPv2-SMI::enterprises.789.1.5.4.1.2.1048 = STRING: "/vol/datastore03"
Check the used disk space of volume 1047 (/vol/datastore02)
./check_netapp df -H netapp.example.com -C public -i 1047
the following text is returned:
Space of volume /vol/datastore02 has usage of 26.54%. Space total: 18.0 TB - Space available: 13.3 TB - Space used: 4.8 TB
You can use the name of the volume. It needs to walks over all volumes.
./check_netapp df -H netapp.example.com -C public -p /vol/datastore02.
You can set simple thresholds, -c for critcal (exit code 1) and -w for warnings (exit code 2)
./check_netapp df -H netapp.example.com -C public -i 1047 -c 90 -w 80
would be exited with code 1, if usage is above 90% and if usage is between 80-90% it returns with exit code 2.
Fan failures
Check for failures of the fans
./check_netapp fansfailed -H netapp.example.com -C public
Disk failures
Check for failures of the disks
./check_netapp diskfailed -H netapp.example.com -C public
Electronic failures
Check for failures of the electronic
./check_netapp elecfailed -H netapp.example.com -C public
Firmware information
Returns the current firmware information
./check_netapp fw -C public
Example usage with icinga
Command configuration
object CheckCommand "check-netapp-electronic" {
command = [ PluginDir + "/check_netapp" ]
arguments = {
"elecfailed" = {
order = -1
required = true
}
"-H" = "$address$"
}
}
object CheckCommand "check-netapp-version" {
command = [ PluginDir + "/check_netapp" ]
arguments = {
"version" = {
order = -1
required = true
}
"-H" = "$address$"
}
}
object CheckCommand "check-netapp-firmware" {
command = [ PluginDir + "/check_netapp" ]
arguments = {
"fw" = {
order = -1
required = true
}
"-H" = "$address$"
}
}
object CheckCommand "check-netapp-diskfailed" {
command = [ PluginDir + "/check_netapp" ]
arguments = {
"diskfailed" = {
order = -1
required = true
}
"-H" = "$address$"
"-c" = "1"
}
}
Host configuration
It uses the group "netapp" to apply checks on host.
object Host "netapp" {
import "generic-host"
address = "xxx.xxx.xxx.xxx"
display_name = "NetApp
groups += ["netapp"]
vars.volumes["datastore02"] = {
id = 1047
critical = 99
warning = 97
}
}
Service configuration
apply Service "check-netapp-df-" for (identifier => volume in host.vars.volumes) {
import "generic-service"
check_command ="check-netapp-df"
vars.volumeID = volume.id
vars.critical = volume.critical
vars.warning = volume.warning
display_name = identifier
assign where "netapp" in host.groups
}
apply Service "check-netapp-version" {
import "generic-service"
check_command = "check-netapp-version"
vars.host.name = host.name
vars.host.address = host.address
assign where "netapp" in host.groups
}
apply Service "check-netapp-firmware" {
import "generic-service"
check_command = "check-netapp-firmware"
vars.host.name = host.name
vars.host.address = host.address
assign where "netapp" in host.groups
}
apply Service "check-netapp-fans" {
import "generic-service"
check_command = "check-netapp-fans"
vars.host.name = host.name
assign where "netapp" in host.groups
}
apply Service "check-netapp-electronic" {
import "generic-service"
check_command = "check-netapp-electronic"
vars.host.name = host.name
vars.host.address = host.address
assign where "netapp" in host.groups
}
apply Service "check-netapp-diskfailed" {
import "generic-service"
check_command = "check-netapp-diskfailed"
vars.host.name = host.name
assign where "netapp" in host.groups
}
Info
- SNMP library from soniah is not maintained since 8th July 2020. https://github.com/soniah/gosnmp