0

im using mon-script for retriving Memory From AWS Instances .in aws console every thing is ok but in api datapoint just return empty .it's really confusing because in boto(Python Version) every thing is ok and response correct but in php not

its my code

header("Content-type: text/html; charset=utf-8");
require_once '../sdk.class.php';
$cw = new AmazonCloudWatch(); 
$response = $cw->get_metric_statistics(
'System/Linux', 'MemoryUtilization',
date("c", strtotime('-5 minute')),
date("c", strtotime('now')),
300,
'Average', 
'Percent',
array('Name'=> 'InstanceId', 'Value'=>'i-8c15b124')
);

2 Answers2

0

I don't know anything about PHP but does the date function you are calling return the time in UTC? If it doesn't, that could be problem because the service expects the timestamps to be in UTC.

garnaat
  • 44,310
  • 7
  • 123
  • 103
0

it solved by upgrade to version3 api .i think itwas a timestamp based problem related to microsecond in php