summaryrefslogtreecommitdiff
path: root/doc/rrdbot.conf.5
blob: f4fceec656ae32d6ac45e70b9ba56c0e92f54641 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
.\" 
.\" Copyright (c) 2006, Stefan Walter
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without 
.\" modification, are permitted provided that the following conditions 
.\" are met:
.\" 
.\"     * Redistributions of source code must retain the above 
.\"       copyright notice, this list of conditions and the 
.\"       following disclaimer.
.\"     * Redistributions in binary form must reproduce the 
.\"       above copyright notice, this list of conditions and 
.\"       the following disclaimer in the documentation and/or 
.\"       other materials provided with the distribution.
.\"     * The names of contributors to this software may not be 
.\"       used to endorse or promote products derived from this 
.\"       software without specific prior written permission.
.\" 
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
.\" COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
.\" OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 
.\" THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 
.\" DAMAGE.
.\" 
.\"
.\" CONTRIBUTORS
.\"  Stef Walter <stef@memberwebs.com>
.\"
.Dd August, 2006
.Dt rrdbot.conf 5
.Os rrdbot 
.Sh NAME
.Nm rrdbot.conf
.Nd configuration files for 
.Xr rrdbotd 8
.Sh DESCRIPTION
.Xr rrdbotd 8
is an SNMP polling daemon. It writes out the polled values to an 
.Xr rrdtool 1 
database. The configuration files describe what to poll and where the resulting
RRD files are. 
.Pp
The configuration files may be used by more than one program, for example 
.Xr rrdbotd 8 ,
or 
.Xr rrdbot-create 8 .
Some settings are shared between programs, while many are program specific. 
Settings not recognized are ignored.
.Pp
An RRD file might only have one 'field' of values, or there may be multiple values
which are stored together. Each of the fields have a name. Certain settings in the 
configuration file are used per field. Where you see 
.Ar <field> 
in the documentaion below, substitute the appropriate RRD field name.
.Sh SYNTAX
The general syntax of an RRD file is as follows:
.Bd -literal -offset indent
# Comment
[header]
setting: a value here
field.setting: part of value
               continuation of value
