-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path31_configuration_examples.html
722 lines (537 loc) · 72.4 KB
/
31_configuration_examples.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
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
<!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>Configuration examples — 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="Configuration using sensors" href="32_sensors.html" />
<link rel="prev" title="Usages" href="30_index.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>
<li class="toctree-l1"><a class="reference internal" href="20_index.html">Configuration</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="30_index.html">Usages</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">Configuration examples</a></li>
<li class="toctree-l2"><a class="reference internal" href="32_sensors.html">Configuration using sensors</a></li>
<li class="toctree-l2"><a class="reference internal" href="33_lcd.html">RPi-Monitor-LCD</a></li>
<li class="toctree-l2"><a class="reference internal" href="34_autentication.html">Authentication and secure access</a></li>
<li class="toctree-l2"><a class="reference internal" href="35_external.html">Non standard configuration</a></li>
</ul>
</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="30_index.html">Usages</a> »</li>
<li>Configuration examples</li>
<li class="wy-breadcrumbs-aside">
<!-- User defined GitHub URL -->
<a href="https://github.com/XavierBerger/RPi-Monitor/blob/develop/docs/source/31_configuration_examples.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="configuration-examples">
<h1>Configuration examples<a class="headerlink" href="#configuration-examples" title="Permalink to this headline">¶</a></h1>
<div class="section" id="monitoring-a-wifi-network">
<h2>Monitoring a WiFi network<a class="headerlink" href="#monitoring-a-wifi-network" title="Permalink to this headline">¶</a></h2>
<p>The following configuration is showing how to configure the monitoring WiFi
interface <code class="docutils literal"><span class="pre">wlan0</span></code></p>
<p>To extract metrics representing the trafic on the interface we need to create
a <code class="docutils literal"><span class="pre">dynamic</span></code> configuration to collect data in pseudo file system
<code class="docutils literal"><span class="pre">/sys/class/net/wlan0/statistics/</span></code>.</p>
<div class="section" id="collecting-metrics">
<h3>Collecting metrics<a class="headerlink" href="#collecting-metrics" title="Permalink to this headline">¶</a></h3>
<div class="highlight-default"><div class="highlight"><pre><span></span>dynamic.1.name=wifi_received
dynamic.1.source=/sys/class/net/wlan0/statistics/rx_bytes
dynamic.1.regexp=(.*)
dynamic.1.postprocess=$1*-1
dynamic.1.rrd=DERIVE
dynamic.2.name=wifi_send
dynamic.2.source=/sys/class/net/wlan0/statistics/tx_bytes
dynamic.2.regexp=(.*)
dynamic.2.postprocess=
dynamic.2.rrd=DERIVE
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">We dicided to represent downstream data with negative values. This is
performed by the postprocess command: <code class="docutils literal"><span class="pre">$1*-1</span></code></p>
</div>
</div>
<div class="section" id="add-status">
<h3>Add status<a class="headerlink" href="#add-status" title="Permalink to this headline">¶</a></h3>
<p>The collected metrics will be displayed in <code class="docutils literal"><span class="pre">status</span></code> page as define in the
configuration bellow:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">web</span><span class="o">.</span><span class="n">status</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">title</span><span class="o">=</span><span class="n">WiFi</span>
<span class="n">web</span><span class="o">.</span><span class="n">status</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">icon</span><span class="o">=</span><span class="n">wifi</span><span class="o">.</span><span class="n">png</span>
<span class="n">web</span><span class="o">.</span><span class="n">status</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">line</span><span class="o">.</span><span class="mi">1</span><span class="o">=</span><span class="s2">"WiFi Sent: <b>"</span><span class="o">+</span><span class="n">KMG</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">wifi_send</span><span class="p">)</span><span class="o">+</span><span class="s2">"<i class='icon-arrow-up'></i></b> Received: <b>"</span><span class="o">+</span><span class="n">KMG</span><span class="p">(</span><span class="n">Math</span><span class="o">.</span><span class="n">abs</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">wifi_received</span><span class="p">))</span> <span class="o">+</span> <span class="s2">"<i class='icon-arrow-down'></i></b>"</span>
</pre></div>
</div>
<div class="figure align-center">
<img alt="_images/wifi001.png" src="_images/wifi001.png" />
</div>
</div>
<div class="section" id="add-statistics">
<h3>Add statistics<a class="headerlink" href="#add-statistics" title="Permalink to this headline">¶</a></h3>
<p>The following configuration add one graph to statistics page with the 2 curves
representing upstream and downstream metrics:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">title</span><span class="o">=</span><span class="n">WiFi</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">graph</span><span class="o">.</span><span class="mi">1</span><span class="o">=</span><span class="n">wifi_send</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">graph</span><span class="o">.</span><span class="mi">2</span><span class="o">=</span><span class="n">wifi_received</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">ds_graph_options</span><span class="o">.</span><span class="n">wifi_send</span><span class="o">.</span><span class="n">label</span><span class="o">=</span><span class="n">Upload</span> <span class="n">bandwidth</span> <span class="p">(</span><span class="n">bits</span><span class="p">)</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">ds_graph_options</span><span class="o">.</span><span class="n">wifi_send</span><span class="o">.</span><span class="n">lines</span><span class="o">=</span><span class="p">{</span> <span class="n">fill</span><span class="p">:</span> <span class="n">true</span> <span class="p">}</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">ds_graph_options</span><span class="o">.</span><span class="n">wifi_send</span><span class="o">.</span><span class="n">color</span><span class="o">=</span><span class="s2">"#FF7777"</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">ds_graph_options</span><span class="o">.</span><span class="n">wifi_received</span><span class="o">.</span><span class="n">label</span><span class="o">=</span><span class="n">Download</span> <span class="n">bandwidth</span> <span class="p">(</span><span class="n">bits</span><span class="p">)</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">ds_graph_options</span><span class="o">.</span><span class="n">wifi_received</span><span class="o">.</span><span class="n">lines</span><span class="o">=</span><span class="p">{</span> <span class="n">fill</span><span class="p">:</span> <span class="n">true</span> <span class="p">}</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">ds_graph_options</span><span class="o">.</span><span class="n">wifi_received</span><span class="o">.</span><span class="n">color</span><span class="o">=</span><span class="s2">"#77FF77"</span>
</pre></div>
</div>
<p>In this configuration, we set color to green for downstream and red for upstream.
The curves are filled.</p>
<div class="admonition important">
<p class="first admonition-title">Important</p>
<p class="last">To apply the configuration, it is required to restart <strong>RPi-Monitor</strong> : <code class="docutils literal"><span class="pre">/etc/init.d/rpimonotird</span> <span class="pre">restart</span></code></p>
</div>
</div>
</div>
<div class="section" id="monitor-external-disk">
<h2>Monitor external disk<a class="headerlink" href="#monitor-external-disk" title="Permalink to this headline">¶</a></h2>
<p>The disk have a disk with two partition <code class="docutils literal"><span class="pre">/dev/sda1</span></code> and <code class="docutils literal"><span class="pre">/dev/sda3</span></code>.</p>
<p>The command and regular expression will be the following:</p>
<ul class="simple">
<li>sda1 disk size command : <code class="docutils literal"><span class="pre">df</span> <span class="pre">-t</span> <span class="pre">ext2,</span> <span class="pre">regular</span> <span class="pre">expression:</span> <span class="pre">sda1\s+(\d+)</span></code></li>
<li>sda1 used space command : <code class="docutils literal"><span class="pre">df</span> <span class="pre">-t</span> <span class="pre">ext2,</span> <span class="pre">regular</span> <span class="pre">expression:</span> <span class="pre">sda1\s+\d+\s+(\d+)</span></code></li>
<li>sda3 disk size command : <code class="docutils literal"><span class="pre">df</span> <span class="pre">-t</span> <span class="pre">ext4,</span> <span class="pre">regular</span> <span class="pre">expression:</span> <span class="pre">sda3\s+(\d+)</span></code></li>
<li>sda3 used space command : <code class="docutils literal"><span class="pre">df</span> <span class="pre">-t</span> <span class="pre">ext4,</span> <span class="pre">regular</span> <span class="pre">expression:</span> <span class="pre">sda3\s+\d+\s+(\d+)</span></code></li>
</ul>
<p>First we need to configure the extraction of partitions sizes which are extracted once at RPi-Monitor startup. We will create a file /etc/rpimonitord.conf.d/custo.conf with the data configured as static data like this:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>static.1.name=storage1_total
static.1.source=df -t ext2
static.1.regexp=sda1\s+(\d+)
static.1.postprocess=$1/1024
static.2.name=storage2_total
static.2.source=df -t ext4
static.2.regexp=sda3\s+(\d+)
static.2.postprocess=$1/1024
</pre></div>
</div>
<p>The post processing is configured to transform kB into MB by dividing the extracted result by 1024.</p>
<p>For dynamic values extracted every 10 seconds, the configuration will be:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>dynamic.1.name=storage1_used
dynamic.1.source=df -t ext2
dynamic.1.regexp=sda1\s+\d+\s+(\d+)
dynamic.1.postprocess=$1/1024
dynamic.1.rrd=GAUGE
dynamic.2.name=storage2_used
dynamic.2.source=df -t ext4
dynamic.2.regexp=sda3\s+\d+\s+(\d+)
dynamic.2.postprocess=$1/1024
dynamic.2.rrd=GAUGE
</pre></div>
</div>
<p>Dynamic stat will be stored into a RRD File as GAUGE. Ref to RRDTool help for detail about Data Source Types.</p>
<p>Now we will add a status line for this disk whit the following icon:</p>
<div class="figure align-center">
<img alt="_images/hdd001.png" src="_images/hdd001.png" />
</div>
<p>This icons has to be installed into the img directory of <strong>RPi-Monitor</strong> which is
by default <code class="docutils literal"><span class="pre">/usr/share/rpimonitor/web/img/</span></code>.</p>
<p>The configuration to add a new status strip will then be the following:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">web</span><span class="o">.</span><span class="n">status</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">title</span><span class="o">=</span><span class="n">Storage</span>
<span class="n">web</span><span class="o">.</span><span class="n">status</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">icon</span><span class="o">=</span><span class="n">usb_hdd</span><span class="o">.</span><span class="n">png</span>
<span class="n">web</span><span class="o">.</span><span class="n">status</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">line</span><span class="o">.</span><span class="mi">1</span><span class="o">=</span><span class="s2">"<b>/storage1</b> Used: <b>"</span><span class="o">+</span><span class="n">KMG</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">storage1_used</span><span class="p">,</span><span class="s1">'M'</span><span class="p">)</span><span class="o">+</span><span class="s2">"</b> (<b>"</span><span class="o">+</span><span class="n">Percent</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">storage1_used</span><span class="p">,</span><span class="n">data</span><span class="o">.</span><span class="n">storage1_total</span><span class="p">,</span><span class="s1">'M'</span><span class="p">)</span><span class="o">+</span><span class="s2">"</b>) Free: <b>"</span><span class="o">+</span><span class="n">KMG</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">storage1_total</span><span class="o">-</span><span class="n">data</span><span class="o">.</span><span class="n">storage1_used</span><span class="p">,</span><span class="s1">'M'</span><span class="p">)</span><span class="o">+</span> <span class="s2">"</b> Total: <b>"</span><span class="o">+</span> <span class="n">KMG</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">storage1_total</span><span class="p">,</span><span class="s1">'M'</span><span class="p">)</span> <span class="o">+</span><span class="s2">"</b>"</span>
<span class="n">web</span><span class="o">.</span><span class="n">status</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">line</span><span class="o">.</span><span class="mi">2</span><span class="o">=</span><span class="n">ProgressBar</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">storage1_used</span><span class="p">,</span><span class="n">data</span><span class="o">.</span><span class="n">storage1_total</span><span class="p">)</span>
<span class="n">web</span><span class="o">.</span><span class="n">status</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">line</span><span class="o">.</span><span class="mi">3</span><span class="o">=</span><span class="s2">"<b>/storage2</b> Used: <b>"</span><span class="o">+</span><span class="n">KMG</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">storage2_used</span><span class="p">,</span><span class="s1">'M'</span><span class="p">)</span><span class="o">+</span><span class="s2">"</b> (<b>"</span><span class="o">+</span><span class="n">Percent</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">storage2_used</span><span class="p">,</span><span class="n">data</span><span class="o">.</span><span class="n">storage2_total</span><span class="p">,</span><span class="s1">'M'</span><span class="p">)</span><span class="o">+</span><span class="s2">"</b>) Free: <b>"</span><span class="o">+</span><span class="n">KMG</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">storage2_total</span><span class="o">-</span><span class="n">data</span><span class="o">.</span><span class="n">storage2_used</span><span class="p">,</span><span class="s1">'M'</span><span class="p">)</span><span class="o">+</span> <span class="s2">"</b> Total: <b>"</span><span class="o">+</span> <span class="n">KMG</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">storage2_total</span><span class="p">,</span><span class="s1">'M'</span><span class="p">)</span> <span class="o">+</span><span class="s2">"</b>"</span>
</pre></div>
</div>
<p>The configuration may need some explanation:</p>
<p>We do configure 4 lines. Each line is describing a javascript line using some
predefined functions: KMG, Precent and ProgressBar. This function are called by
the browser while rendering the page. Some variable coming from the extracted
data are also used. These variables are starting by the keyword <code class="docutils literal"><span class="pre">data</span></code>. For
deeper detail about this configuration execute the command man rpimonitord.conf</p>
<p>To see our modification we need to restart <strong>RPi-Monitor</strong> and refresh the
statistics page into our browser.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">sudo</span> <span class="n">service</span> <span class="n">rpimonitor</span> <span class="n">restart</span>
</pre></div>
</div>
<p>The result of the configuration is at the bottom of the following screenshot:</p>
<div class="figure align-center">
<a class="reference internal image-reference" href="_images/hdd002.png"><img alt="_images/hdd002.png" src="_images/hdd002.png" style="width: 500px;" /></a>
</div>
<p>The status page is working, let’s now add a graphic of the disk usage.
This is done with the following configuration:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">title</span><span class="o">=</span><span class="n">Storage1</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">graph</span><span class="o">.</span><span class="mi">1</span><span class="o">=</span><span class="n">storage1_total</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">graph</span><span class="o">.</span><span class="mi">2</span><span class="o">=</span><span class="n">storage1_used</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">ds_graph_options</span><span class="o">.</span><span class="n">storage1_total</span><span class="o">.</span><span class="n">label</span><span class="o">=</span><span class="n">Storage1</span> <span class="n">total</span> <span class="n">space</span> <span class="p">(</span><span class="n">MB</span><span class="p">)</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">ds_graph_options</span><span class="o">.</span><span class="n">storage1_total</span><span class="o">.</span><span class="n">color</span><span class="o">=</span><span class="s2">"#FF7777"</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">ds_graph_options</span><span class="o">.</span><span class="n">storage1_used</span><span class="o">.</span><span class="n">label</span><span class="o">=</span><span class="n">Storage1</span> <span class="n">used</span> <span class="n">space</span> <span class="p">(</span><span class="n">MB</span><span class="p">)</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">ds_graph_options</span><span class="o">.</span><span class="n">storage1_used</span><span class="o">.</span><span class="n">lines</span><span class="o">=</span><span class="p">{</span> <span class="n">fill</span><span class="p">:</span> <span class="n">true</span> <span class="p">}</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">ds_graph_options</span><span class="o">.</span><span class="n">storage1_used</span><span class="o">.</span><span class="n">color</span><span class="o">=</span><span class="s2">"#7777FF"</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">2.</span><span class="n">title</span><span class="o">=</span><span class="n">Storage2</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">2.</span><span class="n">graph</span><span class="o">.</span><span class="mi">1</span><span class="o">=</span><span class="n">storage2_total</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">2.</span><span class="n">graph</span><span class="o">.</span><span class="mi">2</span><span class="o">=</span><span class="n">storage2_used</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">2.</span><span class="n">ds_graph_options</span><span class="o">.</span><span class="n">storage2_total</span><span class="o">.</span><span class="n">label</span><span class="o">=</span><span class="n">Storage2</span> <span class="n">total</span> <span class="n">space</span> <span class="p">(</span><span class="n">MB</span><span class="p">)</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">2.</span><span class="n">ds_graph_options</span><span class="o">.</span><span class="n">storage2_total</span><span class="o">.</span><span class="n">color</span><span class="o">=</span><span class="s2">"#FF7777"</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">2.</span><span class="n">ds_graph_options</span><span class="o">.</span><span class="n">storage2_used</span><span class="o">.</span><span class="n">label</span><span class="o">=</span><span class="n">Storage2</span> <span class="n">used</span> <span class="n">space</span> <span class="p">(</span><span class="n">MB</span><span class="p">)</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">2.</span><span class="n">ds_graph_options</span><span class="o">.</span><span class="n">storage2_used</span><span class="o">.</span><span class="n">lines</span><span class="o">=</span><span class="p">{</span> <span class="n">fill</span><span class="p">:</span> <span class="n">true</span> <span class="p">}</span>
<span class="n">web</span><span class="o">.</span><span class="n">statistics</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">2.</span><span class="n">ds_graph_options</span><span class="o">.</span><span class="n">storage2_used</span><span class="o">.</span><span class="n">color</span><span class="o">=</span><span class="s2">"#7777FF"</span>
</pre></div>
</div>
<p>The configuration may also need some explanation</p>
<p>We do configure 2 graphs each having 2 curves. The first curve represent the
total and is using static data extracted previously. This curve will be represented as a light red line.</p>
<p>The second curve is representing the usage of disk and is represented as a
light blue line filled. The parameters defining the curve are define by the keyword
ds_graph_options. Details of this parameter can be found in javascriptrrd help page.
Restart rpimonitor to activate the new graph.</p>
<p>After waiting a little time to let the system extract data you will see this kind of graph.</p>
<div class="figure align-center">
<a class="reference internal image-reference" href="_images/hdd003.png"><img alt="_images/hdd003.png" src="_images/hdd003.png" style="width: 500px;" /></a>
</div>
</div>
<div class="section" id="advanced-service-monitoring-configuration">
<h2>Advanced service monitoring configuration<a class="headerlink" href="#advanced-service-monitoring-configuration" title="Permalink to this headline">¶</a></h2>
<p>Here is an example of configuration proposed by Münir Ozan TOPCU:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1">########################################################################</span>
<span class="c1"># Extract information about Services</span>
<span class="c1"># </span>
<span class="c1">########################################################################</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">1.</span><span class="n">name</span><span class="o">=</span><span class="n">kodi_desc</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">1.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">kodi</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"kodi.service - "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">1.</span><span class="n">regexp</span><span class="o">=-</span> <span class="p">(</span><span class="o">.*</span><span class="p">)</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">2.</span><span class="n">name</span><span class="o">=</span><span class="n">kodi_act</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">2.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">kodi</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"Active: "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">2.</span><span class="n">regexp</span><span class="o">=</span><span class="p">(</span>\<span class="p">(</span><span class="o">.*</span>\<span class="p">))</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">3.</span><span class="n">name</span><span class="o">=</span><span class="n">kodi_runtime</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">3.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">kodi</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"Active: "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">3.</span><span class="n">regexp</span><span class="o">=</span><span class="p">;</span> <span class="p">(</span><span class="o">.*</span><span class="p">)</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">4.</span><span class="n">name</span><span class="o">=</span><span class="n">rpimonitor_desc</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">4.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">rpimonitor</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"rpimonitor.service -"</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">4.</span><span class="n">regexp</span><span class="o">=-</span> <span class="p">(</span><span class="o">.*</span><span class="p">)</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">5.</span><span class="n">name</span><span class="o">=</span><span class="n">rpimonitor_act</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">5.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">rpimonitor</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"Active: "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">5.</span><span class="n">regexp</span><span class="o">=</span><span class="p">(</span>\<span class="p">(</span><span class="o">.*</span>\<span class="p">))</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">6.</span><span class="n">name</span><span class="o">=</span><span class="n">rpimonitor_runtime</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">6.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">rpimonitor</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"Active: "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">6.</span><span class="n">regexp</span><span class="o">=</span><span class="p">;</span> <span class="p">(</span><span class="o">.*</span><span class="p">)</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">7.</span><span class="n">name</span><span class="o">=</span><span class="n">smbd_desc</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">7.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">smbd</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"smbd.service - "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">7.</span><span class="n">regexp</span><span class="o">=-</span> <span class="p">(</span><span class="o">.*</span><span class="p">)</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">8.</span><span class="n">name</span><span class="o">=</span><span class="n">smbd_act</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">8.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">smbd</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"Active: "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">8.</span><span class="n">regexp</span><span class="o">=</span><span class="p">(</span>\<span class="p">(</span><span class="o">.*</span>\<span class="p">))</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">9.</span><span class="n">name</span><span class="o">=</span><span class="n">smbd_runtime</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">9.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">smbd</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"Active: "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">9.</span><span class="n">regexp</span><span class="o">=</span><span class="p">;</span> <span class="p">(</span><span class="o">.*</span><span class="p">)</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">10.</span><span class="n">name</span><span class="o">=</span><span class="n">sslocal_desc</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">10.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">sslocal</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"sslocal.service - "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">10.</span><span class="n">regexp</span><span class="o">=-</span> <span class="p">(</span><span class="o">.*</span><span class="p">)</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">11.</span><span class="n">name</span><span class="o">=</span><span class="n">sslocal_act</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">11.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">sslocal</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"Active: "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">11.</span><span class="n">regexp</span><span class="o">=</span><span class="p">(</span>\<span class="p">(</span><span class="o">.*</span>\<span class="p">))</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">12.</span><span class="n">name</span><span class="o">=</span><span class="n">sslocal_runtime</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">12.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">sslocal</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"Active: "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">12.</span><span class="n">regexp</span><span class="o">=</span><span class="p">;</span> <span class="p">(</span><span class="o">.*</span><span class="p">)</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">13.</span><span class="n">name</span><span class="o">=</span><span class="n">ssh_desc</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">13.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">ssh</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"ssh.service - "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">13.</span><span class="n">regexp</span><span class="o">=-</span> <span class="p">(</span><span class="o">.*</span><span class="p">)</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">14.</span><span class="n">name</span><span class="o">=</span><span class="n">ssh_act</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">14.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">ssh</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"Active: "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">14.</span><span class="n">regexp</span><span class="o">=</span><span class="p">(</span>\<span class="p">(</span><span class="o">.*</span>\<span class="p">))</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">15.</span><span class="n">name</span><span class="o">=</span><span class="n">ssh_runtime</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">15.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">ssh</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"Active: "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">15.</span><span class="n">regexp</span><span class="o">=</span><span class="p">;</span> <span class="p">(</span><span class="o">.*</span><span class="p">)</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">16.</span><span class="n">name</span><span class="o">=</span><span class="n">xrdp_desc</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">16.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">xrdp</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"xrdp.service - "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">16.</span><span class="n">regexp</span><span class="o">=-</span> <span class="p">(</span><span class="o">.*</span><span class="p">)</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">17.</span><span class="n">name</span><span class="o">=</span><span class="n">xrdp_act</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">17.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">xrdp</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"Active: "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">17.</span><span class="n">regexp</span><span class="o">=</span><span class="p">(</span>\<span class="p">(</span><span class="o">.*</span>\<span class="p">))</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">18.</span><span class="n">name</span><span class="o">=</span><span class="n">xrdp_runtime</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">18.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">xrdp</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"Active: "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">18.</span><span class="n">regexp</span><span class="o">=</span><span class="p">;</span> <span class="p">(</span><span class="o">.*</span><span class="p">)</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">19.</span><span class="n">name</span><span class="o">=</span><span class="n">deluge_daemon_desc</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">19.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">deluge</span><span class="o">-</span><span class="n">daemon</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"deluge-daemon.service - "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">19.</span><span class="n">regexp</span><span class="o">=-</span> <span class="p">(</span><span class="o">.*</span><span class="p">)</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">20.</span><span class="n">name</span><span class="o">=</span><span class="n">deluge_daemon_act</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">20.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">deluge</span><span class="o">-</span><span class="n">daemon</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"Active: "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">20.</span><span class="n">regexp</span><span class="o">=</span><span class="p">(</span>\<span class="p">(</span><span class="o">.*</span>\<span class="p">))</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">21.</span><span class="n">name</span><span class="o">=</span><span class="n">deluge_daemon_runtime</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">21.</span><span class="n">source</span><span class="o">=</span><span class="n">service</span> <span class="n">deluge</span><span class="o">-</span><span class="n">daemon</span> <span class="n">status</span> <span class="o">|</span> <span class="n">grep</span> <span class="s2">"Active: "</span>
<span class="n">dynamic</span><span class="o">.</span><span class="mf">21.</span><span class="n">regexp</span><span class="o">=</span><span class="p">;</span> <span class="p">(</span><span class="o">.*</span><span class="p">)</span>
<span class="n">web</span><span class="o">.</span><span class="n">status</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">title</span><span class="o">=</span><span class="s2">"Services"</span>
<span class="n">web</span><span class="o">.</span><span class="n">status</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">icon</span><span class="o">=</span><span class="n">daemons</span><span class="o">.</span><span class="n">png</span>
<span class="n">web</span><span class="o">.</span><span class="n">status</span><span class="o">.</span><span class="mf">1.</span><span class="n">content</span><span class="o">.</span><span class="mf">1.</span><span class="n">line</span><span class="o">.</span><span class="mi">1</span><span class="o">=</span><span class="s2">"<style type=</span><span class="se">\"</span><span class="s2">text/css</span><span class="se">\"</span><span class="s2">>.tg331 {border-collapse:collapse;border-spacing:0;}.tg331 tr:nth-child(even){background-color: #f2f2f2}.tg331 table{border: 0px solid #e9e9e9;}.tg331 td{font-family:Arial, sans-serif;font-size:14px;padding:12px 2px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;}.tg331 th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:12px 2px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;}.tg331 .tg331-yw4l{vertical-align:top;text-align: left;}.tg331 hr {display: block;margin-top: 0.5em;margin-bottom: 0.5em;margin-left: auto;margin-right: auto;border-style: inset; border-width: 1px;}</style><table width=</span><span class="se">\"</span><span class="s2">100%</span><span class="se">\"</span><span class="s2"> class=</span><span class="se">\"</span><span class="s2">tg331</span><span class="se">\"</span><span class="s2">><tr><td><b>Status</b></td><td><b>Service Name</b></td><td><b>Service Description</b></td><td><b>Run Time</b></td></tr><tr><td>"</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">kodi_act</span><span class="p">,</span><span class="s2">"=='(running)'"</span><span class="p">,</span><span class="s2">"OK"</span><span class="p">,</span><span class="s2">"success"</span><span class="p">)</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">kodi_act</span><span class="p">,</span><span class="s2">"!='(running)'"</span><span class="p">,</span><span class="s2">"KO"</span><span class="p">,</span><span class="s2">"danger"</span><span class="p">)</span><span class="o">+</span><span class="s2">"</td><td><b>kodi</b></td><td>"</span> <span class="o">+</span> <span class="n">data</span><span class="o">.</span><span class="n">kodi_desc</span> <span class="o">+</span> <span class="s2">"</td><td>"</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">kodi_act</span><span class="p">,</span><span class="s2">"=='(running)'"</span><span class="p">,</span><span class="n">data</span><span class="o">.</span><span class="n">kodi_runtime</span><span class="p">,</span><span class="s2">"default"</span><span class="p">)</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">kodi_act</span><span class="p">,</span><span class="s2">"!='(running)'"</span><span class="p">,</span><span class="s2">"-"</span><span class="p">,</span><span class="s2">"default"</span><span class="p">)</span><span class="o">+</span><span class="s2">"</td></tr><tr><td>"</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">rpimonitor_act</span><span class="p">,</span><span class="s2">"=='(running)'"</span><span class="p">,</span><span class="s2">"OK"</span><span class="p">,</span><span class="s2">"success"</span><span class="p">)</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">rpimonitor_act</span><span class="p">,</span><span class="s2">"!='(running)'"</span><span class="p">,</span><span class="s2">"KO"</span><span class="p">,</span><span class="s2">"danger"</span><span class="p">)</span><span class="o">+</span><span class="s2">"</td><td><b>rpimonitor</b></td><td>"</span> <span class="o">+</span> <span class="n">data</span><span class="o">.</span><span class="n">rpimonitor_desc</span> <span class="o">+</span> <span class="s2">"</td><td>"</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">rpimonitor_act</span><span class="p">,</span><span class="s2">"=='(running)'"</span><span class="p">,</span><span class="n">data</span><span class="o">.</span><span class="n">rpimonitor_runtime</span><span class="p">,</span><span class="s2">"default"</span><span class="p">)</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">rpimonitor_act</span><span class="p">,</span><span class="s2">"!='(running)'"</span><span class="p">,</span><span class="s2">"-"</span><span class="p">,</span><span class="s2">"default"</span><span class="p">)</span><span class="o">+</span><span class="s2">"</td></tr><tr><td>"</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">smbd_act</span><span class="p">,</span><span class="s2">"=='(running)'"</span><span class="p">,</span><span class="s2">"OK"</span><span class="p">,</span><span class="s2">"success"</span><span class="p">)</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">smbd_act</span><span class="p">,</span><span class="s2">"!='(running)'"</span><span class="p">,</span><span class="s2">"KO"</span><span class="p">,</span><span class="s2">"danger"</span><span class="p">)</span><span class="o">+</span><span class="s2">"</td><td><b>smbd</b></td><td>"</span> <span class="o">+</span> <span class="n">data</span><span class="o">.</span><span class="n">smbd_desc</span> <span class="o">+</span> <span class="s2">"</td><td>"</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">smbd_act</span><span class="p">,</span><span class="s2">"=='(running)'"</span><span class="p">,</span><span class="n">data</span><span class="o">.</span><span class="n">smbd_runtime</span><span class="p">,</span><span class="s2">"default"</span><span class="p">)</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">smbd_act</span><span class="p">,</span><span class="s2">"!='(running)'"</span><span class="p">,</span><span class="s2">"-"</span><span class="p">,</span><span class="s2">"default"</span><span class="p">)</span><span class="o">+</span><span class="s2">"</td></tr><tr><td>"</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">sslocal_act</span><span class="p">,</span><span class="s2">"=='(running)'"</span><span class="p">,</span><span class="s2">"OK"</span><span class="p">,</span><span class="s2">"success"</span><span class="p">)</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">sslocal_act</span><span class="p">,</span><span class="s2">"!='(running)'"</span><span class="p">,</span><span class="s2">"KO"</span><span class="p">,</span><span class="s2">"danger"</span><span class="p">)</span><span class="o">+</span><span class="s2">"</td><td><b>sslocal</b></td><td>"</span> <span class="o">+</span> <span class="n">data</span><span class="o">.</span><span class="n">sslocal_desc</span> <span class="o">+</span> <span class="s2">"</td><td>"</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">sslocal_act</span><span class="p">,</span><span class="s2">"=='(running)'"</span><span class="p">,</span><span class="n">data</span><span class="o">.</span><span class="n">sslocal_runtime</span><span class="p">,</span><span class="s2">"default"</span><span class="p">)</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">sslocal_act</span><span class="p">,</span><span class="s2">"!='(running)'"</span><span class="p">,</span><span class="s2">"-"</span><span class="p">,</span><span class="s2">"default"</span><span class="p">)</span><span class="o">+</span><span class="s2">"</td></tr><tr><td>"</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">ssh_act</span><span class="p">,</span><span class="s2">"=='(running)'"</span><span class="p">,</span><span class="s2">"OK"</span><span class="p">,</span><span class="s2">"success"</span><span class="p">)</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">ssh_act</span><span class="p">,</span><span class="s2">"!='(running)'"</span><span class="p">,</span><span class="s2">"KO"</span><span class="p">,</span><span class="s2">"danger"</span><span class="p">)</span><span class="o">+</span><span class="s2">"</td><td><b>SSH</b></td><td>"</span> <span class="o">+</span> <span class="n">data</span><span class="o">.</span><span class="n">ssh_desc</span> <span class="o">+</span> <span class="s2">"</td><td>"</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">ssh_act</span><span class="p">,</span><span class="s2">"=='(running)'"</span><span class="p">,</span><span class="n">data</span><span class="o">.</span><span class="n">ssh_runtime</span><span class="p">,</span><span class="s2">"default"</span><span class="p">)</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">ssh_act</span><span class="p">,</span><span class="s2">"!='(running)'"</span><span class="p">,</span><span class="s2">"-"</span><span class="p">,</span><span class="s2">"default"</span><span class="p">)</span><span class="o">+</span><span class="s2">"</td></tr><tr><td>"</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">xrdp_act</span><span class="p">,</span><span class="s2">"=='(running)'"</span><span class="p">,</span><span class="s2">"OK"</span><span class="p">,</span><span class="s2">"success"</span><span class="p">)</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">xrdp_act</span><span class="p">,</span><span class="s2">"!='(running)'"</span><span class="p">,</span><span class="s2">"KO"</span><span class="p">,</span><span class="s2">"danger"</span><span class="p">)</span><span class="o">+</span><span class="s2">"</td><td><b>xrdp</b></td><td>"</span> <span class="o">+</span> <span class="n">data</span><span class="o">.</span><span class="n">xrdp_desc</span> <span class="o">+</span> <span class="s2">"</td><td>"</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">xrdp_act</span><span class="p">,</span><span class="s2">"=='(running)'"</span><span class="p">,</span><span class="n">data</span><span class="o">.</span><span class="n">xrdp_runtime</span><span class="p">,</span><span class="s2">"default"</span><span class="p">)</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">xrdp_act</span><span class="p">,</span><span class="s2">"!='(running)'"</span><span class="p">,</span><span class="s2">"-"</span><span class="p">,</span><span class="s2">"default"</span><span class="p">)</span><span class="o">+</span><span class="s2">"</td></tr><tr><td>"</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">deluge_daemon_act</span><span class="p">,</span><span class="s2">"=='(running)'"</span><span class="p">,</span><span class="s2">"OK"</span><span class="p">,</span><span class="s2">"success"</span><span class="p">)</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">deluge_daemon_act</span><span class="p">,</span><span class="s2">"!='(running)'"</span><span class="p">,</span><span class="s2">"KO"</span><span class="p">,</span><span class="s2">"danger"</span><span class="p">)</span><span class="o">+</span><span class="s2">"</td><td><b>deluge_daemon</b></td><td>"</span> <span class="o">+</span> <span class="n">data</span><span class="o">.</span><span class="n">deluge_daemon_desc</span> <span class="o">+</span> <span class="s2">"</td><td>"</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">deluge_daemon_act</span><span class="p">,</span><span class="s2">"=='(running)'"</span><span class="p">,</span><span class="n">data</span><span class="o">.</span><span class="n">deluge_daemon_runtime</span><span class="p">,</span><span class="s2">"default"</span><span class="p">)</span><span class="o">+</span><span class="n">Label</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">deluge_daemon_act</span><span class="p">,</span><span class="s2">"!='(running)'"</span><span class="p">,</span><span class="s2">"-"</span><span class="p">,</span><span class="s2">"default"</span><span class="p">)</span><span class="o">+</span><span class="s2">"</td></tr></table>"</span>
</pre></div>
</div>
<p>Here is the result:</p>
<img alt="_images/advancedservices001.png" class="align-center" src="_images/advancedservices001.png" />
</div>
<div class="section" id="monitor-rclone">
<h2>Monitor rclone<a class="headerlink" href="#monitor-rclone" title="Permalink to this headline">¶</a></h2>
<div class="admonition-todo admonition" id="index-0">
<p class="first admonition-title">Todo</p>
<p class="last">write this section</p>
</div>
</div>
<div class="section" id="use-mrtg-with-rpi-monitor-in-read-only-mode">
<h2>Use MRTG with RPi-Monitor in read-only mode<a class="headerlink" href="#use-mrtg-with-rpi-monitor-in-read-only-mode" title="Permalink to this headline">¶</a></h2>
<div class="admonition-todo admonition" id="index-1">
<p class="first admonition-title">Todo</p>
<p class="last">write this section</p>
</div>
</div>
<div class="section" id="monitor-a-tor-relay">
<h2>Monitor a TOR relay<a class="headerlink" href="#monitor-a-tor-relay" title="Permalink to this headline">¶</a></h2>
<p>Here is an example of configuration proposed by Luiz Kill: on <a class="reference external" href="https://github.com/lzkill/tor-info">tor-info</a></p>
<div class="highlight-default"><div class="highlight"><pre><span></span># Tor relay information
# Page: 1
# Information Status Statistics
# - received - yes - yes
# - send - yes - yes
########################################################################
static.100.name=tor_bw_rate1
static.100.source=/usr/local/etc/tor/torrc
static.100.regexp=RelayBandwidthRate\s+(\d+)
static.100.postprocess=$1*-1
static.101.name=tor_bw_burst1
static.101.source=/usr/local/etc/tor/torrc
static.101.regexp=RelayBandwidthBurst\s+(\d+)
static.101.postprocess=$1*-1
static.102.name=tor_bw_rate2
static.102.source=/usr/local/etc/tor/torrc
static.102.regexp=RelayBandwidthRate\s+(\d+)
static.102.postprocess=$1*1
static.103.name=tor_bw_burst2
static.103.source=/usr/local/etc/tor/torrc
static.103.regexp=RelayBandwidthBurst\s+(\d+)
static.103.postprocess=$1*1
static.104.name=tor_nickname
static.104.source=/var/lib/rpimonitor/stat/tor_desc
static.104.regexp=Nickname.(.*)
static.104.postprocess=
static.105.name=tor_fingerprint
static.105.source=/var/lib/rpimonitor/stat/tor_desc
static.105.regexp=Fingerprint.(.*)
static.105.postprocess=
static.106.name=tor_version
static.106.source=/var/lib/rpimonitor/stat/tor_desc
static.106.regexp=Version.(.*)
static.106.postprocess=
static.107.name=tor_address
static.107.source=/var/lib/rpimonitor/stat/tor_desc
static.107.regexp=Address.(.*)
static.107.postprocess=
dynamic.102.name=tor_read
dynamic.102.source=/var/lib/rpimonitor/stat/tor_rx
dynamic.102.regexp=(.*)
dynamic.102.postprocess=$1*-1
dynamic.102.rrd=DERIVE
dynamic.102.max=0
dynamic.103.name=tor_written
dynamic.103.source=/var/lib/rpimonitor/stat/tor_tx
dynamic.103.regexp=(.*)
dynamic.103.postprocess=
dynamic.103.rrd=DERIVE
dynamic.103.min=0
dynamic.104.name=tor_uptime
dynamic.104.source=/var/lib/rpimonitor/stat/tor_desc
dynamic.104.regexp=Uptime.(.*)
dynamic.104.postprocess=$1
dynamic.104.rrd=GAUGE
dynamic.105.name=tor_published
dynamic.105.source=/var/lib/rpimonitor/stat/tor_desc
dynamic.105.regexp=Published.(.*)
dynamic.105.postprocess=
dynamic.105.rrd=
dynamic.106.name=tor_hibernating
dynamic.106.source=/var/lib/rpimonitor/stat/tor_desc
dynamic.106.regexp=Hibernating.(.*)
dynamic.106.postprocess=
dynamic.106.rrd=
dynamic.107.name=tor_observed_bw
dynamic.107.source=/var/lib/rpimonitor/stat/tor_desc
dynamic.107.regexp=Observed_Bandwidth.(.*)
dynamic.107.postprocess=
dynamic.107.rrd=
dynamic.108.name=tor_average_bw
dynamic.108.source=/var/lib/rpimonitor/stat/tor_desc
dynamic.108.regexp=Average_Bandwidth.(.*)
dynamic.108.postprocess=
dynamic.108.rrd=
dynamic.109.name=tor_burst_bw
dynamic.109.source=/var/lib/rpimonitor/stat/tor_desc
dynamic.109.regexp=Burst_Bandwidth.(.*)
dynamic.109.postprocess=
dynamic.109.rrd=
web.statistics.1.content.102.name=Tor - Traffic
web.statistics.1.content.102.graph.1=tor_written
web.statistics.1.content.102.graph.2=tor_read
web.statistics.1.content.102.graph.3=tor_bw_rate1
web.statistics.1.content.102.graph.5=tor_bw_rate2
web.statistics.1.content.102.graph.4=tor_bw_burst1
web.statistics.1.content.102.graph.6=tor_bw_burst2
web.statistics.1.content.102.ds_graph_options.tor_written.label=Written (bytes)
web.statistics.1.content.102.ds_graph_options.tor_written.lines={ fill: true }
web.statistics.1.content.102.ds_graph_options.tor_written.color="#66428A"
web.statistics.1.content.102.ds_graph_options.tor_read.label=Read (bytes)
web.statistics.1.content.102.ds_graph_options.tor_read.lines={ fill: true }
web.statistics.1.content.102.ds_graph_options.tor_read.color="#008937"
web.statistics.1.content.102.ds_graph_options.tor_bw_rate1.label=Read Rate Limit (bytes)
web.statistics.1.content.102.ds_graph_options.tor_bw_rate1.lines={ fill: false }
web.statistics.1.content.102.ds_graph_options.tor_bw_rate1.color="#ffff00"
web.statistics.1.content.102.ds_graph_options.tor_bw_burst1.label=Read Burst Limit (bytes)
web.statistics.1.content.102.ds_graph_options.tor_bw_burst1.lines={ fill: false }
web.statistics.1.content.102.ds_graph_options.tor_bw_burst1.color="#DF0101"
web.statistics.1.content.102.ds_graph_options.tor_bw_rate2.label=Write Rate Limit (bytes)
web.statistics.1.content.102.ds_graph_options.tor_bw_rate2.lines={ fill: false }
web.statistics.1.content.102.ds_graph_options.tor_bw_rate2.color="#ffff00"
web.statistics.1.content.102.ds_graph_options.tor_bw_burst2.label=Write Burst Limit (bytes)
web.statistics.1.content.102.ds_graph_options.tor_bw_burst2.lines={ fill: false }
web.statistics.1.content.102.ds_graph_options.tor_bw_burst2.color="#DF0101"
web.statistics.1.content.102.graph_options.yaxis={ tickFormatter: function (v) { if (Math.abs(v) > 1048576) return (Math.round(v*10/1024/1024)/10) + " MiB/s" ; if (Math.abs(v) > 1024) return (Math.round(v*10/1024)/10) + " KiB/s" ; else return v + " B/s" }, }
web.status.1.content.101.name=Tor
web.status.1.content.101.icon=tor.png
web.status.1.content.101.line.1="Version: <b>" + data.tor_version + "</b>"
web.status.1.content.101.line.2="Nickname: <b>" + data.tor_nickname + "</b> Fingerprint: <b>" + data.tor_fingerprint + "</b>"
web.status.1.content.101.line.3="Address: <b>" + data.tor_address + "</b>"
web.status.1.content.101.line.4="Last published: <b>" + data.tor_published + "</b>"
web.status.1.content.101.line.5="Uptime: <b>" + Uptime(data.tor_uptime) + "</b>"
web.status.1.content.101.line.6="Hibernating: <b>" + data.tor_hibernating + "</b>"
web.status.1.content.101.line.7="Average Bandwidth: <b>" + KMG(data.tor_average_bw) + "/s</b> Burst: <b>" + KMG(data.tor_burst_bw) + "/s</b> Observed: <b>" + KMG(data.tor_observed_bw) + "/s</b>"
web.status.1.content.101.line.8="Written: <b>"+KMG(data.tor_written)+"<i class='icon-arrow-up'></i></b> Read: <b>"+KMG(Math.abs(data.tor_read)) + "<i class='icon-arrow-down'></i></b>"
web.status.1.content.101.line.9="Other: <b><a target=_blank href='https://atlas.torproject.org/#details/" + data.tor_fingerprint + "'>Atlas</a> | <a target=_blank href='https://globe.torproject.org/#/relay/" + data.tor_fingerprint + "'>Globe</a></b>"
</pre></div>
</div>
<p>Here is the result:</p>
<div class="figure align-center">
<a class="reference internal image-reference" href="_images/tor001.png"><img alt="_images/tor001.png" src="_images/tor001.png" style="width: 500px;" /></a>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="32_sensors.html" class="btn btn-neutral float-right" title="Configuration using sensors" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="30_index.html" class="btn btn-neutral" title="Usages" 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>