title: State of network interfaces
agents: netapp
catalog: hw/storagehw/netapp
license: GPL
distribution: check_mk
description:
 This check monitors the operational status, link speed, traffic, packet
 counts, discards and errors of network interfaces of a NetApp Filer.

 Right now only the ethernet and virtual interfaces are checked.

 For virtual interfaces the check raises a WARN if not all members of
 this virtual interface have the same speed set.

 Depending on the check parameters this check can go WARN or CRIT when the
 port status changes (i.e. is down), when the link speed changes (e.g. a
 port expected to be set to 1GBit/s operates only at 100MBit/s), when the
 absolute or procentual traffic of a port exceeds certain levels or if the
 rate of errors or discards exceeds configurable limits.

 This check supports averaging the in- and outgoing traffic over a
 configurable range of time by using an exponentially weighted moving average.
 The averaging can be configured on a per host and per port base. This is
 done by adding a key {"average"} to the parameter dictionary with the number
 of minutes that the average should cover as its key. Port with averaging
 turned on output two additional performance values: the averaged traffic
 in bytes. If you have configured traffic levels, then those levels are
 applied to the averaged values.

 It might be a good idea to use the option "Use description as service name
 for network interface checks", since there is no real interface index available
 and can change over time.

item:
 There are three allowed ways to specify a port: {1}: the index of the interface
 (depends on the order of the data reported by the agent), the {ifDescr} of
 the port or the {ifAlias} of the port. If you are using the alias, you have to
 make sure that it is unique by configuring useful aliases in the switch.
 Check_MK does not check for uniqueness.

inventory:
 The inventory creates one service for each port that fulfills configurable conditions.

 {Grouping:} In some situations you do not want to monitor a single
 interface but a group of interfaces that together form a pool.
 The {if} check supports such pools by defining groups.
 You can specifiy the members of a group by their port type and the item name(s) of
 the single interfaces. The data of all members is accumulated and put together
 in a single grouped interface service.

 You can specify the groups with the ruleset {if_groups}.
 Groups are defined as list of dictionaries.

 The keys are:

  {"name"}:   String. Name of the group within the service description

  {"iftype"}: Integer. Interface port type as integer

  {"include_items"}: List of Strings. Interface item name. This name depends
  on further settings like if_inventory_uses_alias or if_inventory_uses_description

  {"single"}(optional): Bool. Interfaces in this group do not show up
  as single service if "single" is set to True (Default: False)

  For example: if_groups = ([{"name" : "Group vFiler0", "iftype" : 6, "single" : True}], ["lan"], ALL_HOSTS )

