-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path22_extraction.html
473 lines (326 loc) · 21.3 KB
/
22_extraction.html
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Metrics extraction configuration — RPi-Monitor v2.13-r0</title>
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="next" title="Interactive Configuration Helper" href="23_configuration_helper.html" />
<link rel="prev" title="Daemon configuration" href="21_daemon.html" />
<script src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-6853682829194266",
enable_page_level_ads: true
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-114314379-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-18642541-8');
</script>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav">
<img style="position: fixed; top: 0; right: 0; z-index: 100; height:300px; border: 0;" src="_images/wip.png">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> RPi-Monitor
</a>
<div class="version">
2.13
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="01_features.html">Keys features of RPi-Monitor</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="10_index.html">Getting started</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="20_index.html">Configuration</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="21_daemon.html">Daemon configuration</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Metrics extraction configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="23_configuration_helper.html">Interactive Configuration Helper</a></li>
<li class="toctree-l2"><a class="reference internal" href="24_web.html">Web interface configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="25_addons.html">Addons configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="26_alert.html">Alert configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="27_configuration_templates.html">Configuration templates</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="30_index.html">Usages</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="40_index.html">To go further</a></li>
</ul>
<hr />
<div style="padding: 0;">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-6853682829194266"
data-ad-slot="2876944524"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">RPi-Monitor</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li><a href="20_index.html">Configuration</a> »</li>
<li>Metrics extraction configuration</li>
<li class="wy-breadcrumbs-aside">
<!-- User defined GitHub URL -->
<a href="https://github.com/XavierBerger/RPi-Monitor/blob/develop/docs/source/22_extraction.rst" class="fa fa-github"> Edit on GitHub</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="metrics-extraction-configuration">
<h1>Metrics extraction configuration<a class="headerlink" href="#metrics-extraction-configuration" title="Permalink to this headline">¶</a></h1>
<div class="section" id="include">
<h2>Include<a class="headerlink" href="#include" title="Permalink to this headline">¶</a></h2>
<p><code class="docutils literal"><span class="pre">include</span></code> keyword is available to add a file to the list of configuration files to be loaded.</p>
<dl class="docutils">
<dt>include=<full path to configuration file></dt>
<dd><p class="first"><code class="docutils literal"><span class="pre"><full</span> <span class="pre">path</span> <span class="pre">to</span> <span class="pre">configuration</span> <span class="pre">file></span></code> is the full path to the configuration
file to add at the end of the list of configuration files to be loaded.</p>
<div class="last admonition hint">
<p class="first admonition-title">Hint</p>
<p class="last">The initial order of information displayed in status page depends on the
order of file inclusion.</p>
</div>
</dd>
</dl>
</div>
<div class="section" id="static">
<h2>Static<a class="headerlink" href="#static" title="Permalink to this headline">¶</a></h2>
<p><code class="docutils literal"><span class="pre">static</span></code> is definign KPI which is not changing over the time. KPI are extracted
once at <code class="docutils literal"><span class="pre">rpimonitord</span></code> startup (example: memory size, disk size, network bandwidth limit...).</p>
<p>Each static KPI is identified into the configuration file by a line starting with the
keyword <code class="docutils literal"><span class="pre">static</span></code>, an identifier <code class="docutils literal"><span class="pre"><static</span> <span class="pre">data</span> <span class="pre">id></span></code> and the following parameters.</p>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p class="last">Inside a configuration file <code class="docutils literal"><span class="pre"><static</span> <span class="pre">data</span> <span class="pre">id></span></code> should be unique per KPI.</p>
</div>
<dl class="docutils">
<dt>static.<static data id>.name=<data name></dt>
<dd><p class="first"><code class="docutils literal"><span class="pre"><data</span> <span class="pre">name></span></code> is a string representing the KPI or the list of KPI
separated by comma. Each name has to be unique.
Only alpha numerical charter and underscore are accepted.</p>
<div class="last admonition danger">
<p class="first admonition-title">Danger</p>
<p class="last">Do not use <code class="docutils literal"><span class="pre">-</span></code> in <code class="docutils literal"><span class="pre">data</span> <span class="pre">name</span></code>: This is a limitation of javascript.</p>
</div>
</dd>
<dt>static.<static data id>.source=<data source></dt>
<dd><p class="first"><code class="docutils literal"><span class="pre"><data</span> <span class="pre">source></span></code> is a file or an executable file within the path.
If the file exists, <code class="docutils literal"><span class="pre">rpimonitord</span></code> will read its content. If the file
is not existing, <code class="docutils literal"><span class="pre">rpimonitord</span></code> will try to execute it and will parse
the output.</p>
<div class="last admonition note">
<p class="first admonition-title">Note</p>
<p>In <code class="docutils literal"><span class="pre"><data</span> <span class="pre">source></span></code> it is possible to refer to another <code class="docutils literal"><span class="pre"><data</span> <span class="pre">name></span></code>
with the prefix <code class="docutils literal"><span class="pre">data.</span></code> followed by <code class="docutils literal"><span class="pre"><data</span> <span class="pre">name></span></code>. This data could
refer to <code class="docutils literal"><span class="pre">dynamic</span></code> or <code class="docutils literal"><span class="pre">static</span></code> KPI.</p>
<p><strong>Example</strong>: <code class="docutils literal"><span class="pre">data.kernel_version</span></code></p>
<div class="last admonition important">
<p class="first admonition-title">Important</p>
<p>The order of KPI extraction is important.</p>
<p class="last">Data used should already been extracted to be accessible.</p>
</div>
</div>
</dd>
<dt>static.<static data id>.regexp=<data regexp></dt>
<dd><code class="docutils literal"><span class="pre"><data</span> <span class="pre">regexp></span></code> is the regular expression extracting information from
data source. Regexp groups <code class="docutils literal"><span class="pre">()</span></code> has to be used to extract the data
In case of KPI list, each group will be affected to a KPI name.</dd>
<dt>static.<static data id>.postprocess=<data postprocess></dt>
<dd><code class="docutils literal"><span class="pre"><data</span> <span class="pre">postprocess></span></code> is an expression defining the postprocessing formula or the
list of postprocessing formula (comma separated) to be applied on result.
Each result is processed individually and is identified by <code class="docutils literal"><span class="pre">$1</span></code>
This parameter will be evaluate by the command eval of <code class="docutils literal"><span class="pre">perl</span></code>.</dd>
</dl>
</div>
<div class="section" id="dynamic">
<h2>Dynamic<a class="headerlink" href="#dynamic" title="Permalink to this headline">¶</a></h2>
<p>Dynamic KPI are extracted periodically (defined by <code class="docutils literal"><span class="pre">daemon.delay</span></code>).
Each KPI is identified into the conf file by a line stating with the keyword
<code class="docutils literal"><span class="pre">dynamic</span></code>, an identifier <code class="docutils literal"><span class="pre"><dynamic</span> <span class="pre">data</span> <span class="pre">id></span></code> and the following parameters:</p>
<dl class="docutils">
<dt>dynamic.<dynamic data id>.name=<data name></dt>
<dd><p class="first"><code class="docutils literal"><span class="pre"><data</span> <span class="pre">name></span></code> is a string representing the KPI or the list of KPI
separated by comma. Each name has to be unique.
Only alpha numerical charter and underscore are accepted.</p>
<div class="last admonition danger">
<p class="first admonition-title">Danger</p>
<p class="last">Do not use <code class="docutils literal"><span class="pre">-</span></code> in <code class="docutils literal"><span class="pre">data</span> <span class="pre">name</span></code>: This is a limitation of javascript.</p>
</div>
</dd>
<dt>dynamic.<dynamic data id>.source=<data source></dt>
<dd><code class="docutils literal"><span class="pre"><data</span> <span class="pre">source></span></code> is a file or an executable program within the path.
If the file exists, <code class="docutils literal"><span class="pre">rpimonitord</span></code> will read its content. If the file
is not existing, <code class="docutils literal"><span class="pre">rpimonirotd</span></code> will try to execute it and will parse
the output.</dd>
<dt>dynamic.<dynamic data id>.regexp=<data regexp></dt>
<dd><code class="docutils literal"><span class="pre"><data</span> <span class="pre">regexp></span></code> is the regular expression extracting information from
data source. Regexp groups <code class="docutils literal"><span class="pre">()</span></code> has to be used to extract the data
In case of KPI list, each group will be affected to a KPI name.</dd>
<dt>dynamic.<dynamic data id>.postprocess=<data postprocess></dt>
<dd><p class="first"><code class="docutils literal"><span class="pre"><data</span> <span class="pre">postprocess></span></code> is an expression defining the postprocessing formula or the
list of postprocessing formula (comma separated) to be applied on result.
Each result is processed individually and is identified by <code class="docutils literal"><span class="pre">$1</span></code>
This parameter will be evaluate by the command eval of <code class="docutils literal"><span class="pre">perl</span></code>.</p>
<div class="last admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Static values are accessible for the post processing using the
variable <code class="docutils literal"><span class="pre">$this->{'static'}->{'static_data_name'}</span></code> and can be used.
You can refer to swap data extraction to see an example (cf. <code class="docutils literal"><span class="pre">swap.conf</span></code>).</p>
</div>
</dd>
<dt>dynamic.<dynamic data id>.interval=<interval></dt>
<dd><code class="docutils literal"><span class="pre">rpimonitord</span></code> extracts data every <code class="docutils literal"><span class="pre">daemon.delay</span></code> seconds. <code class="docutils literal"><span class="pre"><interval></span></code>
define how many loop have to be waited before extracting this data.
Default value is <code class="docutils literal"><span class="pre">1</span></code>. This means that data is extracted at every loop.</dd>
<dt>dynamic.<dynamic data id>.default=<default></dt>
<dd>If <code class="docutils literal"><span class="pre">rpimonitord</span></code> can’t extract information, it is possible to define
a <code class="docutils literal"><span class="pre"><default></span></code> value which will be set for the KPI or defaults values of a list
of KPI separated by comma.</dd>
<dt>dynamic.<dynamic data id>.rrd=<GAUGE|COUNTER|DERIVE|ABSOLUTE|COMPUTE></dt>
<dd><code class="docutils literal"><span class="pre">rrd</span></code> parameter is defining if the KPI has to be stored into a RRD
database and how <code class="docutils literal"><span class="pre"><GAUGE|COUNTER|DERIVE|ABSOLUTE|COMPUTE></span></code>. If the
parameter is defined as empty, no RRD database will be created. If
this parameter is defined, a RRD database will be created and data
will be stored at every extraction.
Ref <a class="reference external" href="http://oss.oetiker.ch/rrdtool/doc/rrdcreate.en.html">RRDTool documentation</a>
for RRD parameter description.</dd>
</dl>
<p><strong>dynamic.<dynamic data id>.min=<minimal value acceptable in RRD></strong></p>
<dl class="docutils">
<dt>dynamic.<dynamic data id>.max=<maximal value acceptable in RRD></dt>
<dd><p class="first">If a value extracted by is less than minimal of greater than maximal
value, it will not be stored into RRD database as unknown.
These limits are usefull to handle counter that fall down to 0 when
they reach their limit (Ex: network graphs)</p>
<div class="last admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Static values are accessible for the post processing using the
variable <code class="docutils literal"><span class="pre">$this->{'static'}->{'static_data_name'}</span></code> and can be used.
You can refer to swap data extraction to see an example.</p>
</div>
</dd>
</dl>
</div>
<div class="section" id="snmp-oid">
<h2>SNMP OID<a class="headerlink" href="#snmp-oid" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><p><strong>RPi-Monitor</strong> is able to act as an snmp-agent. Snmp configuration is based
on KPI name. KPI could be <code class="docutils literal"><span class="pre">static</span></code> or <code class="docutils literal"><span class="pre">dynamic</span></code>.</p>
<dl class="docutils">
<dt>snmp.<kpi name>.id=<id></dt>
<dd><code class="docutils literal"><span class="pre"><id></span></code> is the last number of OID appended at the end of OID configuration
defined for snmp agent. (ref. SNMP agent configuration section)</dd>
<dt>snmp.<kpi name>.type=<type></dt>
<dd>Type of data can be : <code class="docutils literal"><span class="pre">counter</span></code>, <code class="docutils literal"><span class="pre">counter64</span></code>, <code class="docutils literal"><span class="pre">gauge</span></code>, <code class="docutils literal"><span class="pre">integer</span></code>,
<code class="docutils literal"><span class="pre">ipaddr</span></code>, <code class="docutils literal"><span class="pre">ipaddress</span></code>, <code class="docutils literal"><span class="pre">netaddr</span></code>, <code class="docutils literal"><span class="pre">objectid</span></code>, <code class="docutils literal"><span class="pre">octetstr</span></code>,
<code class="docutils literal"><span class="pre">string</span></code>, <code class="docutils literal"><span class="pre">timeticks</span></code></dd>
<dt>snmp.<kpi name>.description=<text description></dt>
<dd>Description of KPI to be added in MIB</dd>
<dt>snmp.<kpi name>.postprocess=<formula></dt>
<dd>Post process formula to apply to KPI before sending over SNMP.
Ex: Convert float to interger by mutiplying by 100: <code class="docutils literal"><span class="pre">$1*100</span></code></dd>
</dl>
</div></blockquote>
<div class="section" id="commands-to-use-to-get-mib-information">
<h3>Commands to use to get MIB information:<a class="headerlink" href="#commands-to-use-to-get-mib-information" title="Permalink to this headline">¶</a></h3>
<dl class="docutils">
<dt>Snmp Configuration</dt>
<dd>See configuration file example in <code class="docutils literal"><span class="pre">/etc/snmp/snmpd.conf.rpimonitor</span></code>
and activate pass_persist extension</dd>
<dt>Extract MIB from RPi-Monitor</dt>
<dd><code class="docutils literal"><span class="pre">rpimonitord</span> <span class="pre">-m</span> <span class="pre">></span> <span class="pre">~/mib.txt</span></code></dd>
<dt>Get data from SNMP</dt>
<dd><code class="docutils literal"><span class="pre">snmpwalk</span> <span class="pre">-v</span> <span class="pre">2c</span> <span class="pre">-m</span> <span class="pre">~/mib.txt</span> <span class="pre">-c</span> <span class="pre">public</span> <span class="pre">127.0.0.1</span> <span class="pre">1.3.6.1.4.1.54321.42</span></code></dd>
</dl>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="23_configuration_helper.html" class="btn btn-neutral float-right" title="Interactive Configuration Helper" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="21_daemon.html" class="btn btn-neutral" title="Daemon configuration" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2018, Xavier Berger.
Last updated on Mar 18, 2018.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-6853682829194266"
data-ad-slot="2876944524"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: ''
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enableSticky();
});
</script>
</body>
</html>