-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodenotes
More file actions
71 lines (35 loc) · 2.25 KB
/
codenotes
File metadata and controls
71 lines (35 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
ceilometer alarm-threshold-create --name cpu_high --description 'instance running hot' \
--meter-name cpu_util --threshold 70.0 --comparison-operator gt --statistic avg \
--period 600 --evaluation-periods 3 \
--alarm-action 'log://' \
--query resource_id=<INSTANCE_ID>
ceilometer alarm-threshold-create --name bandwidth_high --description 'high incomming bytes' \
--meter-name network_incomming_packets --threshold 148 --comparison-operator gt --statistic avg \
--period 15 --evaluation_periods 1 \
--alarm-action 'log://' \
--query resource_id=26842785-bcc6-4ae6-9ece-dc03e6f24ae5
#webserver create
MYIP=$(ifconfig eth0|grep 'inet addr'|awk -F: '{print $2}'| awk '{print $1}')
while true; do echo -e "HTTP/1.0 200 OK\r\n\r\nWelcome to $MYIP" | sudo nc -l -p 80 ; done&
ceilometerCreateAlarms()
if alarms do not exsit create
else do not create.
alarmdictCPU = {'name':'cpu high%s'%NovaID, 'description':'cpu theshold', 'meter_name':'cpu_util', 'threshold':'30', 'comparison_operator':'gt', 'period':'15', 'evaluation_periods':'1', 'alarm_action': 'log://', 'q':'resource_id =%s'%NovaID}
alarmdictIncomingBytes = {'name':'incoming bytes%s'%NovaID, 'description':'node incoming bytes', 'meter_name':'network.incoming.bytes', 'threshold':'180', 'comparison_operator':'gt', 'period':'15', 'evaluation_periods':'1', 'alarm_action': 'log://', 'q':'resource_id =%s'%NovaID}
getCeilometer().alarms.create(aodh_enabled=True,**alarmdictCPU)
getCeilometer().alarms.create(aodh_enabled=True,**alarmdictIncomingBytes)
ceilometerGetState()
getCeilometer().alarms.get_state(alarmID)
if true or false call graphAlarmData() and heatAddNode() or heatRemoveNode()
when adding node save amount of current nodes to file and add one. If get state runs again and is false it shoudld
call heatRemoveNode() only if the count of nodes is > 2.
graphAlarmData()
#poll the sample list get about 20 logs (timestamp), instanceid, and volume.
graph the volume with timestamp on x, instance id and name in corner, volume on y.
heatAddNode()
heatRemoveNode()
yum install openstack-heat-api openstack-heat-engine \
openstack-heat-api-cfn
Ceilometer log file:
sudo cat /etc/ceilometer/ceilometer.conf | grep log_dir
log_dir = /var/log/ceilometer