YATG - Fast SNMP data poller daemon, with storage and graphing
YATG is a daemon (background process) which at intervals wakes up and polls network devices for SNMP data, and then stores or prints that data. In this distribution are also included examples for presenting simple CGI web pages with graphs.
YATG is flexible, efficient and powerful. It can poll a large number of devices with thousands of ports in just a few seconds. The configuration is very simple, and the defaults sane (it's designed for sysadmins, after all).
You can use YATG both for historical logging,
such as traffic counters on ports,
as well as short-term monitoring which might feed into,
data is translated to human-friendly formats for storage,
such as using Leaf Names instead of OIDs,
translated values (
etc) and device port names rather than SNMP Interface Indexes.
yatg_updater loads its configuration from local files and a database,
performs some basic SNMP connections to build a cache about device capabilities and so on,
and then goes to sleep.
as determined by the configuration,
yatg_updater wakes up and polls all devices,
then stores results,
again according to instructions in the configuration.
If you have only the essential dependencies installed (see below) then you can only output results to STDOUT. With other modules, you have more options such as local or remote disk, or memcached based storage.
yatg_updater will re-load all its configuration if given a HUP signal.
If you run the daemon persistently (for example with
daemontools) then a cron job once a day is a good way to refresh the configuration.
There is reference to this in one of the bundled example files.
This is the main application, designed to be run persistently. It does not accept any input and only produces output when in debugging mode. It is a smart wrapper for the SNMP::Effective module.
These are modules which take the SNMP poll results and store them to either local Disk, a Memcached server, the disk on a remote networked server, or Nagios via NSCA.
These are modules which read stored results back to you, for a given time window. The data can be retrieved from local Disk, a Memcached server, or the disk on a remote networked server.
If using the Disk Store backend for results, eventually you'll want to save space by deleting old data. This script understands the backend file format and, given a duration, removes that amount of historical data from the file.
If storing and/or retrieving on a remote networked server, it should run an instance of RPC::Serialized, and these are the RPC Handlers for that server (see that module's documentation for further details).
For the special case of viewing graphs of disk-based poll results for switch port traffic counters, there is are two CGI scripts. One is a wrapper which presents an HTML page embedded with PNG images created from the other script.
examples/ folder includes a copy of each of the files you should need for a complete deployment of YATG.
Obviously some of them contain dummy data.
To begin with,
you probably want to see how to configure
yatg_updater in YATG::Config.
there are examples of all the files you should need to install,
examples/ folder of this distribution.
Each of the Store and Retrieve modules might have additional Perl module dependencies (i.e. from CPAN) - see the relevant docs for more details.
This module uses "Log::Dispatch::Syslog" for logging, and by default will log timing data to your system's syslog service. More information is provided in the YATG::Config documentation.
To run in debug mode,
where timing data is output to standard out rather than syslog,
set the environment variable
YATG_DEBUG to a true value.
To run the poller just once,
YATG_SINGLE_RUN environment variable to a true value.
This is great for development.
yatg_updater load its configuration,
generate the device hints cache,
sleep and then run just one poll cycle before exiting.
To override the interval between polling runs,
YATG_INTERVAL environment variable to a number of seconds.
YATG_DEBUG=1 YATG_SINGLE_RUN=1 /usr/bin/yatg_updater /etc/yatg.yml
This system uses SNMP::Effective at its core do the polling.
Store polled data on another server using RPC::Serialized.
Oliver Gorwits <email@example.com>
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.