examples:
 Definition for grouped interfaces
 if_groups = [
   ( [{"name" : "VLAN", "iftype" : 53, "single" : True },
   ( [{ "name" : "Group vFiler0", "iftype" : 6, "single" : True }], [ "lan" ], ALL_HOSTS )
 ]

perfdata:
 {in}: The number of bytes received per second.
 {inucast}: The number of unicast packets received per second.
 {innucast}: The number of broadcast and multicast packets per second.
 {indisc}: The number of discarded received packets per second.
 {inerr}: The number of input errors per second.
 {out}: The number of bytes sent per second.
 {outucast}: The number of unicast packets sent per second.
 {outnucast}: The number of broadcast and multicast packets sent per second.
 {outdisc}: The number of output packets discarded per second.
 {outerr}: The number of output errors per second.
 {outqlen}: The current length of the output queue.
 {in_avg_?}: optional: The averaged number of received bytes over a longer range of time
 {out_avg_?}: optional: The averaged number of sent bytes

[parameters]
parameters (dict): The dictionary can have the following keys:

                   {"errors"} - a pair of two float values to be used as WARN/CRIT
                   percentages for errors + discards. The default is {(0.01, 0.1)} - which
                   means that the services gets WARN if the error rate is at least
                   0.01 percent. That means that one error per 10,000 packages is seen.

                   {"traffic"} - a pair of two float values to be used as WARN/CRIT
                   levels for the bandwidth usage of the port. Integer numbers are interpreted
                   as bytes per seconds. So a value of {(500,1000)} will trigger WARN/CRIT
                   if either the ingoing or outgoing traffic exceeds 500/1000 bytes per second.
                   If you use floating point number, those are interpreted as percentages
                   of the available bandwidth as signalled by the port. A value of {(50.0, 80.0)}
                   will trigger WARN/CRIT, if at least 50%/80% of the nominal bandwidth is
                   used. The default is to impose no levels on the traffic.

                   {"average"} - if you set this key to a number, then it is interpreted as
                   a time in minutes. The check will then compute the averaged used traffic
                   over approximately that range of time. Note: The algorithm used here is
                   the same as Linux uses for the CPU load. This means that more recent values
                   are weighted higher than older values and that even values out of the configured
                   time range are - to a low degree - represented in the average. If you configure
                   an average, then the traffic levels are applied to the averaged values.

                   {"state"} - the expected operational status of the interface (as string or list of strings. If this
                   is {None} then the state is not checked. Possible values for the
                   state are {"1"}(up), {"2"}(down), {"3"}(testing), {"4"}(unknown),
                   {"5"}(dormant), {"6"}(notPresent) and {"7"}(lowerLayerDown). The default is to
                   remember the state found during inventory and enforce this. It is allowed to
                   set {"state"} either to a string (one single allowed state) or a list of
                   strings. For example set this to '{["1", "5"]}' if you want to allow {up}
                   and {dormant}.

                   {"speed"} - the expected port speed as an integer of the bits per second (not
                   the bytes!). If you set this to {None}, then the port speed is not checked.
                   The default is to remember and enforce the port speed found during inventory.

                   {"assumed_speed_in"} - the assumed port input speed as an integer of the bits per second (not
                   the bytes!). If this value is not set the check takes the value configured in {speed}
                   before using the automatically detected port speed

                   {"assumed_speed_out"} - the assumed port output speed as an integer of the bits per second (not
                   the bytes!). If this value is not set the check takes the value configured in {speed}
                   before using the automatically detected port speed

[configuration]
if_inventory_porttypes (list of strings): List of interface types the inventory should create checks for.
  Default is {[ '6', '32', '117' ]}, which means that all Ethernet, Frame Relay and Gigabit Ethernet ports
  will be monitored. Virtual and loopback ports will be ignored. Please look into the check implementation
  of in the SNMP MIB description of {ifType} for a complete list of port types. Another good source for possible
  port types and their meanings might be http://www.iana.org/assignments/ianaiftype-mib/ianaiftype-mib.
  In the current version all interfaces are considerd as type 6 (ethernet).

if_inventory_portstates (list of strings): Per default this variable is set to {['1']}, which means that
  only ports found in the state {up} are being added to the monitoring. If you set this to {['1', '2', '4']} then
  also ports in state {down} and {unknown} will be monitored.

if_inventory_pad_portnumbers (boolean): If this is set to {True} (the default), then port numbers used as
  items are padded with zeroes so that all items have the same length and ports will sort correctly in
  the GUI. You can set this to {False} if you want to keep the same service descriptions as in versions
  prior to 1.1.13i3.

if_inventory_uses_description (boolean): Whether inventory should use the interface name as item (instead
  of the interface index). Default is {False}.

if_inventory_uses_alias (boolean): Whether inventory should use the interface alias as item.

if_inventory_monitor_speed (boolean): Whether inventory should code the current speed setting of the port
    into the check parameters and thus enforces a static speed setting on this port. Default is {False},
    which will code {None} as target speed.

if_inventory_monitor_state (boolean): Whether inventory should code the current port status into the
    check parameters and thus enforces the status of the port not to be changed in future. Default is {True} -
    so the port states will be monitored. Setting this to {False} will disable status checking of all
    newly inventorized ports.

if_default_error_levels (float, float): Default levels for errors. The default is {(0.01, 0.1)}, setting
    the levels to 0.01 and 0.1 percent of total packages.

if_default_traffic_levels (float/int, float/int): Default levels for checking traffic (used bandwitdh). The
    default is {(None, None)}, which means the the traffic is not being checked - just monitored.

if_default_average (int): Default time range for averaging in minutes. This is preset to {None}, which disables
    averaging of port traffic.

