summaryrefslogtreecommitdiff
path: root/deployment_scripts/puppet/modules/lma_collector/README.md
blob: e7b12d41d881145ca1fdeebaee14ec14b3a42bfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
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
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
# lma_collector

## Overview

The `lma_collector` module lets you use Puppet to configure and deploy
collectors of the LMA (Logging, Monitoring and Alerting) toolchain.

The main components of an LMA collector are:

* [Heka](http://hekad.readthedocs.org). Heka is used to process log,
  notification and metric messages, and persist these messages into
  Elasticsearch and InfluxDB.

* [collectd](http://collectd.org/). collectd is used for collecting
  performance statistics from various sources.

The following versions of Heka and collectd are known to work for LMA:

* Heka v0.10.0 (`heka_0.10.0_amd64.deb`)
* collectd v5.4.0 (`collectd_5.4.0-3ubuntu2_amd64.deb`)

## Usage

### Setup

To install and configure the main components, declare the `lma_collector`
class and `lma_collector::heka` defines:

```puppet
class { 'lma_collector': }

lma_collector::heka { 'log_collector':
  require  => Class['lma_collector'],
}

lma_collector::heka { 'metric_collector':
  require  => Class['lma_collector'],
}
```

This installs Heka and configures it with Heka plugins necessary for LMA.

Here is another example where a custom Heka message field is specified:

```puppet
class {'lma_collector':
  tags => {
    tag_A => 'some value'
  }
}
```

### Collect system logs

To make the Collector collect standard system logs from log files in `/var/log`
declare the `lma_collector::logs::system` class:

```puppet
class { 'lma_collector::logs::system': }
```

### Collect OpenStack logs

To make the collector collect logs created by an OpenStack service declare the
`lma_collector::logs::openstack` define. This is an example for the Nova logs:

```puppet
lma_collector::logs::openstack { 'nova': }
```

This configures Heka to read the Nova logs from the log files located in
`/var/log/nova/`.

For Swift a specific class should be declared. For example:

```puppet
class { 'lma_collector::logs::swift':
  file_match    => 'swift-all\.log$',
}
```

For Keystone, in addition to declaring the `lma_collector::logs::openstack`
define, the `lma_collector::logs::keystone_wsgi` class should be declared
to read Keystone logs stored from Apache log files:

```puppet
class { 'lma_collector::logs::keystone_wsgi': }
```

### Collect libvirt logs

To make the collector collect logs created by libvirt declare the
`lma_collector::logs::libvirt` class:

```puppet
class { 'lma_collector::logs::libvirt': }
```

### Collect MySQL logs

To make the collector collect logs created by MySQL declare the
`lma_collector::logs::mysql` class:

```puppet
class { 'lma_collector::logs::mysql': }
```

### Collect Open vSwitch logs

To make the collector collect logs created by Open vSwitch declare the
`lma_collector::logs::ovs` class:

```puppet
class { 'lma_collector::logs::ovs': }
```

### Collect Pacemaker logs

To make the collector collect logs created by Pacemaker declare the
`lma_collector::logs::pacemaker` class:

```puppet
class { 'lma_collector::logs::pacemaker': }
```

### Collect RabbitMQ logs

To make the collector collect logs created by RabbitMQ declare the
`lma_collector::logs::rabbitmq` class:

```puppet
class { 'lma_collector::logs::rabbitmq': }
```

### Derive HTTP metrics from logs

To make the collector create HTTP metrics from OpenStack log messages that
include HTTP information (method, status, and response time) declare the
`lma_collector::logs::aggregated_http_metrics` class:

```puppet
class { 'lma_collector::logs::aggregated_http_metrics': }
```

### Store logs into Elasticsearch

To make the collector store the collected logs into Elasticsearch declare the
`lma_collector::elasticsearch` class:

```puppet
class { 'lma_collector::elasticsearch':
  server => 'example.com',
}
```

### Collect statistics (a.k.a. metrics)

The `lma_collector::collectd::base` sets up collectd and the communication
channel between collectd and Heka. It also sets up a number of standard collect
plugins.

Usage example:

```puppet
class { 'lma_collector::collectd::base':
  processes       => ['influxdb', 'grafana-server', 'hekad', 'collectd'],
  process_matches => [{name => 'elasticsearch', regex => 'java'}]
  read_threads    => 10,
}
```

### Collect OpenStack statistics

To make the collector collect statistics for an OpenStack service declare
the `lma_collector::collectd::openstack` define:

```puppet
lma_collector::collectd::openstack { 'nova':
  user             => 'user',
  password         => 'password',
  tenant           => 'tenant',
  keystone_url     => 'http://example.com/keystone',
  polling_interval => 60,
  pagination_limit => 500,
}
```

This define can be used for the following OpenStack services: nova, cinder,
glance, keystone, and neutron.

Here is another example for neutron:

```puppet
lma_collector::collectd::openstack { 'neutron':
  user         => 'user',
  password     => 'password',
  tenant       => 'tenant',
  keystone_url => 'http://example.com/keystone',
}
```

### Collect OpenStack service statuses

To make the collector collect statuses of OpenStack services declare the
`lma_collector::collectd::openstack_checks` class:

```puppet
class { 'lma_collector::collectd::openstack_checks':
  user         => 'user',
  password     => 'password',
  tenant       => 'tenant',
  keystone_url => 'http://example.com/keystone',
}
```

### Collectd OpenStack service worker statuses

To make the collector collect statuses of workers of an OpenStack service
declare the `lma_collector::collectd::dbi_services` define:

```puppet
lma_collector::collectd::dbi_services { 'nova':
  dbname          => 'nova',
  username        => 'nova',
  password        => 'nova',
  report_interval => 60,
  downtime_factor => 2,
}
```

This define can be used for the following OpenStack services: nova, cinder and
neutron.

### Collect HAProxy statistics

To make the collector collect statistics for HAProxy declare the
`lma_collector::collectd::haproxy` class:

```puppet
class { 'lma_collector::collectd::haproxy':
 socket      => '/var/lib/haproxy/stats',
 # mapping of proxy names to meaningful names to use in metrics names
 proxy_names => {
   'keystone-1' => 'keystone-public-api',
   'keystone-2' => 'keystone-admin-api',
 },
}
```

### Collect RabbitMQ statistics

To make the collector collect statistics for RabbitMQ declare the
`lma_collector::collectd::rabbitmq` class:

```puppet
class { 'lma_collector::collectd::rabbitmq':
}
```

### Collect Memcached statistics

To make the collector collect statistics for Memcached declare the
`lma_collector::collectd::memcached` class:

```puppet
class {'lma_collector::collectd::memcached':
    host => 'localhost',
}
```

### Collect Apache statistics

To make the collector collect statistics for Apache declare the
`lma_collector::collectd::apache` class:

```puppet
class { 'lma_collector::collectd::apache':
}
```

This will collectd Apache statistics from
`http://127.0.0.1/server-status?auto`.

### Collect Nova Hypervisor statistics

To make the collector collect statistics for the Nova hypervisors declare the
`lma_collector::collectd::hypervisor` class:

```puppet
class { 'lma_collector::collectd::hypervisor':
  user         => 'user',
  password     => 'password',
  tenant       => 'tenant',
  keystone_url => 'http://example.com/keystone',
}
```

### Collect Ceph statistics

To make the collector collect statistics for Ceph declare the
`lma_collector::collectd::ceph_mon` class:

```puppet
class { 'lma_collector::collectd::ceph_mon:
}
```

With this the collector will collect information on the Ceph cluster (health,
monitor count, quorum count, free space, ...) and the placement groups.

### Collect Ceph OSD statistics

To make the collector collect Ceph OSD (Object Storage Daemon) performance
statistics declare the `lma_collector::collectd::ceph_osd` class:

```puppet
class { 'lma_collector::collectd::ceph_osd':
}
```

### Collect Pacemaker statistics

To make the collector collect statistics for Pacemaker declare the
`lma_collector::collectd::pacemaker` class:

```puppet
class { 'lma_collector::collectd::pacemaker':
  resources => ['vip__public', 'vip__management'],
}
```

### Collect MySQL statistics

To make the collector collect statistics for MySQL declare the
`lma_collector::collectd::mysql` class:

```puppet
class { 'lma_collector::collectd::mysql':
  username => 'mysql_username',
  password => 'mysql_password',
}
```

### Collect OpenStack notifications

To make the collector collect notifications emitted by the OpenStack services
declare the `lma_collector::notifications::input` class:

```puppet
class { 'lma_collector::notifications::input':
  topic    => 'lma_notifications',
  host     => '127.0.0.1',
  user     => 'rabbit_user',
  password => 'rabbit_password',
}
```

### Store metrics into InfluxDB

To make the collector store the collected metrics into InfluxDB declare the
`lma_collector::influxdb` class:

```puppet
class { 'lma_collector::influxdb':
  database => 'lma',
  user     => 'lma',
  password => 'secret',
  server   => 'example.com',
}
```

### Send AFD messages to Nagios

To make the collector send AFD messages to Nagios declare the
`lma_collector::afd_nagios` define:

```puppet
lma_collector::afd_nagios { 'node_afds':
  url      => 'http://nagios.example.com/cgi-bin/cmd.cgi',
  user     => 'nagiosadmin',
  password => 'secret',
}
```

### Send GSE messages to Nagios

To make the collector send GSE messages to Nagios declare the
`lma_collector::gse_nagios` define:

```puppet
lma_collector::gse_nagios { 'global_clusters':
  url                       => 'http://nagios.example.com/cgi-bin/cmd.cgi',
  user                      => 'nagiosadmin',
  password                  => 'secret',
  message_type              => 'gse_cluster_metric',
  virtual_hostname          => '00-global_clusters',
  openstack_deployment_name => 'production',
}

```

### Configure the aggregator mode

To make the collector send AFD messages to the aggregator node declare the
`lma_collector::aggregator::client` class:

```puppet
class { 'lma_collector::aggregator::client':
  address => 'aggregator.example.com',
}
```

To make the collector act as an aggregator node for the other collectors
declare the `lma_collector::aggregator::server` class:

```puppet
class { 'lma_collector::aggregator::server':
}
```

## Reference

### Classes

Public Classes:

* [`lma_collector`](#class-lma_collector)
* [`lma_collector::elasticsearch`](#class-lma_collectorelasticsearch)
* [`lma_collector::logs::keystone_wsgi`](#class-lma_collectorlogskeystone_wsgi)
* [`lma_collector::logs::libvirt`](#class-lma_collectorlogslibvirt)
* [`lma_collector::logs::mysql`](#class-lma_collectorlogsmysql)
* [`lma_collector::logs::ovs`](#class-lma_collectorlogsovs)
* [`lma_collector::logs::pacemaker`](#class-lma_collectorlogspacemaker)
* [`lma_collector::logs::rabbitmq`](#class-lma_collectorlogsrabbitmq)
* [`lma_collector::logs::system`](#class-lma_collectorlogssystem)
* [`lma_collector::logs::swift`](#class-lma_collectorlogsswift)
* [`lma_collector::logs::aggregated_http_metrics`](#class-lma_collectorlogsaggregated_http_metrics)
* [`lma_collector::collectd::base`](#class-lma_collectorcollectdbase)
* [`lma_collector::collectd::haproxy`](#class-lma_collectorcollectdhaproxy)
* [`lma_collector::collectd::rabbitmq`](#class-lma_collectorcollectdrabbitmq)
* [`lma_collector::collectd::memcached`](#class-lma_collectorcollectdmemcached)
* [`lma_collector::collectd::openstack_checks`](#class-lma_collectorcollectdopenstack_checks)
* [`lma_collector::collectd::apache`](#class-lma_collectorcollectdapache)
* [`lma_collector::collectd::ceph_mon`](#define-lma_collectorcollectdceph_mon)
* [`lma_collector::collectd::ceph_osd`](#define-lma_collectorcollectdceph_osd)
* [`lma_collector::collectd::hypervisor`](#class-lma_collectorcollectdhypervisor)
* [`lma_collector::collectd::pacemaker`](#class-lma_collectorcollectdpacemaker)
* [`lma_collector::collectd::mysql`](#class-lma_collectorcollectdmysql)
* [`lma_collector::influxdb`](#class-lma_collectorinfluxdb)
* [`lma_collector::notifications::input`](#class-lma_collectornotificationsinput)
* [`lma_collector::notifications::metrics`](#class-lma_collectornotificationsmetrics)
* [`lma_collector::aggregator::client`](#class-lma_collectoraggregatorclient)
* [`lma_collector::aggregator::server`](#class-lma_collectoraggregatorserver)
* [`lma_collector::gse_policies`](#class-lma_collectorgse_policies)
* [`lma_collector::metrics::heka_monitoring`](#class-lma_collectormetricsheka_monitoring)

Private Classes:

* `lma_collector::params`: Provide defaults for the `lma_collector` module
  parameters.

### Defines

* [`lma_collector::heka`](#define-lma_collectorheka)
* [`lma_collector::logs::openstack`](#define-lma_collectorlogsopenstack)
* [`lma_collector::collectd::openstack`](#define-lma_collectorcollectdopenstack)
* [`lma_collector::afd_filter`](#define-lma_collectorafd_filter)
* [`lma_collector::afd_nagios`](#define-lma_collectorafd_nagios)
* [`lma_collector::gse_cluster_filter`](#define-lma_collectorgse_cluster_filter)
* [`lma_collector::gse_nagios`](#define-lma_collectorgse_nagios)

#### Class: `lma_collector`

Install the common Lua modules used by LMA collectors.

##### Parameters

* `tags`: *Optional*. Fields added to Heka messages. Valid options: a hash. Default: `{}`.

#### Class: `lma_collector::elasticsearch`

Declare this class to make Heka serialize the log messages and send them to
Elasticsearch for indexing.

##### Parameters

* `server`: *Required*. Elasticsearch server name. Valid options: a string.
* `port`: *Required*. Elasticsearch service port. Valid options: an integer.
* `flush_interval`: *Optional*. Interval at which accumulated messages should
   be bulk indexed into Elasticsearch, in seconds. Default: `5`.
* `flush_count`: *Optional*. Number of messages that, if processed, will
   trigger them to be bulk indexed into Elasticsearch. Default: `10`.

#### Class: `lma_collector::logs::keystone_wsgi`

Declare this class to create an Heka `logstreamer` that reads Keystone Apache
logs from `/var/log/apache2/keystone_wsgi_*_access.log`.

This class currently assumes the following log configuration in Apache:

```
CustomLog "/var/log/apache2/keystone_wsgi_main_access.log" "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\""
```

for Keystone main and:

```
CustomLog "/var/log/apache2/keystone_wsgi_admin_access.log" "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\""
```

for Keystone admin.

The class correctly configures the Heka `logstreamer` for the case of
sequential rotating log files, i.e. log files with the following structure:

```
/var/log/apache2/keystone_wsgi_*_access.log
/var/log/apache2/keystone_wsgi_*_access.log.1
/var/log/apache2/keystone_wsgi_*_access.log.2
```

#### Class: `lma_collector::logs::libvirt`

Declare this class to create an Heka `logstreamer` that reads libvirt logs
from `/var/log/libvirt/libvirtd.log`.

#### Class: `lma_collector::logs::mysql`

Declare this class to create an Heka `logstreamer` that reads MySQL logs from
`/var/log/mysql.log`.

#### Class: `lma_collector::logs::ovs`

Declare this class to create an Heka `logstreamer` that reads Open vSwitch logs
from log files located in the `/var/log/openvswitch/` directory.

#### Class: `lma_collector::logs::pacemaker`

Declare this class to create an Heka `logstreamer` that reads Pacemaker logs
from `/var/log/pacemaker.log`.

#### Class: `lma_collector::logs::rabbitmq`

Declare this class to create an Heka `logstreamer` that reads RabbitMQ logs
from log files located in the `/var/log/rabbitmq` directory.

#### Class: `lma_collector::logs::system`

Declare this class to create an Heka `logstreamer` that reads system logs.

Logs are read from following files in `/var/log`: `daemon.log`, `cron.log`,
`haproxy.log`, `kern.log`, `auth.log`, `syslog`, `messages` and `debug`. This
class assumes that Rsyslog is used, with the `RSYSLOG_TraditionalFileFormat`
template.

More specifically, the following syslog patterns are assumed:

```
<%PRI%>%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%\n
```

or

```
'%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg%\n'
```

#### Class: `lma_collector::logs::swift`

Declare this class to create an Heka `logstreamer` that reads Swift logs from
a Syslog file.

##### Parameters

* `file_match`: *Required*. The log file name pattern. Example:
  `'swift\.log$'`. Example for a sequential rotating file:
  `'swift\.log\.?(?P<Seq>\d*)$'`. See
  http://hekad.readthedocs.org/en/latest/pluginconfig/logstreamer.html
  for more information.
* `priority`: *Optional*. When using sequential logstreams, the priority
  defines how to sort the log files in order from the slowest to newest.
  Example: `'["^Seq"]'`. See
  http://hekad.readthedocs.org/en/latest/pluginconfig/logstreamer.html
  for more information.
* `log_directory`: *Optional*. The log directory. Default: `/var/log`.

#### Class: `lma_collector::logs::aggregated_http_metrics`

Declare this class to create an Heka filter that derives HTTP metrics from
OpenStack log messages that include HTTP information (method, status and
response time). Response times are aggregated over an interval and the
following statistics are produced: `min`,`max`,`sum`,`count`,`percentile`.

The metric name is `openstack_<service>_http_response_times` where `<service>`
is the OpenStack service name (e.g. "neutron").

##### Parameters

* `hostname`: *Optional*. The hostname. Default: $::hostname factor.
* `interval`: *Optional*. Interval in second used to aggregate metrics. Default: 10.
* `max_timer_inject`: *Optional*. The maximum number of messages allowed to be injected by the sandbox. Default: 10.
* `bulk_size`: *Optional*. The number of metrics embedded by a bulk_metric. Default: 500.
* `percentile`: *Optional*. The percentile. Default: 90.

#### Class: `lma_collector::collectd::base`

Declare this class to set up collectd and the communication channel between
collectd and Heka. The declaration of this class also sets up a number of
standard collectd plugins, namely `logfile`, `cpu`, `disk`, `interface`,
`load`, `memory`, `processes`, `swap`, and `users`.

##### Parameters

* `processes`: *Optional*. The names of processes that the collectd
  `processes` plugin will get statistics for. Valid options: an array of
  strings. Default: `undef`. See
  https://github.com/voxpupuli/puppet-collectd#class-collectdpluginprocesses
  for more information.
* `process_matches`: *Optional*. Name/regex pairs specifying the processes that
  the collectd `processes` plugin will get statistics for. Valid options: an
  array of hashs with two properties, `name` and `regex`. See
  https://github.com/voxpupuli/puppet-collectd#class-collectdpluginprocesses
  for more information.
* `read_threads`: *Optional*. The number of threads used by collectd. Valid
  options: an integer. Default: 5.
* `purge`: *Optional*. Purge the collectd configuration files. Default:
  `false`.

#### Class: `lma_collector::collectd::haproxy`

Declare this class to configure collectd to collect HAProxy statistics. The
collectd plugin used is a Python script.

##### Parameters

* `socket`: *Required*. The path to HAProxy's `stats` Unix socket. E.g.
  `/var/lib/haproxy/stats`. Valid options: a string.
* `proxy_ignore`: *Optional*. The list of proxy names to ignore, i.e. for which
  no metrics will be created. Valid options: an array of strings. Default:
  `[]`.
* `proxy_names`: *Optional*. A mapping of proxy names to meaningful names used
  in metrics names. This is useful when there are meaningless proxy names such
  as "keystone-1" in the HAProxy configuration. Valid options: a hash. Default:
  `{}`.

#### Class: `lma_collector::collectd::rabbitmq`

Declare this class to configure collectd to collect RabbitMQ statistics. The
collectd plugin used is a Python script, which uses the `rabbitmqctl` command
to get statistics from RabbitMQ.

##### Parameters

* `queue`: *Optional*. Collect statistics for specific queue(s), a string that
  starts and ends with a slash is interpreted as a regular expression
  (backslash `\` must be escaped by writing `\\`).
  Valid option: an array of string. Default: `[]`.

#### Class: `lma_collector::collectd::memcached`

Declare this class to configure collectd to collect Memcached statistics.
collectd's native `memcached` plugin is used to collect statistics and a
custom Python plugin is used to check the availability of Memcached server.

##### Parameters

* `host`: *Required*. The Memcached host. Valid options: a string. See
  https://github.com/voxpupuli/puppet-collectd#class-collectdpluginmemcached.
* `Port`: *Optional. The Memcached port. Valid option: an integer.
  Default: `11211`.

#### Class: `lma_collector::collectd::openstack_checks`

Declare this class to configure collectd to collect statuses of OpenStack
services. The collectd plugin used is a Python script.

##### Parameters

* `user`: *Required*. The user to use when querying the OpenStack endpoint.
  Valid options: a string.
* `password`: *Required*. The password to use when querying the OpenStack
  endpoint. Valid options: a string.
* `tenant`: *Required*. The tenant to use when querying the OpenStack endpoint.
  Valid options: a string.
* `keystone_url`: *Required*. The Keystone endpoint URL to use. Valid options:
  a string.
* `timeout`: *Optional*. Timeout in seconds beyond which the collector
  considers that the endpoint doesn't respond. Valid options: an integer.
  Default: 5.
* `pacemaker_master_resource`: *Optional*. Name of the pacemaker resource used
  to determine if the collecting of statistics should be active. This is
  a parameter for advanced users. For this to function the
  [`lma_collector::collectd::pacemaker`](#class-lma_collectorcollectdpacemaker)
  class should be declared, with its `master_resource` parameter set to the
  same value as this parameter. Valid options: a string. Default: `undef`.

#### Class: `lma_collector::collectd::apache`

Declare this class to configure collectd to collect Apache statistics.
collectd's native `apache` plugin is used. The URL used is
`http://${host}/server-status?auto`, where `${host}`  is replaced by the value
provided with the `host` parameter.

##### Parameters

* `host`: *Optional*. The Apache host. Valid options: a string. Default:
  `'127.0.0.1'`.
* `port`: *Optional*. The Apache port. Valid options: a string. Default: `'80'`.

#### Class: `lma_collector::collectd::hypervisor`

Declare this class to configure collectd to collect statistics on Nova
hypervisors. The collectd plugin used is a Python script talking to the
Nova API.

##### Parameters

* `user`: *Required*. The user to use when querying the OpenStack endpoint.
  Valid options: a string.
* `password`: *Required*. The password to use when querying the OpenStack
  endpoint. Valid options: a string.
* `tenant`: *Required*. The tenant to use when querying the OpenStack endpoint.
  Valid options: a string.
* `keystone_url`: *Required*. The Keystone endpoint URL to use. Valid options:
  a string.
* `timeout`: *Optional*. Timeout in seconds beyond which the collector
  considers that the endpoint doesn't respond. Valid options: an integer.
  Default: 5.
* `pacemaker_master_resource`: *Optional*. Name of the pacemaker resource used
  to determine if the collecting of statistics should be active. This is
  a parameter for advanced users. For this to function the
  [`lma_collector::collectd::pacemaker`](#class-lma_collectorcollectdpacemaker)
  class should be declared, with its `master_resource` parameter set to the
  same value as this parameter. Valid options: a string. Default: `undef`.

#### Class: `lma_collector::collectd::pacemaker`

Declare this class to configure collectd to collect statistics for Pacemaker
resources running on the node. The collectd plugin used is a Python script,
which uses Pacemaker's `crm_resource` command to get statistics from Pacemaker.

##### Parameters

* `resources`: *Required*. The Pacemaker resources to get statistics for. Valid
  options: an hash of strings.
* `notify_resource`: *Optional*. If this is set, the collectd plugin generates
  a collectd notification reporting the state of the Pacemaker resource
  identified to by `master_resource`. Users of
  [`lma_collector::collectd::openstack`](#define-lma_collectorcollectdopenstack),
  [`lma_collector::collectd::openstack_checks`](#class-lma_collectorcollectdopenstackchecks) and
  [`lma_collector::collectd::hypervisor`](#class-lma_collectorcollectdhypervisor)
  with the `notify_resource` parameter needs to declare the
  `lma_collector::collectd::pacemaker` class and use that parameter.
  Valid options: a string. Default: `undef`.
* `hostname`: *Optional*. If this is set it will be used to identify the local
  host in the Pacemaker cluster. If unset, collectd will use the value returned
  by the Python socket.getfqdn() function.
  Valid options: a string. Default: `undef`.

#### Class: `lma_collector::collectd::mysql`

Declare this class to configure collectd to collect statistics for the MySQL
instance local to the node.

The collectd plugin used is the native collectd [MySQL
plugin](https://collectd.org/wiki/index.php/Plugin:MySQL). It is configured
with `'localhost'` as the `Host`, meaning that the local MySQL Unix socket will
be used to connect to MySQL.

##### Parameters

* `username`: *Required*. The database user to use to connect to the MySQL
  database. Valid options: a string.
* `password`: *Required*. The database password to use to connect to the MySQL
  database. Valid options: a string.
* `host`: *Optional*. The IP address to use to connect to the MySQL database.
   Valid options: a string. Default: `localhost`.
* `socket`: *Optional*. The Unix socket to use to  connect to the MySQL database.
   Valid options: a string. Default: `undef`.

#### Class: `lma_collector::collectd::ceph_mon`

Declare this class to make collectd collect Ceph statistics.

With this the collector will collect information on the Ceph cluster (health,
monitor count, quorum count, free space, ...) and the Placement Groups.

The collectd plugin used is a Python script. That script uses the `ceph`
command internally. So for this plugin to work the `ceph` command should be
installed, and a valid configuration for accessing the Ceph cluster should be
in place.

#### Class: `lma_collector::collectd::ceph_osd`

Declare this class to make collectd collect Ceph OSD (Object Storage Daemon)
performance statistics of all the OSD daemons running on the host.

The collectd plugin used is a Python script. That script uses the `ceph`
command internally, so that command should be installed.

#### Class: `lma_collector::influxdb`

Declare this class to make Heka serialize the metric messages and send them to
InfluxDB.

##### Parameters

* `database`: *Required*. InfluxDB database. Valid options: a string.
* `user`: *Required*. InfluxDB username. Valid options: a string.
* `password`: *Required*. InfluxDB password. Valid options: a string.
* `server`: *Required*. InfluxDB server name. Valid options: a string.
* `port`: *Required*. InfluxDB service port. Valid options: an integer.
* `tag_fields`: *Optional*. List of message fields to be stored as tags. Valid
  options: an array. Default: `[]`.
* `time_precision`: *Optional*. Time precision. Valid options: a string.
  Default: `ms`.
* `flush_count`: *Optional*. Maximum number of datapoints to send in a single
  write request. Valid values: an integer. Default: `5000`.
* `flush_interval`: *Optional*. Maximum number of seconds to wait before
  writing data to InfluxDB. Valid values: an integer. Default: `5`.

#### Class: `lma_collector::notifications::input`

Declare this class to make Heka collect the notifications emitted by the
OpenStack services on RabbitMQ.

The OpenStack services should be configured to send their notifications to the
same topic exchange as the one this class is configured with.

##### Parameters

* `topic`: *Required*. The topic exchange from where to read the notifications.
  Valid options: a string.
* `host`: *Required*. The address of the RabbitMQ host. Valid options: a
  string.
* `port`: *Optional*. The port the RabbitMQ host listens on. Valid options:
  an integer. Default: `5672`.
* `user`: *Required*. The user to use to connect to RabbitMQ. Valid options: a
  string.
* `password`: *Required*. The password to use to connect to RabbitMQ.  Valid
  options: a string.

#### Class: `lma_collector::notifications::metrics`

Declare this class to make Heka emit metrics from the OpenStack notifications.

#### Class: `lma_collector::aggregator::client`

Declare this class to make Heka send the AFD messages to another Heka node
running the aggregator service.

##### Parameters

* `address`: *Required*. The address of the aggregator server. Valid options: a
  string.
* `port`: *Optional*. The port the aggregator server listens on. Valid options:
  an integer. Default: `5565`.

#### Class: `lma_collector::aggregator::server`

Declare this class to make Heka run the aggregator service.

##### Parameters

* `listen_address`: *Optional*. The address the aggregator service listens on.
  Valid options: a string. Default: `127.0.0.1`.
* `port`: *Optional*. The port the aggregator service listens on. Valid options:
  an integer. Default: `5565`.
* `http_check_port`: *Optional*. The HTTP port that an external service can use
  to check the health of the aggregator service. Valid options: an integer.
  Default: `undef`.

#### Class: `lma_collector::gse_policies`

Declare this class to configure the GSE cluster policies on the aggregator node.

##### Parameters

* `policies`: *Required*. Definition of the GSE cluster policies as described
  in the [Cluster Policies](http://fuel-plugin-lma-collector.readthedocs.org/en/latest/alarms.html#cluster-policies)
  documentation. Valid options: a hash.

#### Class: `lma_collector::metrics::heka_monitoring`

Declare this class to collect metrics for the Heka services themselves.

##### Parameters

* `dashboard_address`: *Optional*. The address Heka dashboards listen on.
  Valid options: a string. Default: `127.0.0.1`.
* `metric_dashboard_port`: *Optional*. The port the Heka dashboard of
  metric collector listens on.
  Valid options: a string. Default: `4353`.
* `log_dashboard_port`: *Optional*. The port the Heka dashboard of
  log collector listens on.
  Valid options: a string. Default: `4352`.

#### Define: `lma_collector::heka`

Main Define. Install and configure the Log and Metric collector.
The title must be either `log_collector` or `metric_collector`.

##### Parameters

* `user`: *Optional*. User the Heka service is run as. You may have to use `'root'` on some systems for the Heka service to be able to access log files, run additional commands, ... Valid options: a string.  Default: `'heka'`.
* `groups`: *Optional*. Additional groups to add to the user running the Heka service. Ignored if the Heka service is run as "root". Valid options: an array of strings. Default: `['syslog', 'adm']`.
* `poolsize`: *Optional*. The pool size of maximum messages that can exist (default: 100).
* `heka_monitoring`: *Optional*. Enable the hekad plugins monitoring by configuring
  the Heka dashboard and a filter plugin. Valid options: boolean. Default: true.
* `install_init_script`: *Optional*. Whether or not install the init script (Upstart or Systemd).
  This is typically used when the service is managed by Pacemaker for example.
  Valid options: boolean. Default: true.
* `version`: *Optional*. The Heka version to install. Default: 'latest'.

#### Define: `lma_collector::logs::openstack`

Declare this type to create an Heka `logstreamer` that reads logs of an
OpenStack service.

It works for "standard" OpenStack services that write their logs into log files
located in `/var/log/{service}`, where `{service}` is the service name.

For example it works for Nova, Neutron, Cinder, Glance, Heat, Keysone, Horizon
and Murano.

The define doesn't work for Swift, as Swift only writes its logs to Syslog.
See the specific [`lma_collector::logs::swift`](#class-lma_collectorlogsswift)
class for Swift.

##### Parameters

* `service_match`: *Optional*. The regular expression portion which matches the
  log file names excluding the suffix `.log`. This is generally used to
  explicitly specify the file name(s) within the directory.
  Valid options: a regexp string supported by the [Go programming
  language](https://golang.org/pkg/regexp/). Default: `.+`.

#### Define: `lma_collector::collectd::openstack`

Declare this define to make collectd collect statistics from an OpenStack
service endpoint.

This define supports the following services: nova, cinder, glance, keystone and
neutron.

The resource title should be set to the service name (e.g. `'nova'`).

##### Parameters

* `user`: *Required*. The user to use when querying the OpenStack endpoint.
  Valid options: a string.
* `password`: *Required*. The password to use when querying the OpenStack
  endpoint. Valid options: a string.
* `tenant`: *Required*. The tenant to use when querying the OpenStack endpoint.
  Valid options: a string.
* `keystone_url`: *Required*. The Keystone endpoint URL to use. Valid options:
  a string.
* `timeout`: *Optional*. Timeout in seconds beyond which the collector
  considers that the endpoint doesn't respond. Valid options: an integer.
  Default: 20.
* `max_retries`: *Optional*. Number of maximum retries when an error occurs
  (including timeout). Valid options: an integer.
  Default: 2.
* `pacemaker_master_resource`: *Optional*. Name of the pacemaker resource used
  to determine if the collecting of statistics should be active. This is
  a parameter for advanced users. For this to function the
  [`lma_collector::collectd::pacemaker`](#class-lma_collectorcollectdpacemaker)
  class should be declared, with its `master_resource` parameter set to the
  same value as this parameter. Valid options: a string. Default: `undef`.
* `polling_interval`: *Optional*. The interval used to poll the resources.
* `pagination_limit`: *Optional*. The number of resource returned by request.

#### Define `lma_collector::collectd::dbi_services`

Declare this define to make collectd collect the statuses (`up`, `down` or
`disabled`) of the various workers of an OpenStack service.

The collectd plugin used is DBI, which is a native collectd plugin. That plugin
uses SQL queries to the MySQL database.

This define supports the following services: nova, cinder, and neutron.

The resource title should be set to the service name (e.g. `'nova'`).

##### Parameters

* `dbname`: *Required*. The database name. Valid options: a string.
* `username`: *Required*. The database user. Valid options: a string.
* `password`: *Required*. The database password. Valid options: a string.
* `hostname`: *Optional*. The database hostname. Valid options: a string.
  Default: `'localhost'`.
* `report_interval`: *Required*. The report interval in seconds used in the
  service configuration. For example Nova's current default value is 10.
  Valid options: an integer.
* `downtime_factor`: *Required*. The downtime factor used to determine when
  consider a worker is down. A service is deemed "down" if no heartbeat has
  been received since `downtime_factor * report_interval` seconds. Valid
  options: an integer.

#### Define `lma_collector::afd_filter`

Declare this define to configure an [Anomaly and Fault Detection
filter](http://fuel-plugin-lma-collector.readthedocs.org/en/latest/alarms.html)
in Heka.

##### Parameters

* `type`: *Required*. Type of the AFD filter. Valid options: either `service`
  for service AFD filters or `node` for node AFD filters.
* `cluster_name`: *Required*. Value of the `service` field (for service AFD
  filters) or `node_role` (for node AFD filters) for the messages emitted by
  the filter. Valid options: a string.
* `logical_name`: *Required*. Value of the `source` field for the messages
  emitted by the filter. Valid options: a string.
* `alarms`: *Required*. List of alarm rules enabled for this filter. Valid
  options: an array.
* `alarms_definitions`: *Required*. List of the alarm rules definitions. Valid
  options: an array.
* `message_matcher`: *Required*. Message matcher for the Heka filter. Valid
  options: a string.

#### Define `lma_collector::afd_nagios`

Declare this define to send [Anomaly and Fault Detection messages](
http://fuel-plugin-lma-collector.readthedocs.org/en/latest/alarms.html)
to Nagios as [passive check
results](https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/passivechecks.html).

##### Parameters

* `url`: *Required*. URL to the Nagios cgi.bin script. Valid options: a
  string.
* `user`: *Optional*. Username used to authenticate to the Nagios web
  interface. Valid options: a string. Default: `nagiosadmin`.
* `password`: *Optional*. Password used to authenticate to the Nagios web
  interface. Valid options: a string. Default: empty string.
* `hostname`: *Optional*. It must match the hostname configured in Nagios.
  Valid options: a string. Default: `$::hostname`.
* `service_template`: *Optional*. It must match the service description
  configured in Nagios. Supports interpolation of message field values. Valid
  options: a string. Default: `%{node_role}.%{source}`.
* `message_type`: *Optional*. Type of AFD messages to send to Nagios. Valid
  options: a string. Default: `afd_node_metric`.

#### Define `lma_collector::gse_cluster_filter`

Declare this define to configure an [Global Status Evaluation filter](
http://fuel-plugin-lma-collector.readthedocs.org/en/latest/alarms.html)
in Heka.

##### Parameters

* `input_message_types`: *Required*. Message types that the GSE filter should
  process. Valid options: an array.
* `aggregator_flag`: *Required*. Whether or not the GSE filter receives messages
  emitted by the collectors or the aggregator itself. Valid options: a boolean.
* `member_field`: *Required*. Field in the input messages used by the GSE filter
  to identify the cluster members. Valid options: a string.
* `output_message_type`: *Required*. Type of messages emitted by the GSE
  filter. Valid options: a string.
* `output_metric_name`: *Required*. Metric name for the messages emitted by the
  GSE filter. Valid options: a string.
* `interval`: *Optional*. Interval (in seconds) at which the GSE filter emits
  its metric messages. Valid options: an integer. Default: 10.
* `cluster_field`: *Optional*. Field in the input message used by the GSE
  filter to associate the AFD/GSE metrics to the clusters. Valid options: a
  string. Default: undef.
* `clusters`: *Optional*. List of clusters that the plugin manages. See the [GSE
  configuration](http://fuel-plugin-lma-collector.readthedocs.org/en/latest/alarms.html)
  documentation for details. Valid options: a hash. Default: {}.
* `warm_up_period`: *Optional*. Number of seconds after a (re)start that the
  GSE plugin will wait before emitting its metric messages. Valid options: an
  integer. Default: undef.
* `alerting`: *Optional*. Whether or not the alerting is disabled or enabled
  with or without notifications.
  Valid options: one of the string 'disabled', 'enabled' or 'enabled_with_notification'.
  Default: 'enabled_with_notification'.

#### Define `lma_collector::gse_nagios`

Declare this define to send [Global Status Evaluation messages](
http://fuel-plugin-lma-collector.readthedocs.org/en/latest/alarms.html)
to Nagios as [passive check
results](https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/3/en/passivechecks.html).

##### Parameters

* `url`: *Required*. URL to the Nagios cgi.bin script. Valid options: a
  string.
* `user`: *Optional*. Username used to authenticate to the Nagios web
  interface. Valid options: a string. Default: `nagiosadmin`.
* `password`: *Optional*. Password used to authenticate to the Nagios web
  interface. Valid options: a string. Default: empty string.
* `service_template`: *Optional*. It must match the service description
  configured in Nagios. Supports interpolation of message field values. Valid
  options: a string. Default: `%{cluster_name}`.
* `message_type`: *Required*. Type of GSE messages to send to Nagios. Valid
  options: a string.
* `virtual_hostname`: *Required*. The host configured in Nagios to receive the
  GSE checks must be named "${virtual_hostname}-env${openstack_deployment_name}".
  Valid options: a string.
* `openstack_deployment_name`: *Optional*. Additional label to identify the
  environment.  Valid options: a string. Default: empty string.

Limitations
-----------


License
-------

Licensed under the terms of the Apache License, version 2.0.

Contact
-------

Simon Pasquier, <spasquier@mirantis.com>

Support
-------

See the Contact section.