Skip to content
Philippe DENIEL edited this page Oct 30, 2012 · 2 revisions

Table of Contents

Exporting a SNMP tree with GANESHA

Overview

Thanks to its backend modules called ``File System Abstraction Layers (FSAL), GANESHA NFS server makes it possible to export any sets of data organized as trees, where each entry has a name and path.

In SNMP (Simple Network Management Protocol), data are organized as a tree where all objects are addressed by their OID, which is the object's path in this tree. For example, <tt>.iso'' can be considered has a directory identified by the OID .1'', and the leaf .iso.org.dod.internet.mgmt.mib-2.system.sysDescr.0'' (which corresponds to system description) can be considered as a file whose data is something like Linux node_name 2.6.9-22.ELsmp #1 SMP Mon Sep 19 18:32:14 EDT 2005 i686.

As a result, exporting such a tree through NFS makes it possible to have a filesystem similar to ``/proc, where administrators can read statistics about a system or an equipment (switch, router, ...) simply using cat command, and modify them easily, using vi or echo "xxx" > file.

This is what you can do using the SNMP FSAL. To use it, simply build GANESHA using the configure arg -with-fsal=SNMP:

  cd src
  ./configure --with-fsal=SNMP
  make

Net-snmp library and includes must be installed on your system.

SNMP relative options

The SNMP block

==== Parameters description ==== For configurating GANESHA's SNMP access, you have to set some options in the configuration file: this in done in a ``SNMP configuration block.

In such a block, you can set the following values:

      • snmp_version: this indicates the SNMP protocol version that GANESHA will use for communicating with SNMP agent. Expected values are 1, 2c or 3. Default is "2c".
      • snmp_server: this is the address of the SNMP master agent. A port number can also be specified by adding ``:<port> after the address. Default is "localhost:161".
      • nb_retries: number of retries for SNMP requests. Default value is
SNMP_DEFAULT_RETRIES, defined in net-snmp library.
      • microsec_timeout: number of microseconds until first timeout, then an exponential backoff algorithm is used for next timeouts. Default value is SNMP_DEFAULT_TIMEOUT, defined in net-snmp library.
      • client_name: this is the client name that could be used internally by net-snmp for its traces. Default value is "GANESHA".
      • snmp_getbulk_count: this indicates the number of responses wanted for each SNMP GETBULK request. Default value is 64.
SNMP v1 and v2 specific parameters:
      • community: this is the SNMP community used for authentication. Default is "public".
SNMP v3 specific parameters:
      • auth_proto: the authentication protocol (MD5 or SHA). Default is "MD5".
      • enc_proto: the privacy protocol (DES or AES). Default is "DES".
      • username: the security name (or user name). This a private information: check rights on this config file!
      • auth_phrase: authentifaction passphrase (>=8 char). This a private information: check rights on this config file!
      • enc_phrase: authentifaction passphrase (>=8 char). This a private information: check rights on this config file!

A simple SNMP v2c example

<pre>SNMP &#123; snmp_version &#61; 2c&#59; snmp_server &#61; &quot;snmp_master.my_net&quot;&#59; community &#61; &quot;public&quot;&#59; &#125; </pre>

A simple SNMP v3 example

<pre>SNMP &#123; snmp_version &#61; 3&#59; snmp_server &#61; &quot;snmp_master.my_net&quot;&#59; username &#61; &quot;snmpadm&quot;&#59; auth_phrase &#61; &quot;p4ssw0rd&#33;&quot;&#59; enc_phrase &#61; &quot;p455w0rd?&quot;&#59; &#125; </pre>

Export entries

For defining the path of an export entry, you must replace traditional SNMP dot separators <tt>.&#39; by slashes </tt&lt;/'.&gt;For example, you should set export path to <tt>/iso/org&#39; instead of </tt>.iso.org'. Note that you can give slash separated numerical OIDs for exports. Thus, exporting <tt>/1/3/6/1/2/1&#39; is equivalent to </tt&lt;/iso/org/dod/internet/mgmt/mib-2'.&gt;</port>