-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCollectLogs-RRD
542 lines (430 loc) · 22.2 KB
/
CollectLogs-RRD
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
Cross compiling collectd-5.8.0 and installing it on Lotus target board running Oreo.
Cross compiling collectd and rrdtool
Pre-requisistes
1. Ubuntu 14.04 or later
2. Toolchain ‘toolchain_latest_PPD.tar’ from https://ge.ent.box.com/folder/48341112802
3. collectd-5.8.0.tar.bz2 source code from https://collectd.org/
4. rrdtool-1.5.6.tar.gz source code from https://oss.oetiker.ch/rrdtool/pub/?M=D
Cross compiling steps: Collectd
1. cd /home/gdcuser/pratheesh/collectdport/crossbuild/
2. Copy collectd-5.8.0.tar.bz2 to this folder.
3. Unzip collectd-5.8.0.tar.bz2 (tar xjvf collectd-5.8.0.tar.bz2)
4. cd /home/gdcuser/pratheesh/collectdport/toolchain
5. Copy toolchain_latest_PPD.tar to this folder
6. Unzip toolchain_latest_PPD.tar (tar xvf toolchain_latest_PPD.tar)
7. Export below environment variables.
• export SYSROOT=/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon
• export CC="/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/x86_64-linux/usr/bin/arm-helix-linux-gnueabi/arm-helix-linux-gnueabi-gcc-6.2.0 -march=armv7-a -mfloat-abi=hard --sysroot=$SYSROOT"
• export CXX="/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/x86_64-linux/usr/bin/arm-helix-linux-gnueabi/arm-helix-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=hard --sysroot=$SYSROOT"
• export CFLAGS="--sysroot=$SYSROOT"
• export LDFLAGS="-L/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib --sysroot=$SYSROOT"
• export CPPFLAGS="-I/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/include"
• export PATH=/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/x86_64-linux/usr/bin/arm-helix-linux-gnueabi/:$PATH
8. ./configure --host=arm-helix-linux-gnueabi --with-fp-layout=nothing --prefix=/home/gdcuser/pratheesh/collectdport/crossbuild/install_dir
9. make
10. make install
Errors:
1. Below error message displayed when executing “./configure --host=arm-helix-linux-gnueabi --prefix=/home/gdcuser/pratheesh/collectdport/crossbuild/install_dir”
Error message:
checking if doubles are stored in x86 representation... configure: error: in `/home/gdcuser/pratheesh/collectdport/crossbuild/collectd-5.8.0': configure: error: cannot run test program while cross compiling.
Solution:
Add the option --with-fp-layout=nothing.
2. Below error message displayed when executing “make”.
Error message:
CCLD libcollectdclient.la
libtool: link: warning: library `/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib/libgcrypt.la' was moved.
/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/x86_64-linux/usr/bin/arm-helix-linux-gnueabi/../../libexec/arm-helix-linux-gnueabi/gcc/arm-helix-linux-gnueabi/6.2.0/ld: warning: library search path "/lib/x86_64-linux-gnu" is unsafe for cross-compilation
/bin/sed: can't read /usr/lib/libgpg-error.la: No such file or directory
libtool: link: `=/usr/lib/libgpg-error.la' is not a valid libtool archive
Solution: The dependency_libs will be hard coded as /usr/lib/ for libgpg-error.la in /home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib/libgcrypt.la. Replace it with the path, /home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib.
3. Below error message displayed when executing “make”.
Error message:
/usr/lib/librrd.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
make[1]: *** [rrdcached.la] Error 1
Solution:
Replace /usr/lib' in /home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib/librrd.la
# Directory that this library needs to be installed in:
#libdir='/usr/lib'
libdir='/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib'
4. Below error message displayed when executing “make”.
Error message:
CCLD rrdcached.la
libtool: link: warning: library `/home/gdcuser/pratheesh/collectd/toolchain/sysroots/csmon/usr/lib/librrd.la' was moved.
/bin/sed: can't read /usr/lib/libpng.la: No such file or directory
libtool: link: `=/usr/lib/libpng.la' is not a valid libtool archive
make[1]: *** [rrdcached.la] Error 1
make[1]: Leaving directory `/home/gdcuser/pratheesh/collectd/cross-build/may_30/collectd-5.8.0'
make: *** [all] Error 2
Solution: The dependency_libs will be hard coded as /usr/lib/ for all *.la files in /home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib/librrd.la. Replace it with the path, /home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib.
Cross compiling steps: rrdtool
1. cd /home/gdcuser/pratheesh/collectdport/crossbuild/
2. Copy rrdtool-1.5.6.tar.gz to this folder.
3. Unzip rrdtool-1.5.6.tar.gz (tar xzvf rrdtool-1.5.6.tar.gz)
4. cd /home/gdcuser/pratheesh/collectdport/toolchain/
5. Copy toolchain_latest_PPD.tar to this folder
6. Unzip toolchain_latest_PPD.tar (tar xvf toolchain_latest_PPD.tar)
7. Export below environment variables.
• export SYSROOT=/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon
• export CC="/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/x86_64-linux/usr/bin/arm-helix-linux-gnueabi/arm-helix-linux-gnueabi-gcc-6.2.0 -march=armv7-a -mfloat-abi=hard --sysroot=$SYSROOT"
• export CXX="/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/x86_64-linux/usr/bin/arm-helix-linux-gnueabi/arm-helix-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=hard --sysroot=$SYSROOT"
• export CFLAGS="--sysroot=$SYSROOT"
• export LDFLAGS="-L/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib --sysroot=$SYSROOT"
• export CPPFLAGS="-I/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/include"
• export PATH=/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/x86_64-linux/usr/bin/arm-helix-linux-gnueabi/:$PATH
8. cd /home/gdcuser/pratheesh/collectdport/crossbuild/rrdtool-1.5.6
9. ./configure --host=arm-helix-linux-gnueabi --prefix=/home/gdcuser/pratheesh/collectdport/crossbuild/rrdtool_install_dir
10. Make
11. make install
Errors:
1. Below error message displayed when executing “make”.
Error message:
libtool: link: warning: library `/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib/libglib-2.0.la' was moved.
arm-helix-linux-gnueabi-ar: `u' modifier ignored since `D' is the default (see `U')
CCLD librrd.la
libtool: link: warning: library `/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib/libpcre.la' was moved.
libtool: link: warning: library `/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib/libpng.la' was moved.
libtool: link: warning: library `/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib/libpangocairo-1.0.la' was moved.
libtool: link: warning: library `/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib/libpango-1.0.la' was moved.
libtool: link: warning: library `/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib/libcairo.la' was moved.
libtool: link: warning: library `/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib/libgobject-2.0.la' was moved.
libtool: link: warning: library `/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib/libglib-2.0.la' was moved.
libtool: link: warning: library `/home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib/libxml2.la' was moved.
Solution: The dependency_libs will be hard coded as /usr/lib/ for all *.la files in /home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib/libglib-2.0.la. Replace it with the path, /home/gdcuser/pratheesh/collectdport/toolchain/sysroots/csmon/usr/lib/.
Do the same for libpangocairo-1.0.la, libpango-1.0.la, libcairo.la, libgobject-2.0.la.
Running collectd and rrdtool on Lotus board.
Pre-requisites:
1. Lotus board running Oreo + libc libraries.
/data/local/collectd/localhost/cpu-0/
/data/local/collectd/localhost/cpu-1/
Installation steps:
1. Set date and timezone
• date -D SET 070210302018.00 (MMDDHHMMYYYY.SS)
2. Run collectd daemon with the configuration file provided from GEHC.
• /lib/ld-linux-armhf.so.3 --library-path /lib /bin/collectd -C /etc/lotus/collectd/collectd_from_GE.conf
3. Below logs shall be displayed on the Terminal and in syslog.
• plugin_load: plugin "syslog" successfully loaded.
• plugin_load: plugin "rrdtool" successfully loaded.
• plugin_load: plugin "cpu" successfully loaded.
• plugin_load: plugin "load" successfully loaded.
• plugin_load: plugin "memory" successfully loaded.
• pugin_load: plugin "processes" successfully loaded.
• plugin_load: plugin "uptime" successfully loaded.
• Initialization complete, entering read-loop.
4. The RRD files shall be generated in /data/local/collectd folder.
5. Step to convert RRD file in Lotus board to XML file
• /lib/ld-linux-armhf.so.3 --library-path /lib /bin/rrdtool dump /data/local/collectd/localhost/memory/memory-buffered.rrd > memory-buffered.xml
Installation steps of Grafana and dependent packages
Pre-requisites:
1. Ubuntu 14.04 or later
2. grafana_5.1.3_amd64.deb from http://docs.grafana.org/installation/debian/
3. go1.10.3.linux-amd64.tar.gz from https://golang.org/dl/
4. librrd-dev (rrdtool)
5. grafana-rrd-server_linux_amd64.gz from https://github.com/doublemarket/grafana-rrd-server/releases/tag/v0.0.5
6. simple-json-datasource from https://github.com/grafana/simple-json-datasource
Installation steps:
1. Download grafana_5.1.3_amd64.deb from http://docs.grafana.org/installation/debian/ and follow the installation steps from this folder to install grafana.
2. Download go1.10.3.linux-amd64.tar.gz from https://golang.org/dl/
3. Extract go1.10.3.linux-amd64.tar.gz (tar xzvf go1.10.3.linux-amd64.tar.gz)
4. Export GOROOT=<path to go1.10.3.linux>
5. Export PATH=$PATH:$GOROOT/bin
6. sudo apt-get install librrd-dev
7. cd /usr/lib/
8. Create a symlink between librrd.so.* & librrd.so.8 (sudo ln -s librrd.so.4.2.0 librrd.so.8)
9. cd ~
10. Download grafana-rrd-server_linux_amd64.gz from https://github.com/doublemarket/grafana-rrd-server/releases/tag/v0.0.5
11. Extract grafana-rrd-server_linux_amd64.gz (tar xvf grafana-rrd-server_linux_amd64.gz)
12. git clone https://github.com/grafana/simple-json-datasource
13. cp -r simple-json-datasource/dist /usr/share/grafana/public/app/plugins/datasource
14. cd /usr/local/share/grafana/public/app/plugins/datasource
15. mv dist grafana-simple-json-datasource
Steps for running grafana and plotting graph of RRD files
1. In target board convert all the RRD files to XML format
• /lib/ld-linux-armhf.so.3 --library-path /lib /bin/rrdtool dump filename.rrd > filename.xml
2. Copy all these xml files to /data/local/collectd/xml_files/
3. Copy all the xml files from the target board to Linux PC using adb pull command.
• adb pull /data/local/collectd/xml_files/ /home/gdcuser/pratheesh/collectdport/rrd_files/
4. cd /home/gdcuser/pratheesh/collectdport/rrd_files
5. Convert the all XML files back to RRD files (in order to solve the architecture specific dependency).
• rrdtool restore –f filename.xml filename.rrd
6. Run grafana and grafana-rrd-server
• sudo service grafana-server start
• ./grafana-rrd-server_linux_amd64 –p 9000 –i “127.0.0.1” –r “/home/gdcuser/pratheesh/collectdport/rrd_files”
7. Open garfana web application by typing http://127.0.0.1:3000 in a web browser
8. Username: admin Password: admin
9. Create a new data source with SimpleJason. (refer http://docs.grafana.org/features/datasources/)
• Give the name as collectd-ds
• Select the type as SimpleJason
• Give the url as http://127.0.0.1:9000
10. Save this data source
11. Create a new dashboard for plotting the graph of RRD files of cpu, memory, load, etc. (Refer http://docs.grafana.org/guides/getting_started/). In metrics tab,
• Select the data source collectd-ds
• Using ‘add query’ add the required RRD files to be plotted.
12. Save all these dash boards
13. The graph of all the RRD files can be viewed by clicking the dashboards and selecting the time frame and refreshing it. The graph can be plotted w.r.to. time, histogram, bars etc.
References:
1. https://collectd.org/
2. https://grafana.com/
3. http://docs.grafana.org/guides/getting_started/
4. https://github.com/doublemarket/grafana-rrd-server
5. https://qiita.com/atfujiwara/items/58cda0dbe44b1e03ac7f
6. https://golang.org/doc/install
7. https://www.safaribooksonline.com/library/view/learning-apache-apex/9781788296403/e3c0e200-393a-4bc5-a8bf-8cbc20bf81de.xhtml
8. https://github.com/doublemarket/grafana-rrd-server/issues/44
1. Step to run collectd on Lotus board
a. Set the date (date -D SET MMDDHHMMYYYY.SS) and timezone.
b. /lib/ld-linux-armhf.so.3 --library-path /lib /bin/collectd -C /etc/lotus/collectd/collectd_from_GE.conf
2. Step to convert RRD file in Lotus board to XML file (to be executed on Lotus board)
a. /data/local/tmp/rrdtool dump filename.rrd > filename.xml
b. eg: /lib/ld-linux-armhf.so.3 --library-path /lib /bin/rrdtool dump /data/local/collectd/localhost/memory/memory-buffered.rrd > memory-buffered.xml
3. Step to restore the RRD file (to be executed on x86 PC)
a. rrdtool restore –f filename.xml filename.rrd
/lib/ld-linux-armhf.so.3 --library-path /lib /bin/collectd -C /etc/lotus/collectd/collectd_from_GE.conf
#
# Config file for collectd(1).
# Please read collectd.conf(5) for a list of options.
# http://collectd.org/
#
##############################################################################
# Global #
#----------------------------------------------------------------------------#
# Global settings for the daemon. #
##############################################################################
Hostname "localhost"
FQDNLookup false
BaseDir "/data/local/collectd"
PIDFile "/data/local/collectd/collectd.pid"
PluginDir "/vendor/bin/pdm/lib"
TypesDB "/etc/lotus/collectd/types.db"
##############################################################################
# Logging #
#----------------------------------------------------------------------------#
# Plugins which provide logging functions should be loaded first, so log #
# messages generated when loading or configuring other plugins can be #
# accessed. #
##############################################################################
LoadPlugin syslog
##############################################################################
# LoadPlugin section #
#----------------------------------------------------------------------------#
# Lines beginning with a single `#' belong to plugins which have been built #
# but are disabled by default. #
# #
# Lines begnning with `##' belong to plugins which have not been built due #
# to missing dependencies or because they have been deactivated explicitly. #
##############################################################################
# Write statistics to RRD files.
LoadPlugin rrdtool
LoadPlugin write_graphite
<Plugin write_graphite>
<Node "graphite">
Host "10.177.220.248"
Port "2003"
Protocol "tcp"
LogSendErrors true
Prefix "collectd."
</Node>
</Plugin>
#
# Intervals are as follows:
#
# 20s - for faster changing/important info where we want to map so
# a small time window
#
# 600s - generally for incrementing counts or 'infrequent' events
# so that we don't oversample.
#
<LoadPlugin cpu>
Interval 10
</LoadPlugin>
<LoadPlugin load>
Interval 10
</LoadPlugin>
<LoadPlugin memory>
Interval 10
</LoadPlugin>
<LoadPlugin processes>
Interval 10
</LoadPlugin>
<LoadPlugin uptime>
Interval 10
</LoadPlugin>
## Plugin configuration
<Plugin cpu>
ReportByState =false
ReportByCpu = false
ValuesPercentage = true
</Plugin>
<Plugin "rrdtool">
CacheTimeout 1200
CacheFlush 1200
</Plugin>
<Plugin "processes">
ProcessMatch "system_server" "system_server"
ProcessMatch "surfaceflinger" "surfaceflinger"
ProcessMatch "emerald_acq" "emerald_acq"
ProcessMatch "monitoring" "monitoring"
ProcessMatch "ext.services" "ext.services"
ProcessMatch "android.process.media" "android.process.media"
ProcessMatch "system:ui" "system:ui"
ProcessMatch "android.hardware.sensors" "android.hardware.sensors"
ProcessMatch "precompliance" "compliance"
</Plugin>
Adding Steps for graphite:
Install Graphite and its dependencies:
-------------------------------------
sudo apt-get update
sudo apt-get install graphite-web graphite-carbon grafana
sudo apt-get install postgresql libpq-dev python-psycopg2
sudo apt-get install apache2 libapache2-mod-wsgi
sudo apt-get install collectd collectd-utils
Switch to postgres user and create the DB user graphite:
-------------------------------------------------------
sudo -u postgres psql
CREATE USER graphite WITH PASSWORD 'graphite_password';
CREATE DATABASE graphite WITH OWNER graphite;
\q
Configure Graphite:
-------------------------
Open /etc/graphite/local_settings.py
Do below modifications,
SECRET_KEY = 'a_salty_string'
TIME_ZONE = 'Asia/Kolkata'
DATABASES = {
'default': {
'NAME': 'graphite',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'graphite',
'PASSWORD': 'graphite_password',
'HOST': '127.0.0.1',
'PORT': ''
}
}
Sync the Database:
-----------------------
sudo graphite-manage syncdb
Configure Carbon and start it:
------------------------------
sudo vi /etc/default/graphite-carbon
CARBON_CACHE_ENABLED=true
sudo vi /etc/carbon/carbon.conf
ENABLE_LOGROTATION = True
Setting the Storage Schema and Aggregation:
Copy default storage aggregation file to carbon directory:
sudo cp /usr/share/doc/graphite-carbon/examples/storage-aggregation.conf.example /etc/carbon/storage-aggregation.conf
sudo vi /etc/carbon/storage-schemas.conf
[collectd]
pattern = ^collectd.*
retentions = 10s:1d,1m:7d,10m:1y
save the file and start carbon-cache daemon:
sudo service carbon-cache start
Install and configure Apache + wsgi:
---------------------------------------
sudo apt-get install apache2 libapache2-mod-wsgi
sudo a2dissite 000-default
sudo cp /usr/share/graphite-web/apache2-graphite.conf /etc/apache2/sites-available
sudo a2ensite apache2-graphite
sudo service apache2 reload
# Check the status at http://domain_name_or_IP/server-status
We can now access Graphite interface by browsing to http://your_ip_address.
Configure Collectd
--------------------------
/etc/collectd/collectd.conf
LoadPlugin syslog
LoadPlugin write_graphite
<Plugin syslog>
LogLevel info
</Plugin>
<Plugin write_graphite>
<Node "graphing">
Host "localhost"
Port "2003"
Protocol "tcp"
LogSendErrors true
Prefix "collectd."
</Node>
</Plugin>
Configure grafana:
--------------------
sudo vi /etc/grafana/grafana.ini
[database]
# Either "mysql", "postgres" or "sqlite3", it's your choice
type = postgres
host = 127.0.0.1:5432
name = graphite
user = graphite
password = graphite_password
start Carbon :
--------------
sudo service carbon-cache start
start apache :
--------------
sudo service apache2 reload
start collectd :
--------------
sudo service collectd restart
start grafana:
---------------
sudo service grafana-server start
Chnages required in collectd.conf in Lotus board:
----------------------------------------------------
LoadPlugin write_graphite
<Plugin write_graphite>
<Node "graphite">
Host "10.197.74.139"
Port "2003"
Protocol "tcp"
LogSendErrors true
Prefix "collectd."
</Node>
</Plugin>
Reference:
------------
https://community.rackspace.com/products/f/public-cloud-forum/6800/how-to-set-up-monitoring-stack-using-collectd-graphite-grafana-and-seyren-on-ubuntu-14-04
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-graphite-on-an-ubuntu-14-04-server
http://graphite.readthedocs.io/en/latest/install.html
Steps that are not included in our installation are given below:
====================================================================
Configure Carbon:
-------------------
Main configuration file is /etc/carbon/carbon.conf. We would need to edit it to configure carbon to listen on isolated network interface 192.168.3.12:
sudo sed -i.bak s/0.0.0.0/192.168.3.12/g /etc/carbon/carbon.conf
Install and configure Grafana:
-------------------------------
Add the following line to your /etc/apt/sources.list file.
deb https://packagecloud.io/grafana/stable/debian/ wheezy main
Add the Package Cloud key to be able to install signed packages:
curl https://packagecloud.io/gpg.key | sudo apt-key add -
Update your Apt repositories and install Grafana:
sudo apt-get update
sudo apt-get install grafana
You can configure to listen on any port, but we will show how to use SSL and configure Grafana to listen on port 443:
cd /etc/grafana
sudo openssl req -x509 -newkey rsa:2048 -keyout cert.key -out cert.pem -days 3650 -nodes
Edit file /etc/grafana/grafana.ini and set the following:
# https certs & key file
cert_file = /etc/grafana/cert.pem
cert_key = /etc/grafana/cert.key
protocol = https
http_port = 443
Set grafana to be able to run on any port:
sudo setcap 'cap_net_bind_service=+ep' /usr/sbin/grafana-server
Configure Grafana server to start on boot:
sudo update-rc.d grafana-server defaults 95 10
Install and configure Seyren:
-----------------------------
Seyren not installed.
adb shell su
setprop persist.sys.timezone "Asia/Kolkata"
/lib/ld-linux-armhf.so.3 --library-path /lib /bin/collectd -C /data/local/collectd_graphite.conf
mount -o rw,remount /vendor
cp /sdcard/write_graphite.so /data/local/
cp /sdcard/write_graphite.so /vendor/bin/pdm/lib/
cp /sdcard/collectd_graphite_10sec.conf /data/local/collectd_graphite.conf
chmod 755 /data/local/collectd_graphite.conf
chmod 755 /bin/collectd
/lib/ld-linux-armhf.so.3 --library-path /lib /bin/collectd -C /data/local/collectd_graphite.conf
-- to Collect Data from Server
curl -X POST http://admin:[email protected]:3000/api/annotations -H "Content-Type: application/json" -d '{"dashboardId":3,"panelId":1,"time":1533551294000000,"isRegion":true,"timeEnd":1533551294200000,"tags":["Oreo_95_LSD"],"text":"Test Annotation from cURL"}'