Plan 9 from Bell Labs’s /usr/web/sources/contrib/gabidiaz/root/sys/man/4/snmpfs

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


.TH SNMPFS 4
.SH NAME
snmpfs \- SNMP v1 & v2c filesystem interface  plan9
.SH SYNOPSIS
.B snmpfs
[
.B -D
] [
.B -a
.I addr
] [
.B -s
.I srvname
] [
.B -m
.I mtpt
] [
.B -n
.I ndb
]
.PP
.SH DESCRIPTION
.PP
.I Snmpfs 
presents a file interface to the
.I SNMP 
version 1 and version 2c protocol.
.PP
.SH USAGE
.PP
.TP
.B -D
 prints debug information (from 9p and snmp).
.TP
.B -a
specify an address to listen.
.TP
.B -s
specify a servicename to post in /srv.
.TP
.B -m
specify a mount point.
.TP
.B -n
specify an alternate ndb file.
.PP
During the mount stage a hostname or the keyword
.I all
can be supplied to show a particular host or all with the parameter 
.I snmp=enabled 
in the ndb file. There is no user authentication.

The filesystem layout its built at startup based on the information provided by ndb, a restart is needed in case of layout changes on ndb. 
.I "rocomm, rwcomm, timeout, retries, timeout, version, nrep"
and
.I maxrep
parameters, can be updated without restart.
.PP
.I Snmpfs
resolves some MIBS translated from unix to a ndb file. The translation match an 
.I OID
name and returns an
.I OID
in digit form.

The operation to be done with the translated oids is not specified, so the user should choose an appropiate one. 

The default operation
.I getnext
will work with the leafs defined (i.e. sysDescr/1.3.6.1.2.1.1.1)  and will give the next leaf if a branch (i.e system/1.3.6.1.2.1.1) is used.
.PP
.SH CONFIGURATION
.PP
.B Snmpfs
uses the system ndb to read the parameters needed:
.PP
.TP
.B oid= 
should be an OID in its numeric form (1.3.6.1.2.1.1.0) or in its name form (sysDescr). The names are resolved using the system ndb(8). A file snmp.ndb is provided with the basic mibs. Whatever name/oids combinations can be added to support special or private oids.
.TP
.B op= 
parameter specifies the operatin that should be done with an oid. The operations supported are 
.I "get, getnext, walk, bulk, set."
Its default value is 
.I getnext.
.TP
.B rocomm= 
specifies the read-only community. 
.I public
is the default value.
.TP
.B rwcomm= 
specifies the read-write community.
.I private
is the defdault value.
.TP
.B version= 
specifies version 1 (default) or 2 to match snmp v1 or snmp v2c.
.TP 
.B retries= 
set the number (1 as default) of times the library will ask a host for the snmp packet specified. 
.TP
.B nrep= 
set the number (5 as default) of replies of a bulk request, this option should go with op=bulk option.
.TP
.B maxrep= 
set the number of... (10 as default)
.TP
.B setval= 
sets a value in a read-write oid. a rwcomm should be supplied. There is no default value, if no value is set, the behaviour is undefined.
.TP
.B timeout= 
sets the time (5 seconds by default) to wait for an answer from the snmp server.
.PP
All those params should be bound with a 
.I sys
entry in the local ndb file.
.PP
.SH EXAMPLES
This example gets the value of sysDescr from the host www.snmp.org using the default values os the snmp parameters:
.PP
.EX
	cpu% snmpfs -s snmpfs
	cpu% mount -c /srv/snmpfs /n/snmp all	
	cpu% mkdir /n/snmp/www.snmp.org
	cpu% touch /n/snmp/www.snmp.org/sysDescr
	cpu% cat /n/snmp/www.snmp.org/sysDescr
	((1.3.6.1.2.1.1.1.0) (Linux release:2.0.36 machine:i686) (noError))
	cpu% 
.EE
.PP
The following is an ndb entry sample:
.PP
.EX
ip=192.147.142.110 sys=www dom=snmp.org
	snmp=enabled
	oid=sysDescr,sysUpTime op=get
	oid=system op=walk
	rocomm=public
	timeout=5
	retries=1
.EE
.PP
.SH FILES
.B /$objtype/bin/aux/snmpfs
.PP
.B /sys/man/4/snmpfs
.PP
.B /lib/ndb/snmp
.PP
.SH SOURCE
.B /n/sources/contrib/gabidiaz
.SH BUGS
Please report bugs to 
.I gabidiaz@gmail.com.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.