1.\"
2.\" Copyright (c) 2006, Stefan Walter
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\"
9.\"     * Redistributions of source code must retain the above
10.\"       copyright notice, this list of conditions and the
11.\"       following disclaimer.
12.\"     * Redistributions in binary form must reproduce the
13.\"       above copyright notice, this list of conditions and
14.\"       the following disclaimer in the documentation and/or
15.\"       other materials provided with the distribution.
16.\"     * The names of contributors to this software may not be
17.\"       used to endorse or promote products derived from this
18.\"       software without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24.\" COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27.\" OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
30.\" THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
31.\" DAMAGE.
32.\"
33.\"
34.\" CONTRIBUTORS
35.\"  Stefan Walter <stef@memberwebs.com>
36.\"
37.Dd August, 2006
38.Dt rrdbot-get 1
39.Os rrdbot
40.Sh NAME
41.Nm rddbot-get
42.Nd retrieves an SNMP value from an SNMP uri
43.Sh SYNOPSIS
44.Nm
45.Op Fl Mnr
46.Op Fl m Ar mibdir
47.Op Fl s Ar srcaddr
48.Op Fl t Ar timeout
49.Ar snmp://community@host/oid
50.Nm
51.Fl V
52.Sh DESCRIPTION
53.Nm
54retrieves an SNMP value from an SNMP URI. The format is the same as is used by
55.Xr rrdbotd 8 .
56You can use
57.Nm
58for testing SNMP polling while configuring
59.Xr rrdbotd 8 .
60.Sh OPTIONS
61The options are as follows.
62.Bl -tag -width Fl
63.It Fl m Ar mibdir
64The directory in which to look for MIB files. The default directory is
65usually sufficient.
66.It Fl M
67Display MIB parsing warnings.
68.It Fl n
69Display numeric OIDs.
70.It Fl r
71Recursively walk the SNMP values under the given OID.
72.It Fl s Ar srcaddr
73Source address to send SNMP packets from.
74.It Fl t Ar timeout
75The amount of time (in seconds) to wait for an SNMP response. Defaults to
765 seconds.
77.It Fl V
78Prints the version of
79.Nm
80and the locations of the configuration files, RRD files etc.
81.El
82.Sh MULTIPLE AGENTS
83.Nm
84supports failover between multiple agents. If an SNMP query fails on one agent
85or a value is not found when querying an agent, then it will switch to another
86configured agent.
87.Pp
88When combined with a query (see TABLE QUERIES) you can use this feature to
89search for a given value in a table on one of multiple agents.
90.Pp
91To use failover, simply use multiple host names with commas (without a space)
92separating them. For example:
93.Bd -literal -offset indent
94snmp://public@two.example.com,one.example.com/sysUptime.0
95.Ed
96.Sh TABLE QUERIES
97.Nm
98can query a value that corresponds to a certain row in an SNMP table. On
99many SNMP agents the indexes of rows in tables are not fixed, and this
100allows you to retrieve a certain value no matter what row of the table
101it is on.
102.Pp
103Add the OID and value you want to search for in the table to the end
104of the SNMP URL. Only one query value is supported.
105.Pp
106For example to get the outbound packet count on the 'eth0' interface, you would use:
107.Bd -literal -offset indent
108snmp://public@example.com/ifInUcastPkts?ifDescr=eth0
109.Ed
110.Sh SEE ALSO
111.Xr rrdbotd 8 ,
112.Xr rrdbot.conf 5 ,
113.Xr rrdbot-create 8
114.Sh AUTHOR
115.An Stefan Walter Aq stef@memberwebs.com
116