collectsnmp icon indicating copy to clipboard operation
collectsnmp copied to clipboard

CollectSNMP runs SNMP queries and stores results

== Overview 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

== Usage Install, include, run:

  • gem install collectsnmp

  • require 'collectsnmp' And/or

  • collectsnmp

== Description CollectSNMP was written to replace collectd[http://collectd.org/]. Unlike collectd, CollectSNMP focuses exclusively on Simple Network Management Protocol (SNMP[http://en.wikipedia.org/wiki/SNMP]) data collection and Round Robin Database (RRD[http://en.wikipedia.org/wiki/RRDtool]) file management. Also, {unlike collectd}[http://www.mail-archive.com/collectd%40verplant.org/msg00500.html], CollectSNMP is able query vendor-specific SNMP MIBs[http://en.wikipedia.org/wiki/Management_information_base].

Working in tandem, CollectSNMP and DRRAW[http://web.taranis.org/drraw/] provide a comprehensive network monitoring solution similar to MRTG[http://en.wikipedia.org/wiki/MRTG], Criket[http://cricket.sourceforge.net/], and Cacti[http://en.wikipedia.org/wiki/Cacti_%28software%29].

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}[http://en.wikipedia.org/wiki/Object_identifier] 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}[http://en.wikipedia.org/wiki/Comma-separated_values] formatted files. RRD writer saves SNMP query results into {Round Robin Database}[http://en.wikipedia.org/wiki/RRDtool] 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.

== Example

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.

== Example XML configuration file

{ ifmib-if-octets64 1.3.6.1.2.1.31.1.1.1.1 1.3.6.1.2.1.31.1.1.1.6 1.3.6.1.2.1.31.1.1.1.10 COUNTER 0:U host1 111

1.1.1.1
2c public RRD RRD1 RRA:AVERAGE:0.5:1:4608 RRA:AVERAGE:0.5:5:4032 <write_path>/some/log/path</write_path> 150 Poll collect-host1 <log_path>/some/log/path</log_path> host1 ifmib-if-octets64 150 RRD1 Drraw drraw 150 <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> }

== Copying CollectSNMP is Copyright (c) 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.

== Contact Author:: Artem Veremey ([email protected])