.Ed
.Pp
The configuration file is broken into blocks separated by headers. The header 
sections each have different sets of options and are described below.
.Pp
The setting name (including a field name if necessary) is followed by a colon
and then the value. Values may be continued onto successive lines, as long as 
those lines are indented with spaces or tabs.
.Pp
Comments start with a # character at the leftmost margin.
.Sh GENERAL SETTINGS
These settings go under the 
.Ar [general]
header in a configuration file.
.Bl -tag -width Fl
.It Ar rrd 
The location of the RRD file. If not specified these are chosen automatically.
See the FILE LOCATIONS topic below. When specified this should be a full path.
.Pp
[ Optional ]
.El
.Sh POLL SETTINGS
Settings to control when and how the SNMP source is polled by 
.Xr rrdbotd 8 . 
These settings go under the
.Ar [poll]
heading. 
.Bl -tag -width Fl
.It Ar interval
The interval (in seconds) at which to retrieve the SNMP values and store them in 
the RRD file.
.Pp
[ Required for 
.Xr rrdbotd 8 
]
.It Ar <field>.source
Specifies the SNMP source and OID in a URL format. The 
.Ar <field> 
above should be replaced with the RRD field name. Multiple 
.Ar xxxxx.source 
options can be specified if the RRD file has multiple fields. The syntax of the 
SNMP url is as follows:
.Bd -literal -offset indent
snmp[version]://community@host[:port]/oid[?query=value]
.Ed
.Pp
The following are valid SNMP urls:
.Bd -literal -offset indent
snmp://public@gateway.example.com/sysUptime.0
snmp2c://mycommunity@uplink.example.com/ifInOctets.2
snmp2c://mycommunity@example.com/ifInOctets?idDescr=eth0
snmp://public@www.example.com:10161/1.3.6.1.2.1.1.3.0
snmp://pub@two.example.com,one.example.com/sysUptime.0
.Ed
.Pp
See TABLE QUERIES for more info on how to use the query part. See MULTIPLE HOSTS
support for info on how to use multiple hosts.
.Pp
To test that your SNMP urls are correct you can use the 
.Xr rrdbot-get 1
utility.
.Pp
[ Required for 
.Xr rrdbotd 8 
]
.It Ar timeout
The timeout (in seconds) to wait for an SNMP response.
.El
.Sh CREATE SETTINGS
These settings are used by the 
.Xr rrdbot-create 8
tool to automatically create RRD files for you. Put these settings under the 
.Ar [create]
header.
.Bl -tag -width Fl
.It Ar archive
The archives of values you would like to keep in your RRD. There can be multiple 
archives specified, separated by commas. The syntax of an archive is as follows:
.Bd -literal -offset indent
<count>/<unit> * <how-many> <units>
.Ed
.Pp
The example below describes three archives of "2 per minute for 1 week", 
"4 per hour for 3 months", "3 per day for 1 year":
.Bd -literal -offset indent
2/minute * 1 weeks, 4/hour * 3 months, 3/day * 1 year
.Ed
.Pp
[ Required for 
rrdbot-create 8
]
.It Ar cf
The consolidation functions to use to consolidate RRD values when 
archiving them. This applies to all fields in the RRD. There can be multiple
functions specified, separated by commas. The valid functions are:
.Bl -tag -width Fl
.It Ar AVERAGE 
Average out the values when archiving them.
.It Ar LAST
Use the last value in the set to be archived.
.It Ar MAX
Use the maximum value in the set to be archived.
.It Ar MIN
Use the minimum value in the set to be archived.
.El
.Pp
[ Default: 
.Ar AVERAGE 
]
.It Ar <field>.max
The maximum value for the field. Use the character
.Ar U
to specify that there is no maximum (unbounded).
.Pp
[ Default: 
.Ar U 
]
.It Ar <field>.min
The minimum value for the field. Use the character 
.Ar U 
to specify that there is no minimum (unbounded).
.Pp
[ Default: 
.Ar U 
]
.It Ar <field>.type
The type of values that will be stored in this field. For more info see the 
.Xr rrdcreate 1
manual. The types are:
.Bl -tag -width Fl
.It Ar ABSOLUTE 
Used for counters that get reset when read.
.It Ar COUNTER
For values that increment between reads. 
.It Ar DERIVE
Used to measure rates of increase or decrease.
.It Ar GAUGE
For values that are current, for example the temperature.
.El
.Pp
[ Default:
.Ar ABSOLUTE
]
.El
.Sh FILE LOCATIONS
To determine the default location for the configuration files and RRD files 
run this command:
.Bd -literal -offset indent
# rrdbotd -V 
.Ed
.Pp
The configuration files for SNMP pollers are laid out in a directory tree, 
with one file per RRD. Subdirectories can be used to organize the 
configuration files. The contents of the configuration files are described 
in 
.Xr rrdbot.conf 5 .
.Pp
By default the RRD files mirror the directory structure and names of the 
configuration files, with an 
.Pa .rrd
extension appended to the filename.
.Pp
For example if your configuration files are in a structure like the following:
.Bd -literal -offset indent
/usr/local/etc/rrdbot/
  gateways/
    gateway-load.conf
    gateway-traffic.conf
  temperature/
    inside-temperature.conf
    outside-temperature.conf
  machine-load.conf  
.Ed
.Pp
Then the default RRD files would be in a similar directory structure:
.Bd -literal -offset indent
/var/db/rrdbot/
  gateways/
    gateway-load.conf.rrd
    gateway-traffic.conf.rrd
  temperature/
    inside-temperature.conf.rrd
    outside-temperature.conf.rrd
  machine-load.conf.rrd
.Ed
.Pp
The default location for an RRD file can be overridden by using the 
.Ar rrd
option in the configuration file.
.Pp
Once you have configuration files in place, you can use the 
.Xr rrdbot-create 8
tool to create the needed RRD files in the appropriate places.
.Sh MULTIPLE AGENTS
.Xr rrdbotd 8 
supports failover between multiple agents. If an SNMP query fails on one agent
or a value is not found when querying an agent, then it will switch to another
configured agent. 
.Pp
When combined with a query (see TABLE QUERIES) you can use this feature to 
search for a given value in a table on one of multiple agents.
.Pp
To use failover, simply use multiple host names with commas (without a space)
separating them. For example:
.Bd -literal -offset indent
snmp://public@two.example.com,one.example.com/sysUptime.0
.Ed
.Sh TABLE QUERIES
.Xr rrdbotd 8 
can query a value that corresponds to a certain row in an SNMP table. On 
many SNMP agents the indexes of rows in tables are not fixed, and this 
allows you to retrieve a certain value no matter what row of the table 
it is on.
.Pp
Add the OID and value you want to search for in the table to the end 
of the SNMP URL. Only one query value is supported. 
.Pp
For example to get the outbound packet count on the 'eth0' interface, you would use:
.Bd -literal -offset indent
snmp://public@example.com/ifInUcastPkts?ifDescr=eth0
.Ed
.Sh SEE ALSO
.Xr rrdbotd 8 ,
.Xr rrdbot-create 8 ,
.Xr rrdbot-get 1 ,
.Xr rrdtool 1
.Sh AUTHOR
.An Stef Walter Aq stef@memberwebs.com