CollectSNMP is an application that
* Runs Simple Network Management Protocol (SNMP) queries, * Creates and updates corresponding Round-Robin Database (RRD) files, * Generates, updates, and indexes DRRAW (http://web.taranis.org/drraw/) graphs, * Supports plugin-like extensions that add custom tasks and SNMP data writers
Install, include, run:
* gem install collectsnmp * require 'collectsnmp'
And/or
* collectsnmp <xml-configuration>
CollectSNMP was written to replace collectd. Unlike collectd, CollectSNMP focuses exclusively on Simple Network Management Protocol (SNMP) data collection and Round Robin Database (RRD) file management. Also, unlike collectd, CollectSNMP is able query vendor-specific SNMP MIBs.
Working in tandem, CollectSNMP and DRRAW provide a comprehensive network monitoring solution similar to MRTG, Criket, and Cacti.
CollectSNMP works with four data structure types: data class, host class, writer object and task object.
An instance of data class is comprised of SNMP OIDs that described the monitored object. Data class has the following class variables: name - reference name, instance - SNMP name information OID, values - SNMP value OIDs delimitated by space, dst - data type (e.g. counter or gauge), and range - data range.
A host class object contains information about the host responding to SNMP queries. Host class variables are: name - reference name, idprefix - numerical ID to be used for DRRAW indexing, _address+ - IP address of the host, version - SNMP protocol version to be used to construct queries, and community - SNMP community query parameter.
Writer base class is a parent class extended to customize record saving processes. CSV and RRD writer classes are both extensions of the base writer class. CSV writer saves SNMP query results into Comma-Separated Values formatted files. RRD writer saves SNMP query results into Round Robin Database formatted files.
Task objects carry out the bulk of CollectSNMP work. Base task class provides common task functionality - exception handling and logging. Hub task class controls the operation of other tasks. DRRAW task updated DRRAW configuration based on collected SNMP data. By querying a set of data objects on a given host object, a poll task collects SNMP records writes collected records using specified writers.
The example program bin/collectsnmp reads an XML configuration and runs background execution of configured SNMP polling tasks. A typical SNMP polling tasks runs an SNMP walk request on a group of OIDs and writes the results into RRD files.
{
<snmp> <datatypes type="array"> <datadef> <name>ifmib-if-octets64</name> <instance>1.3.6.1.2.1.31.1.1.1.1</instance> <values>1.3.6.1.2.1.31.1.1.1.6 1.3.6.1.2.1.31.1.1.1.10</values> <dst>COUNTER</dst> <range>0:U</range> </datadef> <datadef> <hosts type="array"> <hostdef> <name>host1</name> <idprefix>111</idprefix> <address>1.1.1.1</address> <version>2c</version> <community>public</community> </hostdef> </hosts> <writers type="array"> <writerdef> <type>RRD</type> <config> <name>RRD1</name> <rra>RRA:AVERAGE:0.5:1:4608 RRA:AVERAGE:0.5:5:4032</rra> <write_path>/some/log/path</write_path> <interval>150</interval> </config> </writerdef> </writers> <tasks type="array"> <taskdef> <type>Poll</type> <config> <name>collect-host1</name> <log_path>/some/log/path</log_path> <host>host1</host> <data>ifmib-if-octets64</data> <interval>150</interval> <writers>RRD1</writers> </config> </taskdef> <taskdef> <type>Drraw</type> <config> <name>drraw</name> <interval>150</interval> <log_path>/some/log/path</log_path> <drraw_path>/some/drraw/path</drraw_path> <rrd_path>/some/rrd/path</rrd_path> <erb_path>/some/erb/path</erb_path> </config> </taskdef> </tasks> </snmp>
}
CollectSNMP is Copyright © 2010,2011 by Artem Veremey.
CollectSNMP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License v2. CollectSNMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
- Author
-
Artem Veremey ([email protected])