YATG::Store::NSCA - Back-end module to send polled data to a Nagios service
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.
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
ifInDiscards is optional, and that you should provide at least one. The
ifAlias is also optional but helps in the status report.
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_community_query: 'SELECT ip, snmp_community FROM hosts' dbi_interfaces_query: 'SELECT name FROM hostinterfaces WHERE ip = ?' nsca: nsca_port: '5667' 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'
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'
For performance you can retrieve community strings from a database instead of trying a list in turn for each device (which is very slow indeed). Pass an SQL statement which returns the IP and community string for each device. If used, this option causes YATG to ignore the
yatg: dbi_community_query: 'SELECT ip, snmp_community FROM hosts'
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
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.
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.
The port where the NSCA daemon is listening, and the
send_nsca command should connect and submit results.
The location of the configuration file for the
send_nsca program. This defaults to
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.
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.
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.
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".
Oliver Gorwits <firstname.lastname@example.org>
This software is copyright (c) 2014 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.