Oliver Gorwits


YATG::Store::Disk - Back-end module to store polled data to disk


version 5.140510


This module implements part of a callback handler used to store SNMP data to disk quickly, although not necessarily compactly. Disk is cheaper than CPU, after all.

Our recommendation is that disk-based storage only be used with Interface Indexed SNMP OIDs. The module will work with other results but retrieval will be a bit messier, and we have not really tested it.

Given a location on your filesystem, each result of the poll of each SNMP OID is written to a file. There is one file per OID per "port" per device. In this context "port" might be a real network interface such as GigabitEthernet5/1 or an index, if say the values are CPU loads and there are a few CPUs.

Input to the module is a data structure with SNMP poll results, like so:

 $results->{ip}->{leaf}->{port} = {value}

And then the value will get written to a file:


Here, $root is set in the configuration (see below). The port name is munged to translate non-alphanumeric characters to a dot (so it's filesystem-safe on common OSes). The $timestamp is set when the file is created (if it's the first storage for this ip/leaf/port combination), and the $interval is read from the yatg_updater configuration as the SNMP polling interval.

With this data encoded in the filename and path, the content of the file is each value on its own line. The timestamp of the first line in the file is that of the filename, and each subsequent line is an $interval in the future from that. The file is padded out when there are missing data values.

Most of this you don't really need to worry about, because you get data back using the YATG::Retrieve::Disk module.


Install the following additional modules to use this plugin:


The only configuration you need to provide is for the file path of the $root for data storage. Set this in the main configuration, the default being /var/lib/yatg:

     disk_root: '/tmp/yatg'

Note that the user under which the yatg_updater process runs must be able to create files and directories and write to them in this location.




Oliver Gorwits <oliver@cpan.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.