Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-core / stx-monitoring / collectd-extensions.inc
1 #
2 ## Copyright (C) 2019 Wind River Systems, Inc.
3 #
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #      http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License.
15
16 PACKAGES += " collectd-extensions"
17
18 RDEPENDS_collectd-extensions += " \
19         systemd \
20         collectd \
21         fm-api \
22         python-influxdb \
23         python-oslo.concurrency \
24         python-httplib2 \
25         tsconfig \
26         "
27
28 do_configure_append () {
29         :
30
31
32 do_compile_append() {
33         :
34 }
35
36 local_unit_dir = "${sysconfdir}/systemd/system"
37 local_plugin_dir = "${sysconfdir}/collectd.d"
38 local_python_extensions_dir = "/opt/collectd/extensions/python"
39 local_config_extensions_dir = "/opt/collectd/extensions/config"
40
41
42 do_install_append() {
43
44         cd ${S}/collectd-extensions/src
45         install -m 755 -d ${D}/${sysconfdir}
46         install -m 755 -d ${D}/${local_unit_dir}
47         install -m 755 -d ${D}/${local_plugin_dir}
48         install -m 755 -d ${D}/${local_config_extensions_dir}
49         install -m 755 -d ${D}/${local_python_extensions_dir}
50
51         # support files ; service and pmon conf
52         install -m 644 collectd.service  ${D}/${local_unit_dir}
53         install -m 600 collectd.conf.pmon  ${D}/${local_config_extensions_dir}
54
55         # collectd python plugin files - notifiers
56         install -m 700  fm_notifier.py ${D}/${local_python_extensions_dir}
57         install -m 700 plugin_common.py ${D}/${local_python_extensions_dir}
58
59         # collectd python plugin files - resource plugins
60         install -m 700 cpu.py  ${D}/${local_python_extensions_dir}
61         install -m 700 memory.py  ${D}/${local_python_extensions_dir}
62         install -m 700 example.py  ${D}/${local_python_extensions_dir}
63         install -m 700 ntpq.py  ${D}/${local_python_extensions_dir}
64         install -m 700 interface.py ${D}/${local_python_extensions_dir}
65         install -m 700 remotels.py  ${D}/${local_python_extensions_dir}
66         install -m 700 ptp.py  ${D}/${local_python_extensions_dir}
67         install -m 700 ovs_interface.py  ${D}/${local_python_extensions_dir}
68
69
70         # collectd plugin conf files into /etc/collectd.d
71         install -m 600 python_plugins.conf  ${D}/${local_plugin_dir}
72         install -m 600 cpu.conf  ${D}/${local_plugin_dir}
73         install -m 600 memory.conf  ${D}/${local_plugin_dir}
74         install -m 600 df.conf  ${D}/${local_plugin_dir}
75         install -m 600 example.conf  ${D}/${local_plugin_dir}
76         install -m 600 ntpq.conf  ${D}/${local_plugin_dir}
77         install -m 600 interface.conf  ${D}/${local_plugin_dir}
78         install -m 600 remotels.conf  ${D}/${local_plugin_dir}
79         install -m 600 ptp.conf  ${D}/${local_plugin_dir}
80         install -m 600 ovs_interface.conf  ${D}/${local_plugin_dir}
81
82 }
83
84 FILES_collectd-extensions = " \
85         ${local_unit_dir}/collectd.service \
86         ${local_config_extensions_dir}/collectd.conf.pmon \
87         ${local_python_extensions_dir}/fm_notifier.py \
88         ${local_python_extensions_dir}/plugin_common.py \
89         ${local_python_extensions_dir}/cpu.py \
90         ${local_python_extensions_dir}/memory.py \
91         ${local_python_extensions_dir}/example.py \
92         ${local_python_extensions_dir}/ntpq.py \
93         ${local_python_extensions_dir}/interface.py \
94         ${local_python_extensions_dir}/remotels.py \
95         ${local_python_extensions_dir}/ptp.py \
96         ${local_python_extensions_dir}/ovs_interface.py \
97         ${local_plugin_dir}/python_plugins.conf \
98         ${local_plugin_dir}/cpu.conf \
99         ${local_plugin_dir}/memory.conf \
100         ${local_plugin_dir}/df.conf \
101         ${local_plugin_dir}/example.conf \
102         ${local_plugin_dir}/ntpq.conf \
103         ${local_plugin_dir}/interface.conf \
104         ${local_plugin_dir}/remotels.conf \
105         ${local_plugin_dir}/ptp.conf \
106         ${local_plugin_dir}/ovs_interface.conf \
107         "