The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

YATG::Store::NSCA - Back-end module to send polled data to a Nagios service

VERSION

version 5.130600

DESCRIPTION

This module checks interface status, errors and discard counts and sends a result to Nagios nsca process for each.

Only one check result per device is submitted (i.e. not one result per port). If there are multiple ports in an alarm state on the same device, then they will all be mentioned in the single service check report.

When all enabled ports are connected, an OK result is returned.

CONFIGURATION

At a minimum, you must provide details of the location of your Nagios NSCA server, in the main configuration file:

 nsca:
     nsca_server: '192.0.2.1'

In your YATG configuration file, you must also include this store module on the OIDs required to generate a check result:

 oids:
     "ifAlias":        [ifindex, nsca]
     "ifOperStatus":   [ifindex, nsca]
     "ifInErrors":     [ifindex, nsca]
     "ifInDiscards":   [ifindex, nsca]

Note that each of the ifOperStatus, ifInErrors and ifInDiscards is optional, and that you should provide at least one. The ifAlias is also optional but helps in the status report.

Optional Configuration

You can also supply the following settings in the main configuration file to override builtin defaults, like so:

 yatg:
     dbi_host_query: 'SELECT ip, host AS name from hosts'
     dbi_interfaces_query: 'SELECT name FROM hostinterfaces WHERE ip = ?'
 nsca:
     send_nsca_cmd: '/usr/bin/send_nsca'
     config_file:   '/etc/send_nsca.cfg'
     ignore_ports:  '^(?:Vlan|Po)\d+$'
     ignore_descr:  '(?:SPAN)'
     ignore_oper_descr:    '(?:TEST)'
     ignore_error_descr:   '(?:NOERR)'
     ignore_discard_descr: '(?:NODIS)'
     service_prefix:  'Interfaces'
dbi_host_query

You can choose to submit results by host name instead of IP. To allow this, you need a configuration entry with an SQL query. The query must return two columns, named ip and name. For example:

 yatg:
     dbi_host_query: 'SELECT ip, host AS name from hosts;'
dbi_interfaces_query

This option allows filtering of submitted results according to a list of Interface names on the device. The SQL in this case needs one "bind var" for the device IP, and must return a single list of names (again, used in DBI::selectcol_arrayref):

 yatg:
     dbi_interfaces_query: 'SELECT name FROM hostinterfaces WHERE ip = ?'

With this option you have an explicit list of interface names. You can also use the ignore_* options (see below) to filter interfaces based on a regular expression.

send_nsca_cmd

The location of the send_nsca command on your system. YATG will default to /usr/bin/send_nsca and if you supply a value it must be a fully qualified path.

config_file

The location of the configuration file for the send_nsca program. This defaults to /etc/send_nsca.cfg.

ignore_ports

Device port names (OID ifDescr) to skip when submitting results. This defaults to anything like a Vlan interface, or Cisco PortChannel. Supply the content of a Perl regular expression, as in the example above.

ignore_descr

Device port description fields matching this value cause the port to be skipped when submitting results. This defaults to anything containing the word "SPAN". Supply the content of a Perl regular expression, as in the example above.

ignore_oper_descr, ignore_error_descr, ignore_discard_descr

This setting has the same effect as ignore_descr but applies only to the port status, port error count, and port discard count checks, respectively. There is no default setting for these options.

service_prefix

Prefix of he Nagios Service Check name to use when submitting results. To this is added the name of the data check such as "Status" or "Errors". This must match the configured name on your Nagios server, and defaults to "Interfaces".

SEE ALSO

Nagios NSCA at http://docs.icinga.org/latest/en/nsca.html

AUTHOR

Oliver Gorwits <oliver@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by University of Oxford.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.