diff options
Diffstat (limited to 'src/collectd')
32 files changed, 1614 insertions, 57 deletions
diff --git a/src/collectd/Makefile b/src/collectd/Makefile index 7d306528..785614d5 100644 --- a/src/collectd/Makefile +++ b/src/collectd/Makefile @@ -1,30 +1,33 @@ # makefile to manage collectd package # -# Copyright 2016-2017 OPNFV +# Copyright 2016-2021 Intel Corporation, Anuket and others. +# All rights reserved. # # 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 +# 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. - +# # # Contributors: # Aihua Li, Huawei Technologies. # Maryam Tahhan, Intel Corporation. +# Emma Foley, Red Hat. include ../mk/master.mk include ../package-list.mk WORK_DIR = collectd -TAG_DONE_FLAG = $(WORK_DIR)/.$(COLLECTD_TAG).done +# $COLLECTD_TAG can contain "/", which is being replaced with "-" here +TAG_DONE_FLAG := $(WORK_DIR)/.$(subst /,-,$(COLLECTD_TAG)).done BUILD_CMD = ./build.sh CONFIG_CMD = CONFIG_CMD += ./configure @@ -39,6 +42,183 @@ ifeq ($(XDG_CACHE_HOME_DIR),) XDG_CACHE_HOME_DIR = $(shell echo $$HOME) endif +ifeq ($(COLLECTD_FLAVOR),collectd-6) +CONFIG_CMD += --enable-cpu +CONFIG_CMD += --enable-interface +CONFIG_CMD += --enable-memory +CONFIG_CMD += --enable-ping +CONFIG_CMD += --enable-uptime + +CONFIG_CMD += --disable-aggregation +CONFIG_CMD += --disable-amqp +CONFIG_CMD += --disable-amqp1 +#CONFIG_CMD += --disable-apache +#CONFIG_CMD += --disable-apcups +#CONFIG_CMD += --disable-apple_sensors +#CONFIG_CMD += --disable-aquaero +CONFIG_CMD += --disable-barometer +#CONFIG_CMD += --disable-battery +#CONFIG_CMD += --disable-bind +#CONFIG_CMD += --disable-buddyinfo +#CONFIG_CMD += --disable-capabilities +#CONFIG_CMD += --disable-ceph +#CONFIG_CMD += --disable-cgroups +#CONFIG_CMD += --disable-chrony +CONFIG_CMD += --disable-check_uptime +#CONFIG_CMD += --disable-connectivity +#CONFIG_CMD += --disable-conntrack +#CONFIG_CMD += --disable-contextswitch +#CONFIG_CMD += --disable-cpufreq +#CONFIG_CMD += --disable-cpusleep +CONFIG_CMD += --disable-csv +#CONFIG_CMD += --disable-curl +#CONFIG_CMD += --disable-curl_json +CONFIG_CMD += --disable-curl_xml +#CONFIG_CMD += --disable-dbi +#CONFIG_CMD += --disable-dcpmm +#CONFIG_CMD += --disable-df +#CONFIG_CMD += --disable-disk +#CONFIG_CMD += --disable-dns +#CONFIG_CMD += --disable-dpdkevents +#CONFIG_CMD += --disable-dpdkstat +#CONFIG_CMD += --disable-dpdk_telemetry +#CONFIG_CMD += --disable-drbd +#CONFIG_CMD += --disable-email +#CONFIG_CMD += --disable-entropy +#CONFIG_CMD += --disable-ethstat +#CONFIG_CMD += --disable-exec +#CONFIG_CMD += --disable-fhcount +#CONFIG_CMD += --disable-filecount +#CONFIG_CMD += --disable-fscache +CONFIG_CMD += --disable-gmond +#CONFIG_CMD += --disable-gps +#CONFIG_CMD += --disable-gpu_nvidia +CONFIG_CMD += --disable-grpc +#CONFIG_CMD += --disable-hddtemp +#CONFIG_CMD += --disable-hugepages +#CONFIG_CMD += --disable-infiniband +#CONFIG_CMD += --disable-intel_pmu +#CONFIG_CMD += --disable-intel_rdt +#CONFIG_CMD += --disable-ipc +#CONFIG_CMD += --disable-ipmi +#CONFIG_CMD += --disable-iptables +#CONFIG_CMD += --disable-ipstats +#CONFIG_CMD += --disable-ipvs +#CONFIG_CMD += --disable-irq +CONFIG_CMD += --disable-java +#CONFIG_CMD += --disable-load +#CONFIG_CMD += --disable-log_logstash +#CONFIG_CMD += --disable-logfile +#CONFIG_CMD += --disable-logparser +#CONFIG_CMD += --disable-lpar +CONFIG_CMD += --disable-lua +#CONFIG_CMD += --disable-madwifi +CONFIG_CMD += --disable-match_empty_counter +CONFIG_CMD += --disable-match_hashed +CONFIG_CMD += --disable-match_regex +CONFIG_CMD += --disable-match_timediff +CONFIG_CMD += --disable-match_value +#CONFIG_CMD += --disable-mbmon +#CONFIG_CMD += --disable-mcelog +#CONFIG_CMD += --disable-md +#CONFIG_CMD += --disable-mdevents +#CONFIG_CMD += --disable-memcachec +#CONFIG_CMD += --disable-memcached +#CONFIG_CMD += --disable-mic +CONFIG_CMD += --disable-modbus +CONFIG_CMD += --disable-mqtt +#CONFIG_CMD += --disable-multimeter +#CONFIG_CMD += --disable-mysql +#CONFIG_CMD += --disable-netapp +#CONFIG_CMD += --disable-netlink +#CONFIG_CMD += --disable-netstat_udp +CONFIG_CMD += --disable-network +#CONFIG_CMD += --disable-nfs +#CONFIG_CMD += --disable-nginx +#CONFIG_CMD += --disable-notify_desktop +#CONFIG_CMD += --disable-notify_email +#CONFIG_CMD += --disable-notify_nagios +#CONFIG_CMD += --disable-ntpd +#CONFIG_CMD += --disable-numa +#CONFIG_CMD += --disable-nut +#CONFIG_CMD += --disable-olsrd +#CONFIG_CMD += --disable-onewire +CONFIG_CMD += --disable-openldap +#CONFIG_CMD += --disable-openvpn +#CONFIG_CMD += --disable-oracle +#CONFIG_CMD += --disable-ovs_events +#CONFIG_CMD += --disable-ovs_stats +#CONFIG_CMD += --disable-pcie_errors +CONFIG_CMD += --disable-perl +#CONFIG_CMD += --disable-pf +#CONFIG_CMD += --disable-pinba +CONFIG_CMD += --disable-postgresql +#CONFIG_CMD += --disable-powerdns +#CONFIG_CMD += --disable-processes +#CONFIG_CMD += --disable-procevent +#CONFIG_CMD += --disable-protocols +CONFIG_CMD += --disable-python +#CONFIG_CMD += --disable-redfish +CONFIG_CMD += --disable-redis +#CONFIG_CMD += --disable-routeros +CONFIG_CMD += --disable-rrdcached +CONFIG_CMD += --disable-rrdtool +#CONFIG_CMD += --disable-sensors +#CONFIG_CMD += --disable-serial +#CONFIG_CMD += --disable-sigrok +#CONFIG_CMD += --disable-slurm +#CONFIG_CMD += --disable-smart +CONFIG_CMD += --disable-snmp +CONFIG_CMD += --disable-snmp_agent +CONFIG_CMD += --disable-statsd +#CONFIG_CMD += --disable-swap +#CONFIG_CMD += --disable-synproxy +#CONFIG_CMD += --disable-sysevent +#CONFIG_CMD += --disable-syslog +#CONFIG_CMD += --disable-table +#CONFIG_CMD += --disable-tail +#CONFIG_CMD += --disable-tail_csv +#CONFIG_CMD += --disable-tape +CONFIG_CMD += --disable-target_notification +CONFIG_CMD += --disable-target_replace +CONFIG_CMD += --disable-target_scale +CONFIG_CMD += --disable-target_set +CONFIG_CMD += --disable-target_v5upgrade +#CONFIG_CMD += --disable-tcpconns +#CONFIG_CMD += --disable-teamspeak2 +#CONFIG_CMD += --disable-ted +#CONFIG_CMD += --disable-thermal +CONFIG_CMD += --disable-threshold +#CONFIG_CMD += --disable-tokyotyrant +#CONFIG_CMD += --disable-turbostat +#CONFIG_CMD += --disable-ubi +#CONFIG_CMD += --disable-unixsock +#CONFIG_CMD += --disable-users +#CONFIG_CMD += --disable-uuid +#CONFIG_CMD += --disable-varnish +#CONFIG_CMD += --disable-virt +#CONFIG_CMD += --disable-vmem +#CONFIG_CMD += --disable-vserver +#CONFIG_CMD += --disable-wireless +CONFIG_CMD += --disable-write_graphite +#CONFIG_CMD += --disable-write_http +CONFIG_CMD += --disable-write_influxdb_udp +CONFIG_CMD += --disable-write_kafka +#CONFIG_CMD += --disable-write_log +CONFIG_CMD += --disable-write_mongodb +CONFIG_CMD += --disable-write_prometheus +CONFIG_CMD += --disable-write_redis +CONFIG_CMD += --disable-write_riemann +CONFIG_CMD += --disable-write_sensu +#CONFIG_CMD += --disable-write_stackdriver +CONFIG_CMD += --disable-write_syslog +CONFIG_CMD += --disable-write_tsdb +#CONFIG_CMD += --disable-xencpu +#CONFIG_CMD += --disable-zfs_arc +#CONFIG_CMD += --disable-zone +#CONFIG_CMD += --disable-zookeeper +CONFIG_CMD += --enable-debug +else CONFIG_CMD += --enable-syslog CONFIG_CMD += --enable-logfile CONFIG_CMD += --with-libpqos=$(LIBPQOS_DIR) @@ -47,9 +227,17 @@ CONFIG_CMD += --with-libjevents=/usr/local CONFIG_CMD += --enable-exec CONFIG_CMD += --enable-python CONFIG_CMD += --enable-threshold +CONFIG_CMD += --enable-write_redis CONFIG_CMD += --disable-perl CONFIG_CMD += --with-librdkafka=/usr CONFIG_CMD += --disable-lvm +endif + +ifdef WITH_DPDK +CONFIG_CMD += LIBDPDK_CFLAGS='-mssse3' +endif + +CONFIG_CMD += $(COLLECTD_CONFIG_CMD_ARGS) .PHONY: install force_install config force_make @@ -60,12 +248,11 @@ all: force_make @echo "Finished making $(WORK_DIR)" config $(WORK_DIR)/Makefile: $(WORK_DIR)/configure + @echo "Configuring with: " $(CONFIG_CMD) $(AT)cd $(WORK_DIR); $(CONFIG_CMD) @echo "Configure done" force_make: $(WORK_DIR)/Makefile - $(AT)cd $(WORK_DIR) && git pull $(COLLECTD_URL) $(COLLECTD_TAG) - @echo "git pull done" $(AT) $(MAKE) -C $(WORK_DIR) $(MORE_MAKE_FLAGS) @echo "Make done" @@ -81,7 +268,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 @@ -106,19 +295,22 @@ sanity: .PHONY: boot # boot collectd is the process to produce the script 'configure' -boot $(WORK_DIR)/configure: +boot $(WORK_DIR)/configure: $(TAG_DONE_FLAG) @echo "booting up collectd" $(AT)cd $(WORK_DIR); $(BUILD_CMD) @echo "done booting collectd" -boot $(WORK_DIR)/configure: $(TAG_DONE_FLAG) - $(WORK_DIR): $(AT)git clone $(COLLECTD_URL) $(TAG_DONE_FLAG): $(WORK_DIR) - $(AT)cd collectd; git checkout $(COLLECTD_TAG) + @echo "Checking out collectd from tag: $(COLLECTD_TAG)" + $(AT)cd collectd; git fetch origin $(COLLECTD_TAG); git checkout FETCH_HEAD ifneq ($(PATCH_FILE),) $(AT)cd $(WORK_DIR); patch -p1 < ../$(PATCH_FILE) endif +ifeq ($(COLLECTD_USE_EXPERIMENTAL_PR), y) + @echo "Applying experimental pull requests" + $(AT)cd $(WORK_DIR); ../collectd_apply_pull_request.sh +endif $(AT)touch $@ diff --git a/src/collectd/collectd_apply_pull_request.sh b/src/collectd/collectd_apply_pull_request.sh new file mode 100755 index 00000000..403d78dd --- /dev/null +++ b/src/collectd/collectd_apply_pull_request.sh @@ -0,0 +1,50 @@ +#! /bin/bash +# Copyright 2019-2021 Intel Corporation, Anuket and others. +# All rights reserved. +# +# 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. +# + +# This files contains list of pull requests to be applied on top +# of main branch before building collectd included in docker +# collectd-experimental container + +# Use this script with a COLLECTD_PULL_REQUESTS variable defined +# for example: +# COLLECTD_PULL_REQUESTS="3027,3028" ./collectd_apply_pull_request.sh + +if [ -z "$COLLECTD_PULL_REQUESTS" ]; +then + echo "COLLECTD_PULL_REQUESTS is unset, exiting" + exit +fi + +IFS=', ' read -a PULL_REQUESTS <<< "$COLLECTD_PULL_REQUESTS" + +# during rebasing/merging git requires email & name to be set +git config user.email "barometer-experimental@container" +git config user.name "BarometerExperimental" + +# If there's a single PR listed, just check it out +if [ "${#PULL_REQUESTS[@]}" -eq "1" ]; +then + echo "Checking out pull request $COLLECTD_PULL_REQUESTS" + git fetch origin pull/$COLLECTD_PULL_REQUESTS/head && git checkout FETCH_HEAD +else +# if there are multiple PRs, rebase them on top of the checked out branch + for PR_ID in "${PULL_REQUESTS[@]}" + do + echo "Applying pull request $PR_ID" + git pull --rebase origin pull/$PR_ID/head + done +fi diff --git a/src/collectd/collectd_sample_configs-experimental/README b/src/collectd/collectd_sample_configs-experimental/README new file mode 100644 index 00000000..e4386358 --- /dev/null +++ b/src/collectd/collectd_sample_configs-experimental/README @@ -0,0 +1 @@ +Place here configuration files that are required by experimental pull requests diff --git a/src/collectd/collectd_sample_configs-latest/capabilities.conf b/src/collectd/collectd_sample_configs-latest/capabilities.conf new file mode 100644 index 00000000..a422b702 --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/capabilities.conf @@ -0,0 +1,20 @@ +# Copyright 2019 OPNFV and Intel Corporation +# +# 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 capabilities + +<Plugin capabilities> + Port "9564" +</Plugin> + diff --git a/src/collectd/collectd_sample_configs/dpdkstat.conf b/src/collectd/collectd_sample_configs-latest/csv.conf index 919e6e6e..99a8498d 100644 --- a/src/collectd/collectd_sample_configs/dpdkstat.conf +++ b/src/collectd/collectd_sample_configs-latest/csv.conf @@ -11,14 +11,9 @@ # 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" +LoadPlugin csv +<Plugin csv> + DataDir "/tmp/collectd/csv" + StoreRates false </Plugin> - diff --git a/src/collectd/collectd_sample_configs-latest/default_plugins.conf b/src/collectd/collectd_sample_configs-latest/default_plugins.conf new file mode 100644 index 00000000..c96b0076 --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/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-latest/exec.conf b/src/collectd/collectd_sample_configs-latest/exec.conf new file mode 100644 index 00000000..0a291bdb --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/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-latest/hugepages.conf b/src/collectd/collectd_sample_configs-latest/hugepages.conf new file mode 100644 index 00000000..97cd2d17 --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/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-latest/intel_pmu.conf b/src/collectd/collectd_sample_configs-latest/intel_pmu.conf new file mode 100644 index 00000000..959fb8a1 --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/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-latest/kafka.conf b/src/collectd/collectd_sample_configs-latest/kafka.conf new file mode 100644 index 00000000..f81e87fd --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/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-latest/logparser.conf b/src/collectd/collectd_sample_configs-latest/logparser.conf new file mode 100644 index 00000000..1f1a725b --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/logparser.conf @@ -0,0 +1,75 @@ +# Copyright 2019 Intel Corporation and OPNFV. All rights reserved. +# +# 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 logparser + +<Plugin logparser> + <Logfile "/var/log/syslog"> + FirstFullRead false + <Message "pcie_errors"> + DefaultType "pcie_error" + DefaultSeverity "warning" + <Match "aer error"> + Regex "AER:.*error received" + SubmatchIdx -1 + </Match> + <Match "incident time"> + Regex "(... .. ..:..:..) .* pcieport.*AER" + SubmatchIdx 1 + IsMandatory false + </Match> + <Match "root port"> + Regex "pcieport (.*): AER:" + SubmatchIdx 1 + IsMandatory true + </Match> + <Match "device"> + PluginInstance true + Regex " ([0-9a-fA-F:\\.]*): PCIe Bus Error" + SubmatchIdx 1 + IsMandatory false + </Match> + <Match "severity_mandatory"> + Regex "severity=" + SubMatchIdx -1 + </Match> + <Match "nonfatal"> + Regex "severity=.*\\([nN]on-[fF]atal" + TypeInstance "non_fatal" + IsMandatory false + </Match> + <Match "fatal"> + Regex "severity=.*\\([fF]atal" + Severity "failure" + TypeInstance "fatal" + IsMandatory false + </Match> + <Match "corrected"> + Regex "severity=Corrected" + TypeInstance "correctable" + IsMandatory false + </Match> + <Match "error type"> + Regex "type=(.*)," + SubmatchIdx 1 + IsMandatory false + </Match> + <Match "id"> + Regex ", id=(.*)" + SubmatchIdx 1 + </Match> + </Message> + </Logfile> +</Plugin> diff --git a/src/collectd/collectd_sample_configs/dpdkevents.conf b/src/collectd/collectd_sample_configs-latest/mcelog.conf index fdb6f3db..633a3bcd 100644 --- a/src/collectd/collectd_sample_configs/dpdkevents.conf +++ b/src/collectd/collectd_sample_configs-latest/mcelog.conf @@ -11,25 +11,14 @@ # 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> +<LoadPlugin mcelog> 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 mcelog> + <Memory> + McelogClientSocket "/var/run/mcelog-client" + PersistentNotification false + </Memory> +## McelogLogfile "/var/log/mcelog" </Plugin> diff --git a/src/collectd/collectd_sample_configs-latest/network.conf b/src/collectd/collectd_sample_configs-latest/network.conf new file mode 100644 index 00000000..4309ed86 --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/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-latest/ovs_events.conf b/src/collectd/collectd_sample_configs-latest/ovs_events.conf new file mode 100644 index 00000000..250e1e43 --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/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-latest/ovs_pmd_stats.sh b/src/collectd/collectd_sample_configs-latest/ovs_pmd_stats.sh new file mode 100755 index 00000000..78e72047 --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/ovs_pmd_stats.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright 2017-2019 Intel Corporation and OPNFV. All rights reserved. +# +# 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-latest/ovs_stats.conf b/src/collectd/collectd_sample_configs-latest/ovs_stats.conf new file mode 100644 index 00000000..2a6d2fb2 --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/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-latest/pcie_errors.conf b/src/collectd/collectd_sample_configs-latest/pcie_errors.conf new file mode 100644 index 00000000..de9b7533 --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/pcie_errors.conf @@ -0,0 +1,21 @@ +# Copyright 2019 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 pcie_errors> + Interval 0.01 +</LoadPlugin> + +<Plugin pcie_errors> + PersistentNotifications false +</Plugin> diff --git a/src/collectd/collectd_sample_configs-latest/prometheus.conf b/src/collectd/collectd_sample_configs-latest/prometheus.conf new file mode 100644 index 00000000..13ef328e --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/prometheus.conf @@ -0,0 +1,19 @@ +#Copyright 2019 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_prometheus + +<Plugin "write_prometheus"> + Port "9103" +</Plugin> diff --git a/src/collectd/collectd_sample_configs-latest/rdt.conf b/src/collectd/collectd_sample_configs-latest/rdt.conf new file mode 100644 index 00000000..ae983dc0 --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/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-latest/snmp_agent.conf b/src/collectd/collectd_sample_configs-latest/snmp_agent.conf new file mode 100644 index 00000000..7cbde816 --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/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-latest/virt.conf b/src/collectd/collectd_sample_configs-latest/virt.conf new file mode 100644 index 00000000..88229e3c --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/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-latest/write_notification.sh b/src/collectd/collectd_sample_configs-latest/write_notification.sh new file mode 100755 index 00000000..47ae9a83 --- /dev/null +++ b/src/collectd/collectd_sample_configs-latest/write_notification.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Copyright 2017-2019 Intel Corporation and OPNFV. All rights reserved. +# +# 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/collectd_sample_configs/capabilities.conf b/src/collectd/collectd_sample_configs/capabilities.conf new file mode 100644 index 00000000..a422b702 --- /dev/null +++ b/src/collectd/collectd_sample_configs/capabilities.conf @@ -0,0 +1,20 @@ +# Copyright 2019 OPNFV and Intel Corporation +# +# 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 capabilities + +<Plugin capabilities> + Port "9564" +</Plugin> + diff --git a/src/collectd/collectd_sample_configs/dpdk_telemetry.conf b/src/collectd/collectd_sample_configs/dpdk_telemetry.conf new file mode 100644 index 00000000..3bc0dd15 --- /dev/null +++ b/src/collectd/collectd_sample_configs/dpdk_telemetry.conf @@ -0,0 +1,22 @@ +#Copyright 2020 OPNFV and Intel Corporation +# +# 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 dpdk_telemetry> + Interval 1 +</LoadPlugin> + +<Plugin dpdk_telemetry> + ClientSocketPath "/var/run/.client" + DpdkSocketPath "/var/run/dpdk/rte/telemetry" +</Plugin> diff --git a/src/collectd/collectd_sample_configs/intel_pmu.conf b/src/collectd/collectd_sample_configs/intel_pmu.conf index db83e4bb..c4beee0c 100644 --- a/src/collectd/collectd_sample_configs/intel_pmu.conf +++ b/src/collectd/collectd_sample_configs/intel_pmu.conf @@ -1,4 +1,4 @@ -# Copyright 2017 OPNFV +# Copyright 2017-21 Anuket and others # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -11,12 +11,16 @@ # 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 + +<LoadPlugin intel_pmu> + Interval 1 +</LoadPlugin> <Plugin intel_pmu> ReportHardwareCacheEvents true ReportKernelPMUEvents true ReportSoftwareEvents true -# EventList "/var/cache/pmu/GenuineIntel-6-2D-core.json" +# EventList "$HOME/.cache/pmu-events/GenuineIntel-6-2D-core.json" # HardwareEvents "L2_RQSTS.CODE_RD_HIT,L2_RQSTS.CODE_RD_MISS" "L2_RQSTS.ALL_CODE_RD" + Cores "" </Plugin> diff --git a/src/collectd/collectd_sample_configs/logparser.conf b/src/collectd/collectd_sample_configs/logparser.conf new file mode 100644 index 00000000..1f1a725b --- /dev/null +++ b/src/collectd/collectd_sample_configs/logparser.conf @@ -0,0 +1,75 @@ +# Copyright 2019 Intel Corporation and OPNFV. All rights reserved. +# +# 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 logparser + +<Plugin logparser> + <Logfile "/var/log/syslog"> + FirstFullRead false + <Message "pcie_errors"> + DefaultType "pcie_error" + DefaultSeverity "warning" + <Match "aer error"> + Regex "AER:.*error received" + SubmatchIdx -1 + </Match> + <Match "incident time"> + Regex "(... .. ..:..:..) .* pcieport.*AER" + SubmatchIdx 1 + IsMandatory false + </Match> + <Match "root port"> + Regex "pcieport (.*): AER:" + SubmatchIdx 1 + IsMandatory true + </Match> + <Match "device"> + PluginInstance true + Regex " ([0-9a-fA-F:\\.]*): PCIe Bus Error" + SubmatchIdx 1 + IsMandatory false + </Match> + <Match "severity_mandatory"> + Regex "severity=" + SubMatchIdx -1 + </Match> + <Match "nonfatal"> + Regex "severity=.*\\([nN]on-[fF]atal" + TypeInstance "non_fatal" + IsMandatory false + </Match> + <Match "fatal"> + Regex "severity=.*\\([fF]atal" + Severity "failure" + TypeInstance "fatal" + IsMandatory false + </Match> + <Match "corrected"> + Regex "severity=Corrected" + TypeInstance "correctable" + IsMandatory false + </Match> + <Match "error type"> + Regex "type=(.*)," + SubmatchIdx 1 + IsMandatory false + </Match> + <Match "id"> + Regex ", id=(.*)" + SubmatchIdx 1 + </Match> + </Message> + </Logfile> +</Plugin> diff --git a/src/collectd/collectd_sample_configs/ovs_pmd_stats.sh b/src/collectd/collectd_sample_configs/ovs_pmd_stats.sh index 0517717f..d3e83d82 100755 --- a/src/collectd/collectd_sample_configs/ovs_pmd_stats.sh +++ b/src/collectd/collectd_sample_configs/ovs_pmd_stats.sh @@ -1,15 +1,16 @@ #!/bin/bash -# Copyright 2017 OPNFV +# Copyright 2017-2019 Intel Corporation and OPNFV. All rights reserved. # # 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 +# 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/snmp_agent.conf b/src/collectd/collectd_sample_configs/snmp_agent.conf index a4511a94..7452ccae 100644 --- a/src/collectd/collectd_sample_configs/snmp_agent.conf +++ b/src/collectd/collectd_sample_configs/snmp_agent.conf @@ -17,7 +17,6 @@ LoadPlugin snmp_agent <Table "pmuTable"> IndexOID "INTEL-PMU-MIB::pmuGroupIndex" <Data "pmuGroupDescr"> - Instance true Plugin "intel_pmu" OIDs "INTEL-PMU-MIB::pmuGroupDescr" </Data> @@ -279,7 +278,6 @@ LoadPlugin snmp_agent IndexOID "INTEL-RDT-MIB::rdtGroupIndex" SizeOID "INTEL-RDT-MIB::rdtGroupNumber" <Data "rdtGroupDescr"> - Instance true Plugin "intel_rdt" OIDs "INTEL-RDT-MIB::rdtGroupDescr" </Data> @@ -311,7 +309,6 @@ LoadPlugin snmp_agent <Table "mcelogTable"> IndexOID "INTEL-MCELOG-MIB::memoryGroupIndex" <Data "memoryGroupDescr"> - Instance true Plugin "mcelog" OIDs "INTEL-MCELOG-MIB::memoryGroupDescr" </Data> @@ -343,7 +340,6 @@ LoadPlugin snmp_agent # Hugepages <Table "hugepagesTable"> <Data "hugepagesNode"> - Instance true Plugin "hugepages" OIDs "INTEL-HUGEPAGES-MIB::hugepagesNode" </Data> diff --git a/src/collectd/collectd_sample_configs/write_notification.sh b/src/collectd/collectd_sample_configs/write_notification.sh index ed6ed9e2..47ae9a83 100755 --- a/src/collectd/collectd_sample_configs/write_notification.sh +++ b/src/collectd/collectd_sample_configs/write_notification.sh @@ -1,17 +1,18 @@ #!/bin/bash -# Copyright 2017 OPNFV +# Copyright 2017-2019 Intel Corporation and OPNFV. All rights reserved. # # 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 +# 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 diff --git a/src/collectd/include_config.sh b/src/collectd/include_config.sh index dd20893d..f8db0dcf 100755 --- a/src/collectd/include_config.sh +++ b/src/collectd/include_config.sh @@ -1,11 +1,11 @@ #!/bin/bash -# Copyright 2017 OPNFV +# Copyright 2017-2019 Intel Corporation and OPNFV. All rights reserved. # # 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 +# 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, @@ -13,12 +13,32 @@ # 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 +51,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/collectd/ovs_pmd_stats_config.sh b/src/collectd/ovs_pmd_stats_config.sh index bdb0615d..5b6f490e 100755 --- a/src/collectd/ovs_pmd_stats_config.sh +++ b/src/collectd/ovs_pmd_stats_config.sh @@ -1,17 +1,18 @@ #!/bin/bash -# Copyright 2017 OPNFV +# Copyright 2017-2019 Intel Corporation and OPNFV. All rights reserved. # # 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 +# 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. +# export CURRENT_DIR=$(pwd) diff --git a/src/collectd/snmp_mib_config.sh b/src/collectd/snmp_mib_config.sh index a2c44db1..a1ff677f 100755 --- a/src/collectd/snmp_mib_config.sh +++ b/src/collectd/snmp_mib_config.sh @@ -1,17 +1,18 @@ #!/bin/bash -# Copyright 2017 OPNFV +# Copyright 2017-2019 Intel Corporation and OPNFV. All rights reserved. # # 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 +# 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. +# export CURRENT_DIR=$(pwd) |