diff options
author | Aaron Smith <aasmith@redhat.com> | 2018-09-10 12:01:36 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-09-10 12:01:36 +0000 |
commit | b52c942a4fbfc5023780d23954de953b817c6dc0 (patch) | |
tree | 5ecef4654e823b8cc151ded4e0234ed72d312c97 /src | |
parent | fbbfee45410a4a0766c61227751621c4463741bb (diff) | |
parent | b20fa77aef9d184afa2dadba619afc12878ae67b (diff) |
Merge "Add support for 'collectd-master' container"
Diffstat (limited to 'src')
20 files changed, 1191 insertions, 4 deletions
diff --git a/src/collectd/Makefile b/src/collectd/Makefile index 670c14fa..13121700 100644 --- a/src/collectd/Makefile +++ b/src/collectd/Makefile @@ -39,6 +39,11 @@ ifeq ($(XDG_CACHE_HOME_DIR),) XDG_CACHE_HOME_DIR = $(shell echo $$HOME) endif +SAMPLE_CONF_VARIANT_NAME = collectd_sample_configs +ifdef COLLECTD_USE_MASTER +SAMPLE_CONF_VARIANT_NAME = collectd_sample_configs-master +endif + CONFIG_CMD += --enable-syslog CONFIG_CMD += --enable-logfile CONFIG_CMD += --with-libpqos=$(LIBPQOS_DIR) @@ -82,7 +87,9 @@ ifndef DOCKER endif $(AT)sudo ./ovs_pmd_stats_config.sh $(AT)sudo ./snmp_mib_config.sh - $(AT)sudo ./include_config.sh + + @echo "Using sample configs: $(SAMPLE_CONF_VARIANT_NAME)" + $(AT)sudo ./include_config.sh $(SAMPLE_CONF_VARIANT_NAME) @echo "Make install done" install: force_install @@ -118,6 +125,7 @@ $(WORK_DIR): $(AT)git clone $(COLLECTD_URL) $(TAG_DONE_FLAG): $(WORK_DIR) + @echo "Checking out collectd from tag: $(COLLECTD_TAG)" $(AT)cd collectd; git checkout $(COLLECTD_TAG) ifneq ($(PATCH_FILE),) $(AT)cd $(WORK_DIR); patch -p1 < ../$(PATCH_FILE) diff --git a/src/collectd/collectd_sample_configs-master/csv.conf b/src/collectd/collectd_sample_configs-master/csv.conf new file mode 100644 index 00000000..99a8498d --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/csv.conf @@ -0,0 +1,19 @@ +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LoadPlugin csv +<Plugin csv> + DataDir "/tmp/collectd/csv" + StoreRates false +</Plugin> diff --git a/src/collectd/collectd_sample_configs-master/default_plugins.conf b/src/collectd/collectd_sample_configs-master/default_plugins.conf new file mode 100644 index 00000000..c96b0076 --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/default_plugins.conf @@ -0,0 +1,31 @@ +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#Hostname "" + +LoadPlugin cpufreq +LoadPlugin disk +LoadPlugin ethstat +LoadPlugin ipc +LoadPlugin ipmi +LoadPlugin load +LoadPlugin memory +LoadPlugin numa +LoadPlugin processes +LoadPlugin df +LoadPlugin turbostat +LoadPlugin uptime +LoadPlugin contextswitch +LoadPlugin irq +LoadPlugin df +LoadPlugin swap diff --git a/src/collectd/collectd_sample_configs-master/dpdkevents.conf b/src/collectd/collectd_sample_configs-master/dpdkevents.conf new file mode 100644 index 00000000..fdb6f3db --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/dpdkevents.conf @@ -0,0 +1,35 @@ +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +<LoadPlugin dpdkevents> + Interval 1 +</LoadPlugin> + +<Plugin "dpdkevents"> + <EAL> +# Coremask "0x1" +# MemoryChannels "4" +# FilePrefix "rte" + </EAL> + <Event "link_status"> + SendEventsOnUpdate false + EnabledPortMask 0xffff + SendNotification true + </Event> + <Event "keep_alive"> + SendEventsOnUpdate false + LCoreMask "0xf" + KeepAliveShmName "/dpdk_keepalive_shm_name" + SendNotification true + </Event> +</Plugin> diff --git a/src/collectd/collectd_sample_configs-master/dpdkstat.conf b/src/collectd/collectd_sample_configs-master/dpdkstat.conf new file mode 100644 index 00000000..59906d4e --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/dpdkstat.conf @@ -0,0 +1,23 @@ +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +LoadPlugin dpdkstat + +<Plugin dpdkstat> +# Coremask "0xf" +# ProcessType "secondary" +# FilePrefix "rte" + EnabledPortMask 0xffff +# PortName "interface1" +# PortName "interface2" +</Plugin> diff --git a/src/collectd/collectd_sample_configs-master/exec.conf b/src/collectd/collectd_sample_configs-master/exec.conf new file mode 100644 index 00000000..0a291bdb --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/exec.conf @@ -0,0 +1,20 @@ +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +LoadPlugin exec + +<Plugin exec> + # For OVS PMD stats plugin + Exec "collectd_exec" "/opt/collectd/etc/collectd.conf.d/ovs_pmd_stats.sh" + NotificationExec "collectd_exec" "/opt/collectd/etc/collectd.conf.d/write_notification.sh" +</Plugin> diff --git a/src/collectd/collectd_sample_configs-master/hugepages.conf b/src/collectd/collectd_sample_configs-master/hugepages.conf new file mode 100644 index 00000000..97cd2d17 --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/hugepages.conf @@ -0,0 +1,22 @@ +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +LoadPlugin hugepages + +<Plugin hugepages> + ReportPerNodeHP true + ReportRootHP true + ValuesPages true + ValuesBytes false + ValuesPercentage false +</Plugin> diff --git a/src/collectd/collectd_sample_configs-master/intel_pmu.conf b/src/collectd/collectd_sample_configs-master/intel_pmu.conf new file mode 100644 index 00000000..959fb8a1 --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/intel_pmu.conf @@ -0,0 +1,23 @@ +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +LoadPlugin intel_pmu + +<Plugin intel_pmu> + ReportHardwareCacheEvents true + ReportKernelPMUEvents true + ReportSoftwareEvents true +# EventList "/var/cache/pmu/GenuineIntel-6-2D-core.json" +# HardwareEvents "L2_RQSTS.CODE_RD_HIT,L2_RQSTS.CODE_RD_MISS" "L2_RQSTS.ALL_CODE_RD" + Cores "[0-4]" +</Plugin> diff --git a/src/collectd/collectd_sample_configs-master/kafka.conf b/src/collectd/collectd_sample_configs-master/kafka.conf new file mode 100644 index 00000000..f81e87fd --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/kafka.conf @@ -0,0 +1,21 @@ +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +LoadPlugin write_kafka + +<Plugin write_kafka> + Property "metadata.broker.list" "localhost:9092" + <Topic "collectd"> + Format JSON + </Topic> +</Plugin> diff --git a/src/collectd/collectd_sample_configs-master/mcelog.conf b/src/collectd/collectd_sample_configs-master/mcelog.conf new file mode 100644 index 00000000..633a3bcd --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/mcelog.conf @@ -0,0 +1,24 @@ +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +<LoadPlugin mcelog> + Interval 1 +</LoadPlugin> + +<Plugin mcelog> + <Memory> + McelogClientSocket "/var/run/mcelog-client" + PersistentNotification false + </Memory> +## McelogLogfile "/var/log/mcelog" +</Plugin> diff --git a/src/collectd/collectd_sample_configs-master/network.conf b/src/collectd/collectd_sample_configs-master/network.conf new file mode 100644 index 00000000..4309ed86 --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/network.conf @@ -0,0 +1,18 @@ +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LoadPlugin network +<Plugin network> + Server "127.0.0.1" "25826" +</Plugin> diff --git a/src/collectd/collectd_sample_configs-master/ovs_events.conf b/src/collectd/collectd_sample_configs-master/ovs_events.conf new file mode 100644 index 00000000..250e1e43 --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/ovs_events.conf @@ -0,0 +1,24 @@ +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +<LoadPlugin ovs_events> + Interval 1 +</LoadPlugin> + +<Plugin ovs_events> +# Port "6640" +# Address "127.0.0.1" +# Socket "/var/run/openvswitch/db.sock" +# Interfaces "br0" "veth0" + SendNotification true +</Plugin> diff --git a/src/collectd/collectd_sample_configs-master/ovs_pmd_stats.sh b/src/collectd/collectd_sample_configs-master/ovs_pmd_stats.sh new file mode 100755 index 00000000..0517717f --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/ovs_pmd_stats.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +sudo python /usr/local/src/ovs_pmd_stats.py --socket-pid-file /var/run/openvswitch/ovs-vswitchd.pid diff --git a/src/collectd/collectd_sample_configs-master/ovs_stats.conf b/src/collectd/collectd_sample_configs-master/ovs_stats.conf new file mode 100644 index 00000000..2a6d2fb2 --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/ovs_stats.conf @@ -0,0 +1,23 @@ +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License + +<LoadPlugin ovs_stats> + Interval 1 +</LoadPlugin> +<Plugin "ovs_stats"> +# Port "6640" +# Address "127.0.0.1" +# Socket "/var/run/openvswitch/db.sock" +# Bridges "br0" +</Plugin> diff --git a/src/collectd/collectd_sample_configs-master/rdt.conf b/src/collectd/collectd_sample_configs-master/rdt.conf new file mode 100644 index 00000000..ae983dc0 --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/rdt.conf @@ -0,0 +1,20 @@ +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +<LoadPlugin intel_rdt> + Interval 1 +</LoadPlugin> + +<Plugin "intel_rdt"> + Cores "" +</Plugin> diff --git a/src/collectd/collectd_sample_configs-master/snmp_agent.conf b/src/collectd/collectd_sample_configs-master/snmp_agent.conf new file mode 100644 index 00000000..7cbde816 --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/snmp_agent.conf @@ -0,0 +1,785 @@ +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +LoadPlugin snmp_agent +<Plugin snmp_agent> +# Intel PMU MIB + <Table "pmuTable"> + IndexOID "INTEL-PMU-MIB::pmuGroupIndex" + <Data "pmuGroupDescr"> + <IndexKey> + Source "PluginInstance" + </IndexKey> + Plugin "intel_pmu" + OIDs "INTEL-PMU-MIB::pmuGroupDescr" + </Data> + <Data "pmuL1DCacheLoads"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "L1-dcache-loads" + OIDs "INTEL-PMU-MIB::pmuL1DCacheLoads" + </Data> + <Data "pmuL1DCacheLoadMisses"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "L1-dcache-load-misses" + OIDs "INTEL-PMU-MIB::pmuL1DCacheLoadMisses" + </Data> + <Data "pmuL1DCacheStores"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "L1-dcache-stores" + OIDs "INTEL-PMU-MIB::pmuL1DCacheStores" + </Data> + <Data "pmuL1DCacheStoreMisses"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "L1-dcache-store-misses" + OIDs "INTEL-PMU-MIB::pmuL1DCacheStoreMisses" + </Data> + <Data "pmuL1DCachePrefetches"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "L1-dcache-prefetches" + OIDs "INTEL-PMU-MIB::pmuL1DCachePrefetches" + </Data> + <Data "pmuL1DCachePrefetchMisses"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "L1-dcache-prefetch-misses" + OIDs "INTEL-PMU-MIB::pmuL1DCachePrefetchMisses" + </Data> + <Data "pmuL1ICacheLoads"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "L1-icache-loads" + OIDs "INTEL-PMU-MIB::pmuL1ICacheLoads" + </Data> + <Data "pmuL1ICacheLoadMisses"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "L1-icache-load-misses" + OIDs "INTEL-PMU-MIB::pmuL1ICacheLoadMisses" + </Data> + <Data "pmuL1ICachePrefetches"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "L1-icache-prefetches" + OIDs "INTEL-PMU-MIB::pmuL1ICachePrefetches" + </Data> + <Data "pmuL1ICachePrefetchMisses"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "L1-icache-prefetch-misses" + OIDs "INTEL-PMU-MIB::pmuL1ICachePrefetchMisses" + </Data> + <Data "pmuLLCLoads"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "LLC-loads" + OIDs "INTEL-PMU-MIB::pmuLLCLoads" + </Data> + <Data "pmuLLCLoadMisses"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "LLC-load-misses" + OIDs "INTEL-PMU-MIB::pmuLLCLoadMisses" + </Data> + <Data "pmuLLCStores"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "LLC-stores" + OIDs "INTEL-PMU-MIB::pmuLLCStores" + </Data> + <Data "pmuLLCStoreMisses"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "LLC-store-misses" + OIDs "INTEL-PMU-MIB::pmuLLCStoreMisses" + </Data> + <Data "pmuLLCPrefetches"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "LLC-prefetches" + OIDs "INTEL-PMU-MIB::pmuLLCPrefetches" + </Data> + <Data "pmuLLCPrefetchMisses"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "LLC-prefetch-misses" + OIDs "INTEL-PMU-MIB::pmuLLCPrefetchMisses" + </Data> + <Data "pmuDTLBLoads"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "dTLB-loads" + OIDs "INTEL-PMU-MIB::pmuDTLBLoads" + </Data> + <Data "pmuDTLBLoadMisses"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "dTLB-load-misses" + OIDs "INTEL-PMU-MIB::pmuDTLBLoadMisses" + </Data> + <Data "pmuDTLBStores"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "dTLB-stores" + OIDs "INTEL-PMU-MIB::pmuDTLBStores" + </Data> + <Data "pmuDTLBStoreMisses"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "dTLB-store-misses" + OIDs "INTEL-PMU-MIB::pmuDTLBStoreMisses" + </Data> + <Data "pmuDTLBPrefetches"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "dTLB-prefetches" + OIDs "INTEL-PMU-MIB::pmuDTLBPrefetches" + </Data> + <Data "pmuDTLBPrefetchMisses"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "dTLB-prefetch-misses" + OIDs "INTEL-PMU-MIB::pmuDTLBPrefetchMisses" + </Data> + <Data "pmuITLBLoads"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "iTLB-loads" + OIDs "INTEL-PMU-MIB::pmuITLBLoads" + </Data> + <Data "pmuITLBLoadMisses"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "iTLB-load-misses" + OIDs "INTEL-PMU-MIB::pmuITLBLoadMisses" + </Data> + <Data "pmuBranchLoads"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "branch-loads" + OIDs "INTEL-PMU-MIB::pmuBranchLoads" + </Data> + <Data "pmuBranchLoadMisses"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "branch-load-misses" + OIDs "INTEL-PMU-MIB::pmuBranchLoadMisses" + </Data> + <Data "pmuCpuCycles"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "cpu-cycles" + OIDs "INTEL-PMU-MIB::pmuCpuCycles" + </Data> + <Data "pmuInstructions"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "instructions" + OIDs "INTEL-PMU-MIB::pmuInstructions" + </Data> + <Data "pmuCacheReferences"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "cache-references" + OIDs "INTEL-PMU-MIB::pmuCacheReferences" + </Data> + <Data "pmuCacheMisses"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "cache-misses" + OIDs "INTEL-PMU-MIB::pmuCacheMisses" + </Data> + <Data "pmuBranches"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "branches" + OIDs "INTEL-PMU-MIB::pmuBranches" + </Data> + <Data "pmuBranchMisses"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "branch-misses" + OIDs "INTEL-PMU-MIB::pmuBranchMisses" + </Data> + <Data "pmuBusCycles"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "bus-cycles" + OIDs "INTEL-PMU-MIB::pmuBusCycles" + </Data> + <Data "pmuCpuClock"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "cpu-clock" + OIDs "INTEL-PMU-MIB::pmuCpuClock" + </Data> + <Data "pmuTaskClock"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "task-clock" + OIDs "INTEL-PMU-MIB::pmuTaskClock" + </Data> + <Data "pmuContextSwitches"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "context-switches" + OIDs "INTEL-PMU-MIB::pmuContextSwitches" + </Data> + <Data "pmuCpuMigrations"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "cpu-migrations" + OIDs "INTEL-PMU-MIB::pmuCpuMigrations" + </Data> + <Data "pmuPageFaults"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "page-faults" + OIDs "INTEL-PMU-MIB::pmuPageFaults" + </Data> + <Data "pmuMinorFaults"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "minor-faults" + OIDs "INTEL-PMU-MIB::pmuMinorFaults" + </Data> + <Data "pmuMajorFaults"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "major-faults" + OIDs "INTEL-PMU-MIB::pmuMajorFaults" + </Data> + <Data "pmuAlignmentFaults"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "alignment-faults" + OIDs "INTEL-PMU-MIB::pmuAlignmentFaults" + </Data> + <Data "pmuEmulationFaults"> + Plugin "intel_pmu" + Type "counter" + TypeInstance "emulation-faults" + OIDs "INTEL-PMU-MIB::pmuEmulationFaults" + </Data> + </Table> +# Intel RDT MIB + <Table "rdtTable"> + IndexOID "INTEL-RDT-MIB::rdtGroupIndex" + SizeOID "INTEL-RDT-MIB::rdtGroupNumber" + <Data "rdtGroupDescr"> + <IndexKey> + Source "PluginInstance" + </IndexKey> + Plugin "intel_rdt" + OIDs "INTEL-RDT-MIB::rdtGroupDescr" + </Data> + <Data "rdtLlc"> + Plugin "intel_rdt" + Type "bytes" + TypeInstance "llc" + OIDs "INTEL-RDT-MIB::rdtLlc" + </Data> + <Data "rdtIpc"> + Plugin "intel_rdt" + Type "ipc" + OIDs "INTEL-RDT-MIB::rdtIpc" + </Data> + <Data "rdtMbmRemote"> + Plugin "intel_rdt" + Type "memory_bandwidth" + TypeInstance "remote" + OIDs "INTEL-RDT-MIB::rdtMbmRemote" + </Data> + <Data "rdtMbmLocal"> + Plugin "intel_rdt" + Type "memory_bandwidth" + TypeInstance "local" + OIDs "INTEL-RDT-MIB::rdtMbmLocal" + </Data> + </Table> +# Intel Mcelog MIB + <Table "mcelogTable"> + IndexOID "INTEL-MCELOG-MIB::memoryGroupIndex" + <Data "memoryGroupDescr"> + <IndexKey> + Source "PluginInstance" + </IndexKey> + Plugin "mcelog" + OIDs "INTEL-MCELOG-MIB::memoryGroupDescr" + </Data> + <Data "memoryCorrectedErrors"> + Plugin "mcelog" + Type "errors" + TypeInstance "corrected_memory_errors" + OIDs "INTEL-MCELOG-MIB::memoryCorrectedErrors" + </Data> + <Data "memoryCorrectedTimedErrors"> + Plugin "mcelog" + Type "errors" + TypeInstance "corrected_memory_errors_in_24h" + OIDs "INTEL-MCELOG-MIB::memoryCorrectedTimedErrors" + </Data> + <Data "memoryUncorrectedErrors"> + Plugin "mcelog" + Type "errors" + TypeInstance "uncorrected_memory_errors" + OIDs "INTEL-MCELOG-MIB::memoryUncorrectedErrors" + </Data> + <Data "memoryUncorrectedTimedErrors"> + Plugin "mcelog" + Type "errors" + TypeInstance "uncorrected_memory_errors_in_24h" + OIDs "INTEL-MCELOG-MIB::memoryUncorrectedTimedErrors" + </Data> + </Table> +# Hugepages + <Table "hugepagesTable"> + <Data "hugepagesNode"> + <IndexKey> + Source "PluginInstance" + </IndexKey> + Plugin "hugepages" + OIDs "INTEL-HUGEPAGES-MIB::hugepagesNode" + </Data> + <Data "hugepagesMemoryFree"> + Plugin "hugepages" + Type "memory" + TypeInstance "free" + OIDs "INTEL-HUGEPAGES-MIB::hugepagesMemoryFree" + </Data> + <Data "hugepagesMemoryUsed"> + Plugin "hugepages" + Type "memory" + TypeInstance "used" + OIDs "INTEL-HUGEPAGES-MIB::hugepagesMemoryUsed" + </Data> + <Data "hugepagesPagesFree"> + Plugin "hugepages" + Type "vmpage_number" + TypeInstance "free" + OIDs "INTEL-HUGEPAGES-MIB::hugepagesPagesFree" + </Data> + <Data "hugepagesPagesUsed"> + Plugin "hugepages" + Type "vmpage_number" + TypeInstance "used" + OIDs "INTEL-HUGEPAGES-MIB::hugepagesPagesUsed" + </Data> + <Data "hugepagesPercentFree"> + Plugin "hugepages" + Type "percent" + TypeInstance "free" + OIDs "INTEL-HUGEPAGES-MIB::hugepagesPercentFree" + </Data> + <Data "hugepagesPercentUsed"> + Plugin "hugepages" + Type "percent" + TypeInstance "used" + OIDs "INTEL-HUGEPAGES-MIB::hugepagesPercentUsed" + </Data> + </Table> + # Libvirt MIB + <Table "lvhDomainTable"> + <Data "DomainName"> + <IndexKey> + Source "PluginInstance" + </IndexKey> + Plugin "virt" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhDomainName" + </Data> + <Data "CPUTotalTime"> + Plugin "virt" + Type "ps_cputime" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhCPUTotalTimeUser" "LIBVIRT-HYPERVISOR-MIB::lvhCPUTotalTimeSystem" + </Data> + <Data "VirtCPUTotal"> + Plugin "virt" + Type "percent" + TypeInstance "virt_cpu_total" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhVirtCPUTotal" + </Data> + <Data "MemoryTotal"> + Plugin "virt" + Type "memory" + TypeInstance "total" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhMemoryTotal" + </Data> + </Table> + <Table "MemoryTable"> + <Data "MemoryDomainName"> + <IndexKey> + Source "PluginInstance" + </IndexKey> + Plugin "virt" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhMemoryDomainName" + </Data> + <Data "MemorySwapIn"> + Plugin "virt" + Type "memory" + TypeInstance "swap_in" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhMemorySwapIn" + </Data> + <Data "MemorySwapOut"> + Plugin "virt" + Type "memory" + TypeInstance "swap_out" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhMemorySwapOut" + </Data> + <Data "MemoryMajorFault"> + Plugin "virt" + Type "memory" + TypeInstance "major_fault" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhMemoryMajorFault" + </Data> + <Data "MemoryMinorFault"> + Plugin "virt" + Type "memory" + TypeInstance "minor_fault" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhMemoryMinorFault" + </Data> + <Data "MemoryUnused"> + Plugin "virt" + Type "memory" + TypeInstance "unused" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhMemoryUnused" + </Data> + <Data "MemoryAvailable"> + Plugin "virt" + Type "memory" + TypeInstance "available" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhMemoryAvailable" + </Data> + <Data "MemoryActualBalloon"> + Plugin "virt" + Type "memory" + TypeInstance "actual_balloon" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhMemoryActualBalloon" + </Data> + <Data "MemoryRss"> + Plugin "virt" + Type "memory" + TypeInstance "rss" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhMemoryRss" + </Data> + <Data "MemoryLastUpdate"> + Plugin "virt" + Type "memory" + TypeInstance "last_update" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhMemoryLastUpdate" + </Data> + </Table> + <Table "PerfTable"> + <Data "PerfDomainName"> + <IndexKey> + Source "PluginInstance" + </IndexKey> + Plugin "virt" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfDomainName" + </Data> + <Data "PerfAlignmentFaults"> + Plugin "virt" + Type "perf" + TypeInstance "perf_alignment_faults" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfAlignmentFaults" + </Data> + <Data "PerfBranchInstructions"> + Plugin "virt" + Type "perf" + TypeInstance "perf_branch_instructions" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfBranchInstructions" + </Data> + <Data "PerfBranchMisses"> + Plugin "virt" + Type "perf" + TypeInstance "perf_branch_misses" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfBranchMisses" + </Data> + <Data "PerfBusCycles"> + Plugin "virt" + Type "perf" + TypeInstance "perf_bus_cycles" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfBusCycles" + </Data> + <Data "PerfCacheMisses"> + Plugin "virt" + Type "perf" + TypeInstance "perf_cache_misses" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfCacheMisses" + </Data> + <Data "PerfCacheReferences"> + Plugin "virt" + Type "perf" + TypeInstance "perf_cache_references" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfCacheReferences" + </Data> + <Data "PerfCmt"> + Plugin "virt" + Type "perf" + TypeInstance "perf_cmt" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfCmt" + </Data> + <Data "PerfContextSwitches"> + Plugin "virt" + Type "perf" + TypeInstance "perf_context_switches" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfContextSwitches" + </Data> + <Data "PerfCPUClock"> + Plugin "virt" + Type "perf" + TypeInstance "perf_cpu_clock" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfCPUClock" + </Data> + <Data "PerfCPUCycles"> + Plugin "virt" + Type "perf" + TypeInstance "perf_cpu_cycles" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfCPUCycles" + </Data> + <Data "PerfCPUMigrations"> + Plugin "virt" + Type "perf" + TypeInstance "perf_cpu_migrations" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfCPUMigrations" + </Data> + <Data "PerfEmulationFaults"> + Plugin "virt" + Type "perf" + TypeInstance "perf_emulation_faults" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfEmulationFaults" + </Data> + <Data "PerfInstructions"> + Plugin "virt" + Type "perf" + TypeInstance "perf_instructions" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfInstructions" + </Data> + <Data "PerfMbml"> + Plugin "virt" + Type "perf" + TypeInstance "perf_mbml" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfMbml" + </Data> + <Data "PerfMbmt"> + Plugin "virt" + Type "perf" + TypeInstance "perf_mbmt" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfMbmt" + </Data> + <Data "PerfPageFaults"> + Plugin "virt" + Type "perf" + TypeInstance "perf_page_faults" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfPageFaults" + </Data> + <Data "PerfPageFaultsMaj"> + Plugin "virt" + Type "perf" + TypeInstance "perf_page_faults_maj" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfPageFaultsMaj" + </Data> + <Data "PerfPageFaultsMin"> + Plugin "virt" + Type "perf" + TypeInstance "perf_page_faults_min" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfPageFaultsMin" + </Data> + <Data "PerfRefCPUCycles"> + Plugin "virt" + Type "perf" + TypeInstance "perf_ref_cpu_cycles" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfRefCPUCycles" + </Data> + <Data "PerfTaskClock"> + Plugin "virt" + Type "perf" + TypeInstance "perf_task_clock" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhPerfTaskClock" + </Data> + </Table> + <Table "lvhCPUAffinityTable"> + <Data "DomainName"> + <IndexKey> + Source "PluginInstance" + </IndexKey> + Plugin "virt" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhAffinityDomainName" + </Data> + <Data "VCPU"> + Plugin "virt" + <IndexKey> + Source "TypeInstance" + Regex "^vcpu_([0-9]{1,3})-cpu_[0-9]{1,3}$" + Group 1 + </IndexKey> + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhVCPUIndex" + </Data> + <Data "CPU"> + Plugin "virt" + <IndexKey> + Source "TypeInstance" + Regex "^vcpu_[0-9]{1,3}-cpu_([0-9]{1,3})$" + Group 1 + </IndexKey> + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhCPUIndex" + </Data> + <Data "CPUAffinity"> + Plugin "virt" + Type "cpu_affinity" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhCPUAffinity" + </Data> + </Table> + <Table "VirtVCPUTable"> + <Data "VCPUDomainName"> + <IndexKey> + Source "PluginInstance" + </IndexKey> + Plugin "virt" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhVCPUDomainName" + </Data> + <Data "VCPUVCPUIndex"> + <IndexKey> + Source "TypeInstance" + Regex "^([0-9]{1,3})$" + Group 1 + </IndexKey> + Plugin "virt" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhVCPUVCPUIndex" + </Data> + <Data "VirtVCPU"> + Plugin "virt" + Type "virt_vcpu" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhVirtVCPU" + </Data> + </Table> + <Table "DiskErrorTable"> + <Data "DiskDomainName"> + <IndexKey> + Source "PluginInstance" + </IndexKey> + Plugin "virt" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhDiskDomainName" + </Data> + <Data "DiskName"> + <IndexKey> + Source "TypeInstance" + </IndexKey> + Plugin "virt" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhDiskName" + </Data> + <Data "DiskError"> + Plugin "virt" + Type "disk_error" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhDiskError" + </Data> + </Table> + <Table "BlockDeviceTable"> + <Data "BlockDomainName"> + <IndexKey> + Source "PluginInstance" + </IndexKey> + Plugin "virt" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhBlockDomainName" + </Data> + <Data "BlockDeviceName"> + <IndexKey> + Source "TypeInstance" + </IndexKey> + Plugin "virt" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhBlockDeviceName" + </Data> + <Data "DiskOps"> + Plugin "virt" + Type "disk_ops" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhDiskOpsRead" "LIBVIRT-HYPERVISOR-MIB::lvhDiskOpsWrite" + </Data> + <Data "DiskOctets"> + Plugin "virt" + Type "disk_octets" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhDiskOctetsRead" "LIBVIRT-HYPERVISOR-MIB::lvhDiskOctetsWrite" + </Data> + <Data "DiskTimeCache"> + Plugin "virt" + Type "disk_time" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhDiskTimeCacheRead" "LIBVIRT-HYPERVISOR-MIB::lvhDiskTimeCacheWrite" + </Data> + </Table> + <Table "BlockDevFlushTable"> + <Data "BlockDevFlushDomainName"> + <IndexKey> + Source "PluginInstance" + </IndexKey> + Plugin "virt" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhBlockDevFlushDomainName" + </Data> + <Data "BlockDevFlushDeviceName"> + <IndexKey> + Source "TypeInstance" + Regex "^flush-(.*)$" + Group 1 + </IndexKey> + Plugin "virt" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhBlockDevFlushDeviceName" + </Data> + <Data "TotalRequestsFlush"> + Plugin "virt" + Type "total_requests" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhTotalRequestsFlush" + </Data> + <Data "TotalTimeInMsFlush"> + Plugin "virt" + Type "total_time_in_ms" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhTotalTimeInMsFlush" + </Data> + </Table> + <Table "NetworkIfaceTable"> + <Data "NetIfDomainName"> + <IndexKey> + Source "PluginInstance" + </IndexKey> + Plugin "virt" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhNetIfDomainName" + </Data> + <Data "InterfaceName"> + <IndexKey> + Source "TypeInstance" + </IndexKey> + Plugin "virt" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhInterfaceName" + </Data> + <Data "IfBytes"> + Plugin "virt" + Type "if_octets" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhIfBytesReceived" "LIBVIRT-HYPERVISOR-MIB::lvhIfBytesTransmitted" + </Data> + <Data "IfPackets"> + Plugin "virt" + Type "if_packets" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhIfPacketsReceived" "LIBVIRT-HYPERVISOR-MIB::lvhIfPacketsTransmitted" + </Data> + <Data "lvhIfErrors"> + Plugin "virt" + Type "if_errors" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhIfErrorsReceive" "LIBVIRT-HYPERVISOR-MIB::lvhIfErrorsTransmission" + </Data> + <Data "IfDroppedReceive"> + Plugin "virt" + Type "if_dropped" + OIDs "LIBVIRT-HYPERVISOR-MIB::lvhIfDroppedReceive" "LIBVIRT-HYPERVISOR-MIB::lvhIfDroppedTransmit" + </Data> + </Table> +</Plugin> diff --git a/src/collectd/collectd_sample_configs-master/virt.conf b/src/collectd/collectd_sample_configs-master/virt.conf new file mode 100644 index 00000000..88229e3c --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/virt.conf @@ -0,0 +1,30 @@ +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +LoadPlugin virt +<Plugin virt> +# Connection "xen:///" + RefreshInterval 60 +# Domain "name" +# BlockDevice "name:device" +# BlockDeviceFormat target +# BlockDeviceFormatBasename false +# InterfaceDevice "name:device" +# IgnoreSelected false +# HostnameFormat name +# InterfaceFormat name +# PluginInstanceFormat name +# Instances 1 + ExtraStats "cpu_util disk disk_err domain_state fs_info job_stats_background pcpu perf vcpupin" +</Plugin> diff --git a/src/collectd/collectd_sample_configs-master/write_notification.sh b/src/collectd/collectd_sample_configs-master/write_notification.sh new file mode 100755 index 00000000..ed6ed9e2 --- /dev/null +++ b/src/collectd/collectd_sample_configs-master/write_notification.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Copyright 2017 OPNFV +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +rm -f /tmp/notifications +while read x y +do + echo $x$y >> /tmp/notifications +done diff --git a/src/collectd/include_config.sh b/src/collectd/include_config.sh index dd20893d..4f91a453 100755 --- a/src/collectd/include_config.sh +++ b/src/collectd/include_config.sh @@ -13,12 +13,31 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Config file options are changing between releases so we have to store both +# configurations variants and choose correct one for target collectd version + +if [ -z "$1" ]; then + echo "Error! Please sample configs variant name as a param!"\ + "(name of directory with sample-configs)" + echo "Usage:" + echo "$0 SAMPLE_CONFIGS_VARIANT_NAME" + echo "e.g. $0 'collectd_sample_configs'" + exit 1 +fi + +SAMPLE_CONF_VARIANT="$1" COLLECTD_CONF_FILE=/opt/collectd/etc/collectd.conf COLLECTD_CONF_DIR=/opt/collectd/etc/collectd.conf.d INCLUDE_CONF="<Include \"/opt/collectd/etc/collectd.conf.d\">" CURR_DIR=`pwd` HOSTNAME=`hostname` -SAMPLE_CONF_DIR=$CURR_DIR/collectd_sample_configs/* +SAMPLE_CONF_DIR=$CURR_DIR/$SAMPLE_CONF_VARIANT + +if [ ! -d "$SAMPLE_CONF_DIR" ]; then + echo "$SAMPLE_CONF_DIR does not exits!"\ + "Probably passed bad variant name as a param: $SAMPLE_CONF_VARIANT" + exit 1 +fi function write_include { echo "Hostname \"$HOSTNAME\"" | sudo tee -a $COLLECTD_CONF_FILE; @@ -31,7 +50,8 @@ grep -qe '<Include "/opt/collectd/etc/collectd.conf.d">' $COLLECTD_CONF_FILE; [ `mkdir -p $COLLECTD_CONF_DIR` -for F in $SAMPLE_CONF_DIR; do +SAMPLE_CONF_FILES=$SAMPLE_CONF_DIR/* +for F in $SAMPLE_CONF_FILES; do FILE=$(basename $F) [ -f $COLLECTD_CONF_DIR/$FILE ] && echo "File $COLLECTD_CONF_DIR/$FILE exists" || cp $F $COLLECTD_CONF_DIR done diff --git a/src/package-list.mk b/src/package-list.mk index 975a79e8..b58e092a 100644 --- a/src/package-list.mk +++ b/src/package-list.mk @@ -19,7 +19,14 @@ KAFKA_TAG ?= v0.9.5 # collectd section COLLECTD_URL ?= https://github.com/collectd/collectd -COLLECTD_TAG ?= collectd-5.8 +# there are 2 collectd flavors: +# -"collectd" - based on stable collect release +# -"collectd-master" - development version, based on master branch +ifdef COLLECTD_USE_MASTER + COLLECTD_TAG ?= master +else + COLLECTD_TAG ?= collectd-5.8 +endif COLLECTD_OPENSTACK_URL ?= https://github.com/openstack/collectd-openstack-plugins COLLECTD_OPENSTACK_TAG ?= stable/pike |