-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtemplates.php
26 lines (24 loc) · 919 Bytes
/
templates.php
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
<?php
$toWatch = array();
$loadBalancerTemplate = array(
'namespace' => 'AWS/ELB',
'metrics' => array(
'RequestCount' => array('Sum'),
'HTTPCode_Backend_2XX' => array('Sum'),
'HTTPCode_Backend_4XX' => array('Sum'),
'HTTPCode_Backend_5XX' => array('Sum'),
'UnHealthyHostCount' => array('Average'),
'HealthyHostCount' => array('Average'),
'Latency' => array('Average', 'Maximum'),
),
);
if (isset($loadBalancers) && is_array($loadBalancers)) {
foreach ($loadBalancers as $to => $lb) {
$thisConfig = $loadBalancerTemplate;
$thisConfig['to'] = $to;
$thisConfig['creds'] = $lb['creds'];
$thisConfig['region'] = $lb['region'];
$thisConfig['dimensions'] = array('LoadBalancerName' => $lb['name']);
$toWatch[$to] = $thisConfig;
}
}