zabbix-cloudwatch 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +32 -25
- data/lib/zabbix-cloudwatch/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
|
4
|
-
|
3
|
+
metadata.gz: 20e69415398bb85c6d7d8541c92b271de26b64d3
|
4
|
+
data.tar.gz: 94a08809d18903fe2d358e1601761dd75957ee96
|
5
5
|
SHA512:
|
6
|
-
|
7
|
-
|
6
|
+
metadata.gz: 11784a6df6ded7584105843bdadd452cf48c4b78cda4775e6ca2041c918fec769702801dac08132da44a3615b101f48bacc7857e21200810a82803df9b6198fa
|
7
|
+
data.tar.gz: 298df00a3a466cdb900220e31a3db8a82f93d50feb5fabf6f2eac08809867b110470fae2f26cb0ee880aba0293b54920d2adc2d169a749363adcedc3c91bfea2
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
An external script for getting cloudwatch metrics into Zabbix
|
5
5
|
|
6
6
|
```
|
7
|
-
Usage:
|
7
|
+
Usage: zabbix-cloudwatch
|
8
8
|
|
9
9
|
-h, --help This Message
|
10
10
|
-n, --namespace Namespace (AWS/Autoscaling, AWS/EC2, etc...)
|
@@ -13,33 +13,32 @@ Usage: get_aws_cloudwatch_metric.rb
|
|
13
13
|
-v, --dimension-value Dimension Value
|
14
14
|
-t, --monitoring-type detailed|basic Default: basic
|
15
15
|
-s, --statistic Minimum|Maximum|Average|Sum|SampleCount Default: Average
|
16
|
+
--aws-access-key AWS Access Key
|
17
|
+
--aws-secret-key AWS Secret Key
|
18
|
+
--aws-region AWS Region (us-east-1) Default: us-east-1
|
16
19
|
```
|
17
20
|
|
18
21
|
## Getting it running
|
19
22
|
|
20
|
-
* It is only guaranteed to work on ruby 1.8.7 at this time.
|
23
|
+
* It is only guaranteed to work on ruby 1.8.7 at this time and will throw an Exception on other rubies.
|
21
24
|
* for some of the gem dependencies, you will need the ruby development packages, gcc, libxml2, and libxslt
|
22
25
|
|
23
26
|
Modify these steps to taste (examples given running on the Amazon AMI 2013.03):
|
24
27
|
```
|
25
|
-
# git clone git@github.com:randywallace/zabbix-cloudwatch.git /usr/local/zabbix-cloudwatch
|
26
|
-
# cd /usr/local/zabbix-cloudwatch
|
27
|
-
# chown zabbix:zabbix get_aws_cloudwatch_metric.rb
|
28
28
|
# yum install ruby ruby-devel rubygems gcc libxml2-devel libxslt-devel
|
29
|
-
# gem install bundler
|
30
|
-
#
|
31
|
-
# ln -s /usr/local/zabbix-cloudwatch/get_aws_cloudwatch_metric.rb /var/lib/zabbixsrv/externalscripts/get_aws_cloudwatch_metric.rb
|
29
|
+
# gem install bundler zabbix-cloudwatch
|
30
|
+
# ln -s $(which zabbix-cloudwatch) /var/lib/zabbixsrv/externalscripts/zabbix-cloudwatch
|
32
31
|
```
|
33
32
|
|
34
33
|
## Examples
|
35
34
|
|
36
35
|
```
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
36
|
+
zabbix-cloudwatch -n AWS/EC2 \
|
37
|
+
-m CPUUtilization \
|
38
|
+
-d AutoScalingGroupName \
|
39
|
+
-v your-auto-scaling-group \
|
40
|
+
-t detailed \
|
41
|
+
-s Sum
|
43
42
|
```
|
44
43
|
|
45
44
|
## Creating the IAM User
|
@@ -51,24 +50,32 @@ The following actions need to be allowed in IAM for this script to work with the
|
|
51
50
|
"cloudwatch:GetMetricStatistics"
|
52
51
|
```
|
53
52
|
|
54
|
-
##
|
53
|
+
## AWS Credentials
|
55
54
|
|
56
|
-
|
57
|
-
variables for your AWS Credentials.
|
55
|
+
There are (3) ways to get your AWS Credentials into `zabbix-cloudwatch`.
|
58
56
|
|
59
|
-
|
57
|
+
**Note that *none* of these options are "safe", so make sure you are using a set of IAM Keys with extremely restricted
|
58
|
+
permissions.**
|
60
59
|
|
61
|
-
###
|
60
|
+
### 1. Environment Variables (which is difficult with Zabbix):
|
62
61
|
```
|
63
62
|
export AWS_ACCESS_KEY_ID="YOUR ACCESS KEY"
|
64
63
|
export AWS_SECRET_ACCESS_KEY="YOUR SECRET ACCESS KEY"
|
65
64
|
export AWS_REGION="YOUR AWS REGION"
|
66
65
|
```
|
67
66
|
|
68
|
-
###
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
67
|
+
### 2. Within the binary in the gem.
|
68
|
+
|
69
|
+
Find it with `which zabbix-cloudwatch`. If you intend to do it this way, I suggest you make a copy of the binary
|
70
|
+
and place it in your zabbix externalscript path (instead of the suggested symlink in the installation example).
|
71
|
+
|
72
|
+
The class variables for this are at the very top of the file for your convenience.
|
73
|
+
|
74
|
+
### 3. Passing in your AWS Keys when you run zabbix-cloudwatch using the command line flags.
|
75
|
+
|
76
|
+
The order of preference that this gem uses for the region and keys (individually) are:
|
77
|
+
|
78
|
+
* Commandline flag
|
79
|
+
* Within the binary
|
80
|
+
* Environment Variable
|
74
81
|
|