1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3 .. (c) OPNFV, Intel Corporation and others.
5 ==========================
6 VES Application User Guide
7 ==========================
8 The Barometer repository contains a python based application for VES.
10 The application currently supports pushing platform relevant metrics through the
11 additional measurements field for VES.
13 Collectd has a write_kafka plugin that will send collectd metrics and values to
15 The VES application uses Kafka Consumer to receive metrics from the Kafka
18 Installation Instructions:
19 --------------------------
24 git clone https://gerrit.opnfv.org/gerrit/barometer
30 $ sudo apt-get install collectd
36 $ sudo yum install collectd
38 .. note:: You may need to add epel repository if the above does not work.
42 $ sudo yun install epel-release
44 3. Modify the collectd configuration script: `/etc/collectd/collectd.conf`
49 Property "metadata.broker.list" "localhost:9092"
57 The above configuration is for a single host setup. Simply change localhost to remote
58 server IP addess or hostname.
63 1. Dependencies: install JAVA & Zookeeper.
69 $ sudo apt install default-jre
75 $ sudo yum install java-1.6.0-openjdk
81 $ sudo apt install zookeeperd
87 $ sudo yum install zookeeper
89 .. note:: You may need to add the the repository that contains zookeeper
94 https://archive.cloudera.com/cdh5/one-click-install/redhat/7/x86_64/cloudera-cdh-5-0.x86_64.rpm
96 CentOS 7.x start zookeeper:
100 $ sudo zookeeper-server start
102 To test if Zookeeper is running as a daemon.
106 $ sudo telnet localhost 2181
108 Type 'ruok' & hit enter.
109 Expected response is 'imok'. Zookeeper is running fine.
113 VES doesn't work with version 0.9.4 of kafka-python.
114 The recommended/tested version is 1.3.3.
118 $ sudo pip install kafka-python
124 $ sudo wget "http://www-eu.apache.org/dist/kafka/0.11.0.0/kafka_2.11-0.11.0.0.tgz"
126 3. Extract the archive:
130 $ sudo tar -xvzf kafka_2.11-0.11.0.0.tgz
132 4. Configure Kafka Server:
136 $ sudo vi kafka_2.11-0.11.0.0/config/server.properties
138 By default Kafka does not allow you to delete topics. Please uncomment:
142 delete.topic.enable=true
144 5. Start the Kafka Server.
146 Run 'kafka-server-start.sh' with nohup as a background process:
150 $ sudo nohup kafka_2.11-0.11.0.0/bin/kafka-server-start.sh \
151 kafka_2.11-0.11.0.0/config/server.properties > kafka_2.11-0.11.0.0/kafka.log 2>&1 &
153 6. Test Kafka Broker Installation
155 To test if the installation worked correctly there are two scripts, producer and consumer scripts.
156 These will allow you to see messages pushed to broker and receive from broker.
158 Producer (Publish "Hello World"):
162 $ echo "Hello, World" | kafka_2.11-0.11.0.0/bin/kafka-console-producer.sh \
163 --broker-list localhost:9092 --topic TopicTest > /dev/null
165 Consumer (Receive "Hello World"):
169 $ kafka_2.11-0.11.0.0/bin/kafka-console-consumer.sh --zookeeper \
170 localhost:2181 --topic TopicTest --from-beginning
173 VES application configuration description:
174 ------------------------------------------
176 Within the VES directory there is a configuration file called 'ves_app.conf'.
178 .. note:: Details of the Vendor Event Listener REST service
180 REST resources are defined with respect to a ServerRoot:
184 ServerRoot = https://{Domain}:{Port}/{optionalRoutingPath}
186 REST resources are of the form:
190 {ServerRoot}/eventListener/v{apiVersion}`
191 {ServerRoot}/eventListener/v{apiVersion}/{topicName}`
192 {ServerRoot}/eventListener/v{apiVersion}/eventBatch`
195 VES domain name. It can be IP address or hostname of VES collector
196 (default: `127.0.0.1`)
199 VES port (default: `30000`)
202 Used as the "optionalRoutingPath" element in the REST path (default: `empty`)
205 Used as the "topicName" element in the REST path (default: `empty`)
207 **UseHttps** *true|false*
208 Allow application to use HTTPS instead of HTTP (default: `false`)
210 **Username** *"username"*
211 VES collector user name (default: `empty`)
213 **Password** *"passwd"*
214 VES collector password (default: `empty`)
216 **FunctionalRole** *"role"*
217 Used as the 'functionalRole' field of 'commonEventHeader' event (default:
218 `Collectd VES Agent`)
220 **SendEventInterval** *interval*
221 This configuration option controls how often (sec) collectd data is sent to
222 Vendor Event Listener (default: `20`)
224 **ApiVersion** *version*
225 Used as the "apiVersion" element in the REST path (default: `5.1`)
228 Kafka Port (Default ``9092``)
230 **KafkaBroker** *host*
231 Kafka Broker domain name. It can be an IP address or hostname of local or remote server
234 Other collectd.conf configurations
235 ----------------------------------
236 Please ensure that FQDNLookup is set to false
242 Please ensure that the virt plugin is enabled and configured as follows.
249 Connection "qemu:///system"
252 PluginInstanceFormat name
253 ExtraStats "cpu_util perf"
257 .. note:: For more detailed information on the `virt` plugin configuration,
258 requirements etc., please see the userguide of the collectd virt plugin.
260 Please ensure that the cpu plugin is enabled and configured as follows
268 ValuesPercentage true
273 The ``ReportByCpu`` option should be set to `true` (default)
274 if VES application is running on guest machine ('GuestRunning' = true).
276 Please ensure that the aggregation plugin is enabled and configured as follows
277 (required if 'GuestRunning' = true)
281 LoadPlugin aggregation
288 GroupBy "TypeInstance"
289 SetPlugin "cpu-aggregation"
290 CalculateAverage true
294 If application is running on a guest side, it is important to enable uuid plugin
295 too. In this case the hostname in event message will be represented as UUID
296 instead of system host name.
302 If a custom UUID needs to be provided, the following configuration is required in collectd.conf
311 Where "/etc/uuid" is a file containing custom UUID.
313 Please also ensure that the following plugins are enabled:
321 VES application with collectd notifications example
322 ---------------------------------------------------
324 A good example of collectD notification is monitoring of the total CPU usage on a VM
325 using the 'threshold' plugin. The following configuration will setup VES plugin to send 'Fault'
326 event every time a total VM CPU value is out of range (e.g.: WARNING: VM CPU TOTAL > 50%,
327 CRITICAL: VM CPU TOTAL > 96%) and send 'Fault' NORMAL event if the CPU value is back
328 to normal. In the example below, there is one VM with two CPUs configured which is running
329 on the host with a total of 48 cores. Thus, the threshold value 2.08 (100/48) means that
330 one CPU of the VM is fully loaded (e.g.: 50% of total CPU usage of the VM) and 4.0 means
331 96% of total CPU usage of the VM. Those values can also be obtained by virt-top
343 Instance "virt_cpu_total"
348 More detailed information on how to configure collectD thresholds can be found at
349 https://collectd.org/documentation/manpages/collectd-threshold.5.shtml