${command_to_install} mysql-client mysql-server mysql-libs MySQL-python
MYSQL_PASSWORD=$(cat /root/.mysql_secret | head -1 | awk -F': ' '{print $2}')
fi
- mycnf=$(find /etc/ -name my.cnf)
- cat $mycnf
service mysql restart
sleep 10
if [ ! -z "${MYSQL_PASSWORD}" ]; then
pip install pika==0.9.8
echo '#!/usr/bin/env python
import pika
+import uuid
connection = pika.BlockingConnection(pika.ConnectionParameters(host="127.0.0.1"))
channel = connection.channel()
channel.queue_declare(queue="notifications.info")
-test=r'"'"'{"event_type": "compute.instance.update", "_unique_id": "fake", "payload": {"ephemeral_gb": 0, "instance_id": "fake", "user_id": "fake", "root_gb": 0, "tenant_id": "fake", "memory_mb": 64, "vcpus": 1}, "priority": "INFO"}'"'"'
+test='"'"'{"event_type": "compute.instance.create", "payload": {"instance_id": "fake", "memory_mb": 512, "disk_gb": 20, "root_gb": 20, "ephemeral_gb": 0, "vcpus": 1, "instance_type_id": 1, "state": "fake"}, "publisher_id": "fake", "priority":"INFO", "message_id": "%s"}'"'"' % uuid.uuid4()
channel.basic_publish(exchange="nova", routing_key="notifications.info",
properties=pika.BasicProperties(priority=0, delivery_mode=2, headers="", content_encoding="utf-8", content_type="application/json"),
body=test)
fi
# Events
- #if [ -z "$(ceilometer ${ceilometer_auth_string} event-list | grep fake)" ]; then
- # exit_on_error 1 "Events wasn't created"
- #fi
+ if [ -z "$(ceilometer ${ceilometer_auth_string} event-list | grep fake)" ]; then
+ exit_on_error 1 "Events wasn't created"
+ fi
# Alarming
ceilometer -dv ${ceilometer_auth_string} alarm-threshold-create --name cpu_high --description 'instance running hot' \