]> granicus.if.org Git - icinga2/blob - lib/perfdata/influxdbwriter.ti
Merge pull request #7527 from Icinga/bugfix/checkable-command-endpoint-zone
[icinga2] / lib / perfdata / influxdbwriter.ti
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #include "base/configobject.hpp"
4
5 library perfdata;
6
7 namespace icinga
8 {
9
10 class InfluxdbWriter : ConfigObject
11 {
12         activation_priority 100;
13
14         [config, required] String host {
15                 default {{{ return "127.0.0.1"; }}}
16         };
17         [config, required] String port {
18                 default {{{ return "8086"; }}}
19         };
20         [config, required] String database {
21                 default {{{ return "icinga2"; }}}
22         };
23         [config] String username {
24                 default {{{ return ""; }}}
25         };
26         [config, no_user_view] String password {
27                 default {{{ return ""; }}}
28         };
29         [config] bool ssl_enable {
30                 default {{{ return false; }}}
31         };
32         [config] String ssl_ca_cert {
33                 default {{{ return ""; }}}
34         };
35         [config] String ssl_cert {
36                 default {{{ return ""; }}}
37         };
38         [config] String ssl_key{
39                 default {{{ return ""; }}}
40         };
41         [config, required] Dictionary::Ptr host_template {
42                 default {{{
43                         return new Dictionary({
44                                 { "measurement", "$host.check_command$" },
45                                 { "tags", new Dictionary({
46                                         { "hostname", "$host.name$" }
47                                 }) }
48                         });
49                 }}}
50         };
51         [config, required] Dictionary::Ptr service_template {
52                 default {{{
53                         return new Dictionary({
54                                 { "measurement", "$service.check_command$" },
55                                 { "tags", new Dictionary({
56                                         { "hostname", "$host.name$" },
57                                         { "service", "$service.name$" }
58                                 }) }
59                         });
60                 }}}
61         };
62         [config] bool enable_send_thresholds {
63                 default {{{ return false; }}}
64         };
65         [config] bool enable_send_metadata {
66                 default {{{ return false; }}}
67         };
68         [config] int flush_interval {
69                 default {{{ return 10; }}}
70         };
71         [config] int flush_threshold {
72                 default {{{ return 1024; }}}
73         };
74         [config] bool enable_ha {
75                 default {{{ return false; }}}
76         };
77 };
78
79 validator InfluxdbWriter {
80         Dictionary host_template {
81                 required measurement;
82                 String measurement;
83                 Dictionary "tags" {
84                         String "*";
85                 };
86         };
87         Dictionary service_template {
88                 required measurement;
89                 String measurement;
90                 Dictionary "tags" {
91                         String "*";
92                 };
93         };
94 };
95
96 }