我正在使用mon-script从 AWS 实例中检索内存。在 aws 控制台中,一切都很好,但在 api 数据点中只返回空。这真的很令人困惑,因为在 boto(Python 版本)中,一切都很好并且响应正确,但在 php 中不是
这是我的代码
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')
);