Bingo! (What great debugging tools :-)
Here's the output of two successive runs with debug=2 in the
boto.connect_cloudwatch() call. Your suspicion is correct - there's no
data in the response from Cloudwatch. (and thus, boto is working
properly. Whew!).
My question is not really one you can necessarily answer, but how can
I get more info about how to proceed? Are there forums at Amazon that
might talk about this? Thanks.
Rich
======== #1 - Didn't work, and the array is empty ==========
[dhcp-65:~/Documents/src/Assorted Programs] richb% echo "key_id
secret_access_key" | ./awscloudwatch.py i-e6f0cf89 CPUUtilization 50
75 95
These are the arguments passed from InterMapper: ['i-e6f0cf89',
'CPUUtilization', '50', '75', '95']
start time is: 2011-06-17 10:31:11.739478
end time is 2011-06-17 10:32:11.739478
send: 'GET /?
AWSAccessKeyId=xxxxxx&Action=GetMetricStatistics&Dimensions.member.
1.Name=InstanceId&Dimensions.member.1.Value=i-
e6f0cf89&EndTime=2011-06-17T10%3A32%3A11.739478&MetricName=CPUUtilization&Namespace=AWS
%2FEC2&Period=60&SignatureMethod=HmacSHA256&SignatureVersion=2&StartTime=2011-06-17T10%3A31%3A11.739478&Statistics.member.
1=Average&Timestamp=2011-06-17T10%3A32%3A12Z&Version=2010-08-01&Signature=xxxxxxxxx
%3D HTTP/1.1\r\nHost:
monitoring.amazonaws.com\r\nAccept-Encoding:
identity\r\nContent-Length: 0\r\nUser-Agent: Boto/2.0rc1 (darwin)\r\n\r
\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: x-amzn-RequestId: 104ca1f6-98cd-11e0-89ea-b9b2d1693c08
header: Content-Type: text/xml
header: Content-Length: 337
header: Date: Fri, 17 Jun 2011 10:32:12 GMT
[]
\{ $CPUUtilization := "[n/a]" }No data returned for InstanceID "i-
e6f0cf89"
======== #2 - about 30 seconds later, worked just fine ==========
[dhcp-65:~/Documents/src/Assorted Programs] richb% echo "key_id
secret_access_key" | ./awscloudwatch.py i-e6f0cf89 CPUUtilization 50
75 95
These are the arguments passed from InterMapper: ['i-e6f0cf89',
'CPUUtilization', '50', '75', '95']
start time is: 2011-06-17 10:31:48.132818
end time is 2011-06-17 10:32:48.132818
send: 'GET /?
AWSAccessKeyId=xxxxxx&Action=GetMetricStatistics&Dimensions.member.
1.Name=InstanceId&Dimensions.member.1.Value=i-
e6f0cf89&EndTime=2011-06-17T10%3A32%3A48.132818&MetricName=CPUUtilization&Namespace=AWS
%2FEC2&Period=60&SignatureMethod=HmacSHA256&SignatureVersion=2&StartTime=2011-06-17T10%3A31%3A48.132818&Statistics.member.
1=Average&Timestamp=2011-06-17T10%3A32%3A48Z&Version=2010-08-01&Signature=xxxxxxxxxx
%3D HTTP/1.1\r\nHost:
monitoring.amazonaws.com\r\nAccept-Encoding:
identity\r\nContent-Length: 0\r\nUser-Agent: Boto/2.0rc1 (darwin)\r\n\r
\n'
reply: 'HTTP/1.1 200 OK\r\n'
header: x-amzn-RequestId: 25c379bb-98cd-11e0-afc5-3b252e0fd632
header: Content-Type: text/xml
header: Content-Length: 498
header: Date: Fri, 17 Jun 2011 10:32:48 GMT
[{u'Timestamp': datetime.datetime(2011, 6, 17, 10, 31), u'Average':
2.6299999999999999, u'Unit': u'Percent'}]
The Average for CPUUtilization is 2.63 Percent
CPUUtilization 2.63 is being used
starting method calculate_threshold with data: 2.63
Nagios Response code is 0
\{ $CPUUtilization := "2.63" }CPUUtilization is 2.63 Percent