├── README.md
├── lambda_code
├── AWS_AmazonSNS.py
└── AWS_Lambda.py
├── scripts
├── AWS_Service_Health_Dashboard.py
├── autoscaling_zabbix.py
├── cloudwatch_zabbix.py
└── lambda_zabbix.py
└── templates
├── 2.2
├── AWS_Service_Health_Dashboard_template.xml
├── AmazonSNS_AWSLambda_Zabbix_template.xml
├── autoscaling_template.xml
├── awsbilling_template.xml
└── cloudwatch_template.xml
└── 3.0
├── AWS_Service_Health_Dashboard_template.xml
├── AmazonSNS_AWSLambda_Zabbix_template.xml
├── autoscaling_template.xml
├── awsbilling_template.xml
└── cloudwatch_template.xml
/README.md:
--------------------------------------------------------------------------------
1 | # Zabbix AWS Monitoring Templates
2 |
3 | This template collection is for effective monitoring AWS(Amazon Web Services) with Zabbix.
4 |
5 | # What templates?
6 |
7 | * Amazon CloudWatch Metrics monitoring Template
8 | * AWS Service Health Dashboard monitoring Template
9 | * AWS EC2 auto scaling monitoring Template
10 | * Amazon SNS monitoring Template (comming soon...)
11 | * AWS Lambda function execution action script (comming soon...)
12 | * Other templates are under considering.
13 |
14 | # Details
15 |
16 | Please check wiki pages.
17 |
18 | * [Amazon CloudWatch Metrics monitoring Template](https://github.com/tech-sketch/zabbix_aws_template/wiki/Amazon-CloudWatch-Metrics-monitoring-Template)
19 | * [AWS Service Health Dashboard monitoring Template](https://github.com/tech-sketch/zabbix_aws_template/wiki/AWS-Service-Health-Dashboard-monitoring-Template)
20 | * [AWS EC2 AutoScaling monitoring Template](https://github.com/tech-sketch/zabbix_aws_template/wiki/AWS-EC2-AutoScaling-monitoring-Template)
21 |
22 | # License
23 |
24 | Licensed under the Apache License, Version 2.0.
25 | The Apache v2 full text is published at this link(http://www.apache.org/licenses/LICENSE-2.0).
26 |
27 | # Contact
28 |
29 | VINX CORP.
30 |
31 | Technical support service is provided by VINX CORP.
32 |
33 | https://www.vinx.co.jp/awszabbix/index.html
34 |
35 | ---
36 | Copyright 2016 TIS Inc.
37 |
--------------------------------------------------------------------------------
/lambda_code/AWS_AmazonSNS.py:
--------------------------------------------------------------------------------
1 | from __future__ import print_function
2 |
3 | import os
4 | import re
5 | import json
6 | import socket
7 | import struct
8 | import time
9 | import calendar
10 | import datetime
11 | import dateutil.parser
12 |
13 | def lambda_handler(event, context):
14 | sns_zabbix = SnsZabbix()
15 | sns_zabbix.make_send_items(event)
16 | sns_zabbix.send_to_zabbix()
17 |
18 | class SnsZabbix:
19 | def __init__(self):
20 | self.zabbix_host = "localhost"
21 | self.zabbix_port = 10051
22 | self.send_items = []
23 |
24 | def make_send_items(self, event):
25 | for record in event['Records']:
26 | event_type = self.__check_event_type(record)
27 | self.__add_send_item(record, event_type)
28 |
29 | def __add_send_item(self, record, event_type):
30 | send_json_string = '{"host":"", "key":"", "value":"", "clock":""}'
31 | send_item = json.loads(send_json_string)
32 | message = json.loads(record['Sns']['Message'])
33 | if event_type == "AutoScaling":
34 | send_item["host"] = "AutoScaling"
35 | value = []
36 | value.append("Event : " + message['Event'])
37 | value.append("Service : " + message['Service'])
38 | value.append("Description : " + message['Description'])
39 | value.append("AvailabilityZone : " + message['Details']['Availability Zone'])
40 | value.append("AutoScalingGroupName : " + message['AutoScalingGroupName'])
41 | value.append("Cause : " + message['Cause'])
42 | value.append("StatusCode : " + message['StatusCode'])
43 | value.append("StatusMessage : " + message['StatusMessage'])
44 | send_item["value"] = os.linesep.join(value)
45 |
46 | elif event_type == "RDS":
47 | send_item["host"] = message["Source ID"]
48 |
49 | value = []
50 | value.append("EventSource : " + message["Event Source"])
51 | value.append("IdentifierLink : " + message["Identifier Link"])
52 | value.append("SourceId : " + message["Source ID"])
53 | value.append("EventId : " + message["Event ID"])
54 | value.append("EventMessage : " + message["Event Message"])
55 | value.append("TopicArn : "+ record['Sns']['TopicArn'])
56 | send_item["value"] = os.linesep.join(value)
57 |
58 |
59 | elif event_type == "CloudWatch":
60 | send_item["host"] = message['Trigger']['Dimensions'][0]['value']
61 | value = []
62 | value.append("NewStatus : " + message['NewStateValue'])
63 | value.append("MetricNamespace : " + message['Trigger']['Namespace'])
64 | value.append("Dimensions : " + message['Trigger']['Dimensions'][0]['name'] + " = " + message['Trigger']['Dimensions'][0]['value'])
65 | value.append("MetricName : " + message['Trigger']['MetricName'])
66 | value.append("NewStateReason : " + message['NewStateReason'])
67 | value.append("Region : " + message['Region'])
68 | value.append("TopicArn : " + record['Sns']['TopicArn'])
69 | send_item["value"] = os.linesep.join(value)
70 |
71 | elif event_type == "EC2RDS":
72 | send_item["host"] = message['Trigger']['Namespace'].replace('AWS/',"")
73 | value = []
74 | value.append("NewStatus : " + message['NewStateValue'])
75 | value.append("Dimensions : " + json.dumps(message['Trigger']['Dimensions']))
76 | value.append("MetricName : " + message['Trigger']['MetricName'])
77 | value.append("NewStateReason : " + message['NewStateReason'])
78 | value.append("Region :" + message['Region'])
79 | value.append("TopicArn : " + record['Sns']['TopicArn'])
80 | send_item["value"] = os.linesep.join(value)
81 |
82 | else:
83 | send_item["host"] = "Other"
84 | value = json.loads(record['Sns']['Message'])
85 |
86 | send_item["key"] = "sns.event"
87 | event_timestamp = dateutil.parser.parse(record['Sns']['Timestamp'])
88 | send_item["clock"] = calendar.timegm(event_timestamp.utctimetuple())
89 | self.send_items.append(send_item)
90 |
91 | def __check_event_type(self, record):
92 | message = json.loads(record['Sns']['Message'])
93 | subject = record['Sns']['Subject']
94 | if subject.find("Auto Scaling") != -1:
95 | return "AutoScaling"
96 | elif subject.find("RDS Notification Message") != -1:
97 | return "RDS"
98 | elif message['Trigger']['Dimensions']:
99 | return "CloudWatch"
100 | elif message['Trigger']['Namespace']:
101 | return "EC2RDS"
102 | else:
103 | return "Other"
104 |
105 | def send_to_zabbix(self):
106 | now = "%.9f" % time.time()
107 | sec = now.split(".")[0]
108 | ns = now.split(".")[1]
109 | send_data = json.loads('{"request":"sender data","data":[],"clock":"%s","ns":"%s" }' % (sec, ns))
110 | send_data["data"] = self.send_items
111 | send_data_string = json.dumps(send_data)
112 | zbx_client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
113 | try:
114 | zbx_client.connect((self.zabbix_host, self.zabbix_port))
115 | except Exception:
116 | print("Error")
117 | quit()
118 | header = struct.pack('<4sBQ', 'ZBXD', 1, len(send_data_string))
119 | send_data_string = header + send_data_string
120 | try:
121 | zbx_client.sendall(send_data_string)
122 | except Exception:
123 | print('Data sending failure')
124 | quit()
125 | response = ''
126 | while True:
127 | data = zbx_client.recv(4096)
128 | if not data:
129 | break
130 | response += data
131 | print(response[13:])
132 | zbx_client.close()
133 |
--------------------------------------------------------------------------------
/lambda_code/AWS_Lambda.py:
--------------------------------------------------------------------------------
1 | from __future__ import print_function
2 |
3 | import json
4 | import boto3
5 |
6 | print('Loading function')
7 |
8 | def lambda_handler(event, context):
9 | event = json.loads(event)
10 | response = operation_ec2(event)
11 | return response
12 |
13 | def operation_ec2(event):
14 | def checkExecResult(response):
15 | print(response)
16 | if(response["ResponseMetadata"]["HTTPStatusCode"] == 200):
17 | return "Succeed"
18 | else:
19 | return "Failed"
20 |
21 | def stopEC2(ec2):
22 | execResult = ec2.stop()
23 | return checkExecResult(execResult)
24 |
25 | def startEC2(ec2):
26 | execResult = ec2.start()
27 | return checkExecResult(execResult)
28 |
29 | def checkOperationalInstance(ec2,operation):
30 | if(operation == "start"):
31 | if(ec2.state['Name'] == "stopped"):
32 | return True
33 | elif(operation == "stop"):
34 | if(ec2.state['Name'] == "running"):
35 | return True
36 | return False
37 |
38 | response = {
39 | "message" : "Nothing Operation",
40 | "instance_id": None,
41 | "operation": None
42 | }
43 |
44 | if "instance_id" not in event:
45 | response["message"] = "Not Found InstanceID"
46 | return response
47 |
48 | instanceid = event["instance_id"]
49 | response["instance_id"] = instanceid
50 | print(event)
51 |
52 | if "operation" not in event:
53 | response["message"] = "Not Found Operation"
54 | return response
55 |
56 | print("instance_id: " + instanceid)
57 | ec2 = boto3.resource('ec2').Instance(instanceid)
58 |
59 | if(checkOperationalInstance(ec2,event["operation"])):
60 | if(event["operation"] == "stop"):
61 | print("Stop EC2: " + instanceid)
62 | response["operation"] = "stop"
63 | response["message"] = stopEC2(ec2)
64 | elif(event["operation"] == "start"):
65 | print("Start EC2: " + instanceid)
66 | response["operation"] = "start"
67 | response["message"] = startEC2(ec2)
68 | else:
69 | response["message"] = "Invalid Operation."
70 | else:
71 | response["message"] = "Cannot Operation. Instance State is " + ec2.state['Name'] + "."
72 | return response
--------------------------------------------------------------------------------
/scripts/AWS_Service_Health_Dashboard.py:
--------------------------------------------------------------------------------
1 | #!/bin/env python
2 | import re
3 | import argparse
4 | import calendar
5 | import datetime
6 | import dateutil.parser
7 | import feedparser
8 | import threading
9 | import time
10 | import urllib2
11 | import argparse
12 | import json
13 | import socket
14 | import struct
15 | from HTMLParser import HTMLParser
16 |
17 | class AWSSHDParser(HTMLParser):
18 |
19 |
20 | def __init__(self, base_url, block, zabbix_host, zabbix_port):
21 | HTMLParser.__init__(self)
22 | self.block = block
23 | self.check = False
24 | self.base_url = base_url
25 | self.url_list = []
26 | self.lld_json = json.loads('{"data":[]}')
27 | self.zabbix_host = zabbix_host
28 | self.zabbix_port = zabbix_port
29 |
30 |
31 | def get_rss(self, url):
32 | now = "%.9f" % time.time()
33 | sec = now.split(".")[0]
34 | ns = now.split(".")[1]
35 | send_data = json.loads('{"request":"sender data","data":[],"clock":"%s","ns":"%s" }' % (sec, ns))
36 | response = feedparser.parse(url)
37 | send_items = []
38 |
39 | for entry in range(len(response.entries)):
40 | title = response.entries[entry].title
41 | published = response.entries[entry].published
42 |
43 | pub = dateutil.parser.parse(published)
44 | uni = calendar.timegm(pub.utctimetuple())
45 | now = calendar.timegm(time.gmtime())
46 |
47 | if now - args.interval < uni:
48 | send_json_string = '{"host":"", "key":"", "value":"", "clock":""}'
49 | send_item = json.loads(send_json_string)
50 | send_item["host"] = self.block
51 |
52 | replace = re.compile(".+/rss/(.*?)(-(ap-[a-z]+-[0-9]|us-[a-z]+-[0-9]|eu-[a-z]+-[0-9]|sa-[a-z]+-[0-9]))*\.rss")
53 | match = replace.match(url)
54 | ServiceName = match.group(1)
55 | Region = match.group(3)
56 |
57 | if Region == None:
58 | send_item["key"] = 'health.status[%s.]' % ServiceName
59 | else:
60 | send_item["key"] = 'health.status[%s.%s]' % (ServiceName, Region)
61 |
62 | send_item["value"] = title
63 | send_item["clock"] = uni
64 | send_items.append(send_item)
65 | else:
66 | break
67 | send_data["data"].extend(send_items)
68 | self.__send_to_zabbix(send_data)
69 |
70 |
71 | def __send_to_zabbix(self, send_data):
72 | send_data_string = json.dumps(send_data)
73 | zbx_client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
74 | try:
75 | zbx_client.connect((self.zabbix_host, self.zabbix_port))
76 | except Exception:
77 | print "Can't connect to zabbix server"
78 | quit()
79 |
80 | header = struct.pack('<4sBQ', 'ZBXD', 1, len(send_data_string))
81 | send_data_string = header + send_data_string
82 | try:
83 | zbx_client.sendall(send_data_string)
84 | except Exception:
85 | print 'Data sending failure'
86 | quit()
87 | response = ''
88 | while True:
89 | data = zbx_client.recv(4096)
90 | if not data:
91 | break
92 | response += data
93 |
94 | print response[13:]
95 | zbx_client.close()
96 |
97 |
98 | def handle_starttag(self, tagname, attribute):
99 | if tagname.lower() == "div":
100 | for i in attribute:
101 | if i[1] == self.block + "_block":
102 | self.check = True
103 | if self.check == True and tagname.lower() == "a":
104 | for i in attribute:
105 | if i[0].lower() == "href":
106 | self.url_list.append(self.base_url + i[1][1:])
107 | lld_json_string = '{"{#SERVICE.NAME}":"", "{#REGION}":""}'
108 | lld_item = json.loads(lld_json_string)
109 |
110 | replace = re.compile(".+/rss/(.*?)(-(ap-[a-z]+-[0-9]|us-[a-z]+-[0-9]|eu-[a-z]+-[0-9]|sa-[a-z]+-[0-9]))*\.rss")
111 | match = replace.match(self.base_url + i[1][1:])
112 | ServiceName = match.group(1)
113 | Region = match.group(3)
114 |
115 | if Region == None:
116 | lld_item["{#SERVICE.NAME}"] = ServiceName
117 | lld_item["{#REGION}"] = ""
118 | else:
119 | lld_item["{#SERVICE.NAME}"] = ServiceName
120 | lld_item["{#REGION}"] = Region
121 |
122 | self.lld_json["data"].append(lld_item)
123 |
124 |
125 | def handle_endtag(self, tagname):
126 | if tagname.lower() == "div":
127 | self.check = False
128 |
129 |
130 | if __name__== "__main__":
131 | parser = argparse.ArgumentParser(description='Get RSS list or Zabbix LLD format output from AWS Service Health Dashboard page.')
132 | parser.add_argument('-b', '--block', default="AP", help='set AWS region block(e.g.:NA or SA or EU or AP)')
133 | parser.add_argument('-i', '--interval', type=int, help='set interval time (seconds)')
134 | parser.add_argument('-m', '--send-mode', default='False', help='set True if you send AWS Service Health Dashboard status information. set False if you want to get lld format service list. (e.g.: True or False)')
135 | parser.add_argument('-p', '--zabbix-port', type=int, default=10051, help='set listening port number for Zabbix server')
136 | parser.add_argument('-z', '--zabbix-host', default='localhost', help='set listening IP address for Zabbix server')
137 |
138 | block_list = ["NA", "SA", "EU", "AP"]
139 | args = parser.parse_args()
140 |
141 | if args.block not in block_list:
142 | print "please set block name. :" + " or ".join(map(str, block_list))
143 |
144 | base_url = "http://status.aws.amazon.com/"
145 | socket.setdefaulttimeout(30)
146 | htmldata = urllib2.urlopen(base_url)
147 |
148 | parser = AWSSHDParser(base_url, args.block, args.zabbix_host, args.zabbix_port)
149 | parser.feed(htmldata.read())
150 |
151 | if args.send_mode.upper() == "TRUE":
152 | for url in parser.url_list:
153 | get_rss_th = threading.Thread(target=parser.get_rss,name="get_rss_th", args=(url,))
154 | get_rss_th.start()
155 |
156 | if args.send_mode.upper() == "FALSE":
157 | print json.dumps(parser.lld_json)
158 |
159 | parser.close()
160 | htmldata.close()
161 |
--------------------------------------------------------------------------------
/scripts/autoscaling_zabbix.py:
--------------------------------------------------------------------------------
1 | #!/bin/env python
2 |
3 | import boto3
4 | import json
5 | import argparse
6 | import os
7 | import socket
8 | import struct
9 | import time
10 | import calendar
11 | from zabbix_api import ZabbixAPI,ZabbixAPIException,Already_Exists
12 | from datetime import datetime
13 | from datetime import timedelta
14 |
15 | class AwsZabbix:
16 |
17 | def __init__(self, region, access_key, secret, pref_if, zbx_url, zbx_user, zbx_pass, set_macro):
18 | self.region = region
19 | self.access_key = access_key
20 | self.secret = secret
21 | self.pref_if = pref_if
22 | self.zbx_url = zbx_url
23 | self.zbx_user = zbx_user
24 | self.zbx_pass = zbx_pass
25 | self.set_macro = set_macro
26 |
27 | self.ec2 = boto3.resource(
28 | 'ec2',
29 | region_name=region,
30 | aws_access_key_id=access_key,
31 | aws_secret_access_key=secret
32 | )
33 | self.client = boto3.client(
34 | 'autoscaling',
35 | region_name=region,
36 | aws_access_key_id=access_key,
37 | aws_secret_access_key=secret
38 | )
39 |
40 | self.zapi = ZabbixAPI(server=self.zbx_url)
41 | self.zapi.login(self.zbx_user, self.zbx_pass)
42 |
43 |
44 | def __get_interfaces(self, host, region, key, secret):
45 | interfaces = []
46 | priv_intf = ''
47 | pub_intf = ''
48 | instance = self.ec2.Instance(host)
49 |
50 | priv_intf = ({
51 | 'type':1,
52 | 'useip':1,
53 | 'main':(1 if self.pref_if == 'Private' else 0),
54 | 'ip':instance.private_ip_address,
55 | 'dns':'',
56 | 'port':'10050'
57 | })
58 | if instance.public_ip_address:
59 | pub_intf = ({
60 | 'type':1,
61 | 'useip':1,
62 | 'main':(1 if self.pref_if == 'Public' else 0),
63 | 'ip':instance.public_ip_address,
64 | 'dns':'',
65 | 'port':'10050'
66 | })
67 | else:
68 | priv_intf['main'] = 1
69 |
70 | if pub_intf:
71 | interfaces = [priv_intf, pub_intf]
72 | else:
73 | interfaces = [priv_intf]
74 |
75 | return interfaces
76 |
77 |
78 | def __get_hostid(self, instanceid):
79 | host = self.zapi.host.get({
80 | 'filter':{
81 | 'host':instanceid
82 | }
83 | })
84 |
85 | return host[0]['hostid'] if host else False
86 |
87 |
88 | def __create_interfaces(self, hostid, interfaces):
89 | for aws_ifname in interfaces:
90 | aws_ifname['hostid'] = hostid
91 | interface = self.zapi.hostinterface.get({
92 | 'filter':{
93 | 'hostid':hostid,
94 | 'ip':aws_ifname['ip']
95 | }
96 | })
97 |
98 | if interface:
99 | aws_ifname['interfaceid'] = interface[0]['interfaceid']
100 |
101 | try:
102 | self.zapi.hostinterface.update(aws_ifname)
103 | except ZabbixAPIException, e:
104 | print str(e)
105 | else:
106 | try:
107 | self.zapi.hostinterface.create(aws_ifname)
108 | except ZabbixAPIException, e:
109 | print str(e)
110 |
111 | return
112 |
113 |
114 | def __create_host(self, host, interfaces, template_ids, groupid):
115 | try:
116 | params = {
117 | 'host':host,
118 | 'interfaces':interfaces,
119 | 'groups':[{'groupid':groupid}]
120 | }
121 | if template_ids:
122 | params["templates"] = template_ids
123 |
124 | self.zapi.host.create(params)
125 | except Already_Exists, e:
126 | hostid = self.__get_hostid([host])
127 | params = {
128 | 'hostid':hostid,
129 | 'groups':[{'groupid':groupid}]
130 | }
131 | if template_ids:
132 | params["templates"] = template_ids
133 |
134 | self.zapi.host.update(params)
135 | self.__create_interfaces(hostid, interfaces)
136 |
137 | return
138 |
139 |
140 | def __create_usermacro(self, hostid, macro):
141 | update_macro = {}
142 |
143 | try:
144 | self.zapi.usermacro.create({
145 | 'hostid':hostid,
146 | 'macro':macro['name'],
147 | 'value':macro['value']
148 | })
149 | except Already_Exists, e:
150 | defined_macro = self.zapi.usermacro.get({
151 | 'filter':{
152 | 'macro':macro['name']
153 | },
154 | 'hostids':hostid
155 | })
156 | try:
157 | self.zapi.usermacro.update({
158 | 'hostmacroid':defined_macro[0]['hostmacroid'],
159 | 'value':macro['value']
160 | })
161 | except ZabbixAPIException, e:
162 | print str(e)
163 |
164 | return
165 |
166 |
167 | def __set_usermacros(self, hostid):
168 | macros = [{
169 | 'name':'{$REGION}',
170 | 'value':self.region
171 | },
172 | {
173 | 'name':'{$KEY}',
174 | 'value':self.access_key
175 | },
176 | {
177 | 'name':'{$SECRET}',
178 | 'value':self.secret
179 | }]
180 | for macro in macros:
181 | self.__create_usermacro(hostid, macro)
182 |
183 | return
184 |
185 |
186 | def __disable_host(self, hostid):
187 | try:
188 | self.zapi.host.update({'hostid':hostid,'status':1})
189 | except ZabbixAPIException, e:
190 | print str(e)
191 |
192 | return
193 |
194 |
195 | def send_autoscaling_data_to_zabbix(self):
196 | response = self.client.describe_auto_scaling_groups()
197 | for group in response['AutoScalingGroups']:
198 | groupid = ''
199 | templates = []
200 | template_ids = []
201 | hostgroup_hosts = []
202 | hostids = []
203 | usermacros = []
204 |
205 | try:
206 | response = self.zapi.hostgroup.create({'name':group['AutoScalingGroupName']})
207 | groupid = response['groupids'][0]
208 | except ZabbixAPIException, e:
209 | response = self.zapi.hostgroup.get({
210 | 'filter':{
211 | 'name':[group['AutoScalingGroupName']]
212 | },
213 | 'selectHosts':'extend'
214 | })
215 | for hostgroup_host in response[0]['hosts']:
216 | hostgroup_hosts.append(hostgroup_host['host'])
217 | groupid = response[0]['groupid']
218 |
219 | for tag in group['Tags']:
220 | if tag['Key'] == 'ZabbixTemplates':
221 | templates = tag['Value'].split(',')
222 |
223 | if templates:
224 | try:
225 | response = self.zapi.template.get({
226 | 'filter':{
227 | 'host':templates
228 | }
229 | })
230 | for template in response:
231 | template_ids.append({'templateid':template['templateid']})
232 | except ZabbixAPIException, e:
233 | print str(e)
234 |
235 | for instance in group['Instances']:
236 | instanceid = instance['InstanceId']
237 | if instanceid in hostgroup_hosts:
238 | hostgroup_hosts.remove(instanceid)
239 | interfaces = self.__get_interfaces(instanceid, self.region, self.access_key, self.secret)
240 |
241 | ## Create or update host
242 | self.__create_host(instanceid, interfaces, template_ids, groupid)
243 |
244 | ## Set user macros for CloudWatch
245 | if self.set_macro == 'True':
246 | hostid = self.__get_hostid([instance['InstanceId']])
247 | self.__set_usermacros(hostid)
248 |
249 | ## host status disable for not exist EC2 instance host
250 | for deleted_host in hostgroup_hosts:
251 | hostid = self.__get_hostid([deleted_host])
252 | self.__disable_host(hostid)
253 |
254 |
255 | if __name__ == '__main__':
256 | parser = argparse.ArgumentParser(description='Get AWS Auto Scaling Metric list json format, and send Zabbix API.')
257 |
258 | parser.add_argument('-r', '--region',
259 | default=os.getenv('AWS_DEFAULT_REGION'),
260 | help='set AWS region name(e.g.: ap-northeast-1)')
261 | parser.add_argument('-a', '--accesskey',
262 | default=os.getenv('AWS_ACCESS_KEY_ID'),
263 | help='set AWS Access Key ID')
264 | parser.add_argument('-s', '--secret',
265 | default=os.getenv('AWS_SECRET_ACCESS_KEY'),
266 | help='set AWS Secret Access Key')
267 | parser.add_argument('-z', '--url',
268 | default='http://localhost/zabbix',
269 | help='set Zabbix Frontend url')
270 | parser.add_argument('-u', '--user',
271 | default='Admin', help='set Zabbix API username')
272 | parser.add_argument('-p', '--password',
273 | default='zabbix', help='set Zabbix API user password')
274 | parser.add_argument('-P', '--preffer-if',
275 | default='Private', choices=['Private', 'Public'],
276 | help='set preffer interface(e.g.: Private or Public)')
277 | parser.add_argument('-m', '--set-macro',
278 | default='False', choices=['False', 'True'],
279 | help='set User macros for CloudWatch(e.g.: False or True)')
280 |
281 | args = parser.parse_args()
282 | aws_zabbix = AwsZabbix(region=args.region,
283 | access_key=args.accesskey, secret=args.secret,
284 | pref_if=args.preffer_if,
285 | zbx_url=args.url, zbx_user=args.user, zbx_pass=args.password,
286 | set_macro=args.set_macro)
287 | aws_zabbix.send_autoscaling_data_to_zabbix()
288 |
289 |
--------------------------------------------------------------------------------
/scripts/cloudwatch_zabbix.py:
--------------------------------------------------------------------------------
1 | #!/bin/env python
2 |
3 | import boto3
4 | import json
5 | import argparse
6 | import os
7 | import socket
8 | import struct
9 | import time
10 | import calendar
11 | from datetime import datetime
12 | from datetime import timedelta
13 |
14 | class Metric:
15 | def __init__(self, name="", namespace="", unit="", dimensions=[]):
16 | self.name = name
17 | self.namespace = namespace
18 | self.unit = unit
19 | self.dimensions = dimensions
20 |
21 | class AwsZabbix:
22 |
23 | def __init__(self, region, access_key, secret, identity, hostname, service, timerange_min,
24 | zabbix_host, zabbix_port):
25 | self.zabbix_host = zabbix_host
26 | self.zabbix_port = zabbix_port
27 | self.identity = identity
28 | self.hostname = hostname
29 | self.service = service
30 | self.timerange_min = timerange_min
31 | self.id_dimentions = {
32 | 'ec2':'InstanceId',
33 | 'rds':'DBInstanceIdentifier',
34 | 'elb':'LoadBalancerName',
35 | 'ebs':'VolumeId',
36 | 'billing': 'Currency'
37 | }
38 | self.client = boto3.client(
39 | 'cloudwatch',
40 | region_name=region,
41 | aws_access_key_id=access_key,
42 | aws_secret_access_key=secret
43 | )
44 | self.sum_stat_metrics = [
45 | {'namespace': 'AWS/ELB', 'metricname': 'RequestCount'},
46 | {'namespace': 'AWS/ELB', 'metricname': 'HTTPCode_Backend_2XX'},
47 | {'namespace': 'AWS/ELB', 'metricname': 'HTTPCode_Backend_3XX'},
48 | {'namespace': 'AWS/ELB', 'metricname': 'HTTPCode_Backend_4XX'},
49 | {'namespace': 'AWS/ELB', 'metricname': 'HTTPCode_Backend_5XX'},
50 | {'namespace': 'AWS/ELB', 'metricname': 'HTTPCode_ELB_4XX'},
51 | {'namespace': 'AWS/ELB', 'metricname': 'HTTPCode_ELB_5XX'}
52 | ]
53 |
54 | def __get_metric_list(self):
55 | resp = self.client.list_metrics(
56 | Dimensions = [
57 | {
58 | 'Name': self.id_dimentions[self.service],
59 | 'Value': ('USD' if self.service == "billing" else self.identity)
60 | }
61 | ]
62 | )
63 | metric_list = []
64 | for data in resp["Metrics"]:
65 | metric = Metric(name=data["MetricName"], namespace=data["Namespace"], dimensions=data["Dimensions"])
66 | if self.service == "elb":
67 | for dimension in data["Dimensions"]:
68 | if dimension["Name"] == "AvailabilityZone":
69 | metric.name = data["MetricName"] + "." + dimension["Value"]
70 | metric_list.append(metric)
71 | return metric_list
72 |
73 | def __get_metric_stats(self, metric_name, metric_namespace, servicename, timerange_min, stat_type="Average", period_sec=300):
74 | if self.service == "billing":
75 | dimensions = [
76 | {
77 | 'Name': self.id_dimentions[self.service],
78 | 'Value': 'USD'
79 | }
80 | ]
81 | if servicename != "billing":
82 | dimensions.insert(0,
83 | {
84 | 'Name': 'ServiceName',
85 | 'Value': servicename
86 | }
87 | )
88 | else:
89 | dimensions = [
90 | {
91 | 'Name': self.id_dimentions[self.service],
92 | 'Value': self.identity
93 | }
94 | ]
95 | if self.service == "elb":
96 | split_metric_name = metric_name.split(".")
97 | if len(split_metric_name) == 2:
98 | metric_name = split_metric_name[0]
99 | dimensions.append(
100 | {
101 | 'Name': 'AvailabilityZone',
102 | 'Value': split_metric_name[1]
103 | }
104 | )
105 | stats = self.client.get_metric_statistics(
106 | Namespace=metric_namespace,
107 | MetricName=metric_name,
108 | Dimensions=dimensions,
109 | StartTime=datetime.utcnow() - timedelta(minutes=timerange_min),
110 | EndTime=datetime.utcnow(),
111 | Period=period_sec,
112 | Statistics=[stat_type],
113 | )
114 | return stats
115 |
116 | def __set_unit(self, metric_list):
117 | ret_val = []
118 | for metric in metric_list:
119 | servicename = self.service
120 | if self.service == "billing":
121 | metric.unit = 'USD'
122 | else:
123 | stats = self.__get_metric_stats(metric.name, metric.namespace, servicename, self.timerange_min)
124 | for datapoint in stats["Datapoints"]:
125 | metric.unit = datapoint["Unit"]
126 | break
127 | ret_val.append(metric)
128 | return ret_val
129 |
130 | def __get_send_items(self, stats, metric):
131 | send_items = []
132 | datapoints = stats["Datapoints"]
133 | datapoints = sorted(datapoints, key=lambda datapoints: datapoints["Timestamp"], reverse=True)
134 | for datapoint in datapoints:
135 | servicename = ''
136 | send_json_string = '{"host":"", "key":"", "value":"", "clock":""}'
137 | send_item = json.loads(send_json_string)
138 |
139 | if self.hostname == "undefined":
140 | send_item["host"] = self.identity
141 | else:
142 | send_item["host"] = self.hostname
143 |
144 | if self.service == "billing":
145 | for dimension in metric.dimensions:
146 | if dimension["Name"] == "ServiceName":
147 | servicename = dimension["Value"]
148 | send_item["key"] = 'cloudwatch.metric[%s.%s]' % (metric.name, servicename)
149 | else:
150 | send_item["key"] = 'cloudwatch.metric[%s]' % metric.name
151 | send_item["value"] = self.__get_datapoint_value_string(datapoint)
152 | send_item["clock"] = calendar.timegm(datapoint["Timestamp"].utctimetuple())
153 | send_items.append(send_item)
154 | break
155 | return send_items
156 |
157 | def __get_datapoint_value_string(self, datapoint):
158 | if datapoint.has_key("Average"):
159 | return str(datapoint["Average"])
160 | elif datapoint.has_key("Sum"):
161 | return str(datapoint["Sum"])
162 | else:
163 | return ""
164 |
165 | def __send_to_zabbix(self, send_data):
166 | send_data_string = json.dumps(send_data)
167 | zbx_client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
168 | try:
169 | zbx_client.connect((self.zabbix_host, self.zabbix_port))
170 | except Exception:
171 | print "Can't connect to zabbix server"
172 | quit()
173 |
174 | header = struct.pack('<4sBQ', 'ZBXD', 1, len(send_data_string))
175 | send_data_string = header + send_data_string
176 | try:
177 | zbx_client.sendall(send_data_string)
178 | except Exception:
179 | print 'Data sending failure'
180 | quit()
181 | response = ''
182 | while True:
183 | data = zbx_client.recv(4096)
184 | if not data:
185 | break
186 | response += data
187 |
188 | print response[13:]
189 | zbx_client.close()
190 |
191 |
192 | def send_metric_data_to_zabbix(self):
193 | now = "%.9f" % time.time()
194 | sec = now.split(".")[0]
195 | ns = now.split(".")[1]
196 | send_data = json.loads('{"request":"sender data","data":[],"clock":"%s","ns":"%s" }' % (sec, ns))
197 | metric_list = self.__get_metric_list()
198 | all_metric_stats = []
199 | servicename = self.service
200 | for metric in metric_list:
201 | if self.service == "billing":
202 | for dimension in metric.dimensions:
203 | if dimension["Name"] == "ServiceName":
204 | servicename = dimension["Value"]
205 | target_metric_info = {'namespace': metric.namespace, 'metricname': metric.name}
206 | for sum_stat_metric in self.sum_stat_metrics: # for support each region metrics (RequestCount, RequestCount.ap-northeast-1 etc.)
207 | if metric.name.find(sum_stat_metric['metricname']) == 0: # Only convert when finding the begging of string.
208 | target_metric_info['metricname'] = sum_stat_metric['metricname']
209 | if target_metric_info in self.sum_stat_metrics:
210 | stats = self.__get_metric_stats(metric.name, metric.namespace, servicename, self.timerange_min, 'Sum')
211 | else:
212 | stats = self.__get_metric_stats(metric.name, metric.namespace, servicename, self.timerange_min)
213 | send_data["data"].extend(self.__get_send_items(stats, metric))
214 | self.__send_to_zabbix(send_data)
215 |
216 | def show_metriclist_lld(self):
217 | lld_output_json = json.loads('{"data":[]}')
218 | metric_list = self.__get_metric_list()
219 | metric_list = self.__set_unit(metric_list)
220 | for metric in metric_list:
221 | lld_json_string = '{"{#METRIC.NAME}":"", "{#METRIC.UNIT}":"", "{#METRIC.NAMESPACE}":""}'
222 | lld_item = json.loads(lld_json_string)
223 | lld_item["{#METRIC.NAME}"] = metric.name
224 | lld_item["{#METRIC.NAMESPACE}"] = metric.namespace
225 | lld_item["{#METRIC.UNIT}"] = metric.unit
226 | lld_output_json["data"].append(lld_item)
227 | if self.service == "billing":
228 | lld_item["{#METRIC.SERVICENAME}"] = ""
229 | for dimension in metric.dimensions:
230 | if dimension["Name"] == "ServiceName":
231 | lld_item["{#METRIC.SERVICENAME}"] = dimension["Value"]
232 | print json.dumps(lld_output_json)
233 |
234 | if __name__ == '__main__':
235 | parser = argparse.ArgumentParser(description='Get AWS CloudWatch Metric list json format.')
236 |
237 | parser.add_argument('-r', '--region', default=os.getenv("AWS_DEFAULT_REGION"), help='set AWS region name(e.g.: ap-northeast-1)')
238 | parser.add_argument('-a', '--accesskey', default=os.getenv("AWS_ACCESS_KEY_ID"), help='set AWS Access Key ID')
239 | parser.add_argument('-s', '--secret', default=os.getenv("AWS_SECRET_ACCESS_KEY"), help='set AWS Secret Access Key')
240 | parser.add_argument('-i', '--identity', required=True, help='set Identity data (ec2: InstanceId, elb: LoadBalancerName, rds: DBInstanceIdentifier, ebs: VolumeId)')
241 | parser.add_argument('-H', '--hostname', default='undefined', help='set string that has to match HOST.HOST. defaults to identity)')
242 | parser.add_argument('-m', '--send-mode', default='False', help='set True if you send statistic data (e.g.: True or False)')
243 | parser.add_argument('-t', '--timerange', type=int, default=10, help='set Timerange min')
244 | parser.add_argument('-p', '--zabbix-port', type=int, default=10051, help='set listening port number for Zabbix server')
245 | parser.add_argument('-z', '--zabbix-host', default='localhost', help='set listening IP address for Zabbix server')
246 | parser.add_argument('service', metavar='service_name', help='set Service name (e.g.: ec2 or elb or rds')
247 |
248 | args = parser.parse_args()
249 |
250 | aws_zabbix = AwsZabbix(region=args.region, access_key=args.accesskey, secret=args.secret,
251 | identity=args.identity, hostname=args.hostname, service=args.service,
252 | timerange_min=args.timerange, zabbix_host=args.zabbix_host, zabbix_port=args.zabbix_port)
253 |
254 | if args.send_mode.upper() == 'TRUE':
255 | aws_zabbix.send_metric_data_to_zabbix()
256 | else:
257 | aws_zabbix.show_metriclist_lld()
258 |
--------------------------------------------------------------------------------
/scripts/lambda_zabbix.py:
--------------------------------------------------------------------------------
1 | #!/bin/env python
2 |
3 | import boto3
4 | import json
5 | import argparse
6 | import base64
7 | import logging
8 |
9 | class AWSLambda:
10 | def __init__(self,region,access_key,secret_key,debug):
11 | self.client = boto3.client('lambda',region_name=region,aws_access_key_id=access_key,aws_secret_access_key=secret_key)
12 | log_fmt = '%(asctime)s- %(message)s'
13 | logging.basicConfig(level=debug.upper(),format=log_fmt)
14 |
15 | def invokeLambda(self,funcname,invocationtype,logtype,payload):
16 | logging.debug(json.dumps(payload))
17 | response = self.client.invoke(
18 | FunctionName = funcname,
19 | InvocationType = invocationtype,
20 | LogType = logtype,
21 | Payload = json.dumps(payload)
22 | )
23 | return response
24 |
25 | def dispResult(self,response):
26 | logging.debug("Exec Result: ")
27 | logging.debug(base64.b64decode(response["LogResult"]))
28 |
29 | payload = json.loads(response['Payload'].read().decode('utf-8'))
30 | logging.info("ResponseCode: %d" % response['ResponseMetadata']['HTTPStatusCode'])
31 | if payload and "message" in payload:
32 | logging.info(payload["message"])
33 |
34 | if __name__ == '__main__':
35 | parser = argparse.ArgumentParser(description='Get Lambda Parameter.')
36 |
37 | parser.add_argument('-r', '--region', required=True, help='Set AWS region name(e.g.: ap-northeast-1)')
38 | parser.add_argument('-a', '--accesskey', help='Set AWS Access Key ID')
39 | parser.add_argument('-s', '--secretkey', help='Set AWS Secret Access Key')
40 | parser.add_argument('-f', '--funcname',required=True, help='Set Function Name of AWS Lambda (e.g: arn:aws:lambda:ap-northeast-1:*******:function:Test')
41 | parser.add_argument('-i', '--invocationtype',default='RequestResponse',help='Set invocation type: RequestResponse(sync), Event(async) or DryRun(test)')
42 | parser.add_argument('-l', '--logtype',default='Tail',help='Set log data type. You can set this parameter only if you specify the InvocationType with value RequestResponse. Tail: Returns base64 encoded last 4KB of log. None: No returns log.')
43 | parser.add_argument('-p', '--payload',default={}, help= 'Set payload if you want to include intanceid, AWS Service and so on. The payload must be json. (e.g. {"instance_id":"xxxxx"}')
44 | parser.add_argument('-d', '--debuglevel',default="info",help='Debug Level: INFO, WARNING, ERROR')
45 |
46 | args = parser.parse_args()
47 |
48 | awslambda = AWSLambda(region=args.region,access_key=args.accesskey,secret_key=args.secretkey,debug=args.debuglevel)
49 | response = awslambda.invokeLambda(funcname=args.funcname,invocationtype = args.invocationtype,logtype=args.logtype,payload=args.payload)
50 |
51 | awslambda.dispResult(response)
52 |
--------------------------------------------------------------------------------
/templates/2.2/AWS_Service_Health_Dashboard_template.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 2.0
4 | 2016-07-07T08:21:29Z
5 |
6 |
7 | TIS Templates
8 |
9 |
10 |
11 |
12 | Template AWS Service Health Dashboard
13 | Template AWS Service Health Dashboard
14 |
15 |
16 | TIS Templates
17 |
18 |
19 |
20 |
21 | -
22 | health stats
23 | 10
24 |
25 | 0
26 |
27 | AWS_Service_Health_Dashboard.py["-i","3600","-b",{HOST.HOST},"-m","True"]
28 | 3600
29 | 90
30 | 365
31 | 0
32 | 4
33 |
34 |
35 | 0
36 |
37 |
38 | 0
39 | 0
40 |
41 | 0
42 |
43 | 1
44 |
45 |
46 |
47 | 0
48 | 0
49 |
50 |
51 |
52 |
53 |
54 |
55 | 0
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | Service Health Dashboard
64 | 10
65 |
66 |
67 | AWS_Service_Health_Dashboard.py["-i","3600","-b",{HOST.HOST},"-m","False"]
68 | 3600
69 | 0
70 |
71 |
72 |
73 | 0
74 | 0
75 |
76 | 0
77 |
78 |
79 |
80 |
81 | 0
82 |
83 |
84 |
85 |
86 |
87 | :
88 | 30
89 |
90 |
91 |
92 | AWS Service Health Dashboard {#SERVICE.NAME} status ({#REGION})
93 | 2
94 |
95 | 0
96 |
97 | health.status[{#SERVICE.NAME}.{#REGION}]
98 | 0
99 | 90
100 | 365
101 | 0
102 | 2
103 |
104 |
105 | 0
106 |
107 |
108 | 0
109 | 0
110 |
111 | 0
112 |
113 | 1
114 |
115 |
116 |
117 | 0
118 | 0
119 |
120 |
121 |
122 |
123 |
124 |
125 | 0
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 | {Template AWS Service Health Dashboard:health.status[{#SERVICE.NAME}.{#REGION}].regexp(Informational message)}=1
134 | Informational message
135 |
136 | 0
137 | 1
138 |
139 | 1
140 |
141 |
142 | {Template AWS Service Health Dashboard:health.status[{#SERVICE.NAME}.{#REGION}].regexp(Performance issues)}=1
143 | Performance issues
144 |
145 | 0
146 | 2
147 |
148 | 1
149 |
150 |
151 | {Template AWS Service Health Dashboard:health.status[{#SERVICE.NAME}.{#REGION}].regexp(Service disruption)}=1
152 | Service disruption
153 |
154 | 0
155 | 4
156 |
157 | 1
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
--------------------------------------------------------------------------------
/templates/2.2/AmazonSNS_AWSLambda_Zabbix_template.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 2.0
4 | 2016-08-21T11:19:51Z
5 |
6 |
7 | SNS
8 |
9 |
10 |
11 |
12 | Template AWS SNS EVENT AutoScaling
13 | Template AWS SNS EVENT AutoScaling
14 |
15 |
16 | SNS
17 |
18 |
19 |
20 |
21 | -
22 | sns.event
23 | 2
24 |
25 | 0
26 |
27 | sns.event
28 | 0
29 | 90
30 | 365
31 | 0
32 | 4
33 |
34 |
35 | 0
36 |
37 |
38 | 0
39 | 0
40 |
41 | 0
42 |
43 | 1
44 |
45 |
46 |
47 | 0
48 | 0
49 |
50 |
51 |
52 |
53 |
54 |
55 | 0
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 | Template AWS SNS EVENT EC2
68 | Template AWS SNS EVENT EC2
69 |
70 |
71 | SNS
72 |
73 |
74 |
75 |
76 | -
77 | sns.event
78 | 2
79 |
80 | 0
81 |
82 | sns.event
83 | 0
84 | 90
85 | 365
86 | 0
87 | 4
88 |
89 |
90 | 0
91 |
92 |
93 | 0
94 | 0
95 |
96 | 0
97 |
98 | 1
99 |
100 |
101 |
102 | 0
103 | 0
104 |
105 |
106 |
107 |
108 |
109 |
110 | 0
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 | Template AWS SNS EVENT Other
123 | Template AWS SNS EVENT Other
124 |
125 |
126 | SNS
127 |
128 |
129 |
130 |
131 | -
132 | sns.event
133 | 2
134 |
135 | 0
136 |
137 | sns.event
138 | 0
139 | 90
140 | 365
141 | 0
142 | 4
143 |
144 |
145 | 0
146 |
147 |
148 | 0
149 | 0
150 |
151 | 0
152 |
153 | 1
154 |
155 |
156 |
157 | 0
158 | 0
159 |
160 |
161 |
162 |
163 |
164 |
165 | 0
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 | Template AWS SNS EVENT RDS
178 | Template AWS SNS EVENT RDS
179 |
180 |
181 | SNS
182 |
183 |
184 |
185 |
186 | -
187 | sns.event
188 | 2
189 |
190 | 0
191 |
192 | sns.event
193 | 0
194 | 90
195 | 365
196 | 0
197 | 4
198 |
199 |
200 | 0
201 |
202 |
203 | 0
204 | 0
205 |
206 | 0
207 |
208 | 1
209 |
210 |
211 |
212 | 0
213 | 0
214 |
215 |
216 |
217 |
218 |
219 |
220 | 0
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 | {Template AWS SNS EVENT AutoScaling:sns.event.regexp(INSTANCE_LAUNCH_ERROR)}=1
235 | AutoScaling_Instance_Launch_Error
236 |
237 | 0
238 | 3
239 |
240 | 1
241 |
242 |
243 |
244 | {Template AWS SNS EVENT AutoScaling:sns.event.regexp(INSTANCE_TERMINATE_ERROR)}=1
245 | AutoScaling_Instance_Terminate_Error
246 |
247 | 0
248 | 3
249 |
250 | 1
251 |
252 |
253 |
254 | {Template AWS SNS EVENT EC2:sns.event.regexp(ALARM)}=1
255 | EC2_Alarm
256 |
257 | 0
258 | 3
259 |
260 | 1
261 |
262 |
263 |
264 | {Template AWS SNS EVENT EC2:sns.event.regexp(INSUFFICIENT_DATA)}=1
265 | EC2_InsufficientData
266 |
267 | 0
268 | 2
269 |
270 | 1
271 |
272 |
273 |
274 | {Template AWS SNS EVENT Other:sns.event.regexp(ALARM)}=1
275 | Other_Service_Alarm
276 |
277 | 0
278 | 3
279 |
280 | 1
281 |
282 |
283 |
284 | {Template AWS SNS EVENT Other:sns.event.regexp(INSUFFICIENT_DATA)}=1
285 | Other_Service_InsufficientData
286 |
287 | 0
288 | 2
289 |
290 | 1
291 |
292 |
293 |
294 | {Template AWS SNS EVENT RDS:sns.event.regexp(ALARM)}=1
295 | RDS_Alarm
296 |
297 | 0
298 | 3
299 |
300 | 1
301 |
302 |
303 |
304 | {Template AWS SNS EVENT RDS:sns.event.regexp("^EventId.*RDS-EVENT-(0022|0031|0034|0035|0036|0045|0069)")}=1
305 | RDS_Failure_notification
306 |
307 | 0
308 | 4
309 |
310 | 1
311 |
312 |
313 |
314 | {Template AWS SNS EVENT RDS:sns.event.regexp(INSUFFICIENT_DATA)}=1
315 | RDS_InsufficientData
316 |
317 | 0
318 | 2
319 |
320 | 1
321 |
322 |
323 |
324 |
325 |
326 |
--------------------------------------------------------------------------------
/templates/2.2/autoscaling_template.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 2.0
4 | 2016-07-20T02:41:29Z
5 |
6 |
7 | TIS Templates
8 |
9 |
10 |
11 |
12 | Template AWS Auto Scaling
13 | Template AWS Auto Scaling
14 |
15 |
16 | TIS Templates
17 |
18 |
19 |
20 |
21 | -
22 | Collect Auto Scaling Instances
23 | 10
24 |
25 | 0
26 |
27 | autoscaling_zabbix.py["-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-z","{$ZBX_URL}","-u","{$ZBX_USER}","-p","{$ZBX_PASS}","-m","{$SET_MACRO}","-P","{$PREFFER_IF}"]
28 | 1800
29 | 90
30 | 365
31 | 0
32 | 2
33 |
34 |
35 | 0
36 |
37 |
38 | 0
39 | 0
40 |
41 | 0
42 |
43 | 1
44 |
45 |
46 |
47 | 0
48 | 0
49 |
50 |
51 |
52 |
53 |
54 |
55 | 0
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 | {$KEY}
65 |
66 |
67 |
68 | {$PREFFER_IF}
69 | Private
70 |
71 |
72 | {$REGION}
73 |
74 |
75 |
76 | {$SECRET}
77 |
78 |
79 |
80 | {$SET_MACRO}
81 | False
82 |
83 |
84 | {$ZBX_PASS}
85 | zabbix
86 |
87 |
88 | {$ZBX_URL}
89 | http://localhost/zabbix
90 |
91 |
92 | {$ZBX_USER}
93 | Admin
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/templates/2.2/awsbilling_template.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 2.0
4 | 2016-06-17T07:40:30Z
5 |
6 |
7 | TIS Templates
8 |
9 |
10 |
11 |
12 | Template AWS Billing
13 | Template AWS Billing
14 |
15 |
16 | TIS Templates
17 |
18 |
19 |
20 |
21 | -
22 | Collect AWS Billing
23 | 10
24 |
25 | 0
26 |
27 | cloudwatch_zabbix.py["billing","-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST},"-t",{$TIMERANGE},","-m","True"]
28 | 3600
29 | 90
30 | 365
31 | 0
32 | 1
33 |
34 |
35 | 0
36 |
37 |
38 | 0
39 | 0
40 |
41 | 0
42 |
43 | 1
44 |
45 |
46 |
47 | 0
48 | 0
49 |
50 |
51 |
52 |
53 |
54 |
55 | 0
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | Billing metrics list discovery services
64 | 10
65 |
66 |
67 | cloudwatch_zabbix.py["billing","-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST},"-t",{$TIMERANGE},"]
68 | 3600
69 | 0
70 |
71 |
72 |
73 | 0
74 | 0
75 |
76 | 0
77 |
78 |
79 |
80 |
81 | 0
82 |
83 |
84 |
85 |
86 |
87 | :
88 | 30
89 |
90 |
91 |
92 | Billing stats (Average) [{#METRIC.NAME}.{#METRIC.SERVICENAME}]
93 | 2
94 |
95 | 0
96 |
97 | cloudwatch.metric[{#METRIC.NAME}.{#METRIC.SERVICENAME}]
98 | 0
99 | 90
100 | 365
101 | 0
102 | 0
103 |
104 | USD
105 | 0
106 |
107 |
108 | 0
109 | 0
110 |
111 | 0
112 |
113 | 1
114 |
115 |
116 |
117 | 0
118 | 0
119 |
120 |
121 |
122 |
123 |
124 |
125 | 0
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 | {$KEY}
139 |
140 |
141 |
142 | {$REGION}
143 | us-east-1
144 |
145 |
146 | {$SECRET}
147 |
148 |
149 |
150 | {$TIMERANGE}
151 | 360
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
--------------------------------------------------------------------------------
/templates/2.2/cloudwatch_template.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 2.0
4 | 2016-05-25T01:21:50Z
5 |
6 |
7 | TIS Templates
8 |
9 |
10 |
11 |
12 | Template AWS EBS
13 | Template AWS EBS
14 |
15 |
16 | TIS Templates
17 |
18 |
19 |
20 |
21 | -
22 | Collect CloudWatch metric stats EBS
23 | 10
24 |
25 | 0
26 |
27 | cloudwatch_zabbix.py[ebs,"-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST},"-m","True"]
28 | 300
29 | 90
30 | 365
31 | 0
32 | 1
33 |
34 |
35 | 0
36 |
37 |
38 | 0
39 | 0
40 |
41 | 0
42 |
43 | 1
44 |
45 |
46 |
47 | 0
48 | 0
49 |
50 |
51 |
52 |
53 |
54 |
55 | 0
56 |
57 |
58 |
59 |
60 |
61 |
62 | CloudWatch metrics list discovery EBS
63 | 10
64 |
65 |
66 | cloudwatch_zabbix.py[ebs,"-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST}]
67 | 3600
68 | 0
69 |
70 |
71 |
72 | 0
73 | 0
74 |
75 | 0
76 |
77 |
78 |
79 |
80 | 0
81 |
82 |
83 |
84 |
85 |
86 | :
87 | 30
88 |
89 |
90 |
91 | EBS CloudWatch Metric stats (Average) [{#METRIC.NAME}]
92 | 2
93 |
94 | 0
95 |
96 | cloudwatch.metric[{#METRIC.NAME}]
97 | 0
98 | 90
99 | 365
100 | 0
101 | 0
102 |
103 |
104 | 0
105 |
106 |
107 | 0
108 | 0
109 |
110 | 0
111 |
112 | 1
113 |
114 |
115 |
116 | 0
117 | 0
118 |
119 |
120 |
121 |
122 |
123 |
124 | 0
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 | {$KEY}
137 |
138 |
139 |
140 | {$REGION}
141 | ap-northeast-1
142 |
143 |
144 | {$SECRET}
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 | Template AWS EC2
153 | Template AWS EC2
154 |
155 |
156 | TIS Templates
157 |
158 |
159 |
160 |
161 | -
162 | Collect CloudWatch metric stats EC2
163 | 10
164 |
165 | 0
166 |
167 | cloudwatch_zabbix.py[ec2,"-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST},"-m","True"]
168 | 300
169 | 90
170 | 365
171 | 0
172 | 1
173 |
174 |
175 | 0
176 |
177 |
178 | 0
179 | 0
180 |
181 | 0
182 |
183 | 1
184 |
185 |
186 |
187 | 0
188 | 0
189 |
190 |
191 |
192 |
193 |
194 |
195 | 0
196 |
197 |
198 |
199 |
200 |
201 |
202 | CloudWatch metrics list discovery EC2
203 | 10
204 |
205 |
206 | cloudwatch_zabbix.py[ec2,"-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST}]
207 | 3600
208 | 0
209 |
210 |
211 |
212 | 0
213 | 0
214 |
215 | 0
216 |
217 |
218 |
219 |
220 | 0
221 |
222 |
223 |
224 |
225 |
226 | :
227 | 30
228 |
229 |
230 |
231 | EC2 CloudWatch Metric stats (Average) [{#METRIC.NAME}]
232 | 2
233 |
234 | 0
235 |
236 | cloudwatch.metric[{#METRIC.NAME}]
237 | 0
238 | 90
239 | 365
240 | 0
241 | 0
242 |
243 |
244 | 0
245 |
246 |
247 | 0
248 | 0
249 |
250 | 0
251 |
252 | 1
253 |
254 |
255 |
256 | 0
257 | 0
258 |
259 |
260 |
261 |
262 |
263 |
264 | 0
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 | {$KEY}
277 |
278 |
279 |
280 | {$REGION}
281 | ap-northeast-1
282 |
283 |
284 | {$SECRET}
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 | Template AWS ELB
293 | Template AWS ELB
294 |
295 |
296 | TIS Templates
297 |
298 |
299 |
300 |
301 | -
302 | Collect CloudWatch metric stats ELB
303 | 10
304 |
305 | 0
306 |
307 | cloudwatch_zabbix.py[elb,"-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST},"-m","True"]
308 | 300
309 | 90
310 | 365
311 | 0
312 | 1
313 |
314 |
315 | 0
316 |
317 |
318 | 0
319 | 0
320 |
321 | 0
322 |
323 | 1
324 |
325 |
326 |
327 | 0
328 | 0
329 |
330 |
331 |
332 |
333 |
334 |
335 | 0
336 |
337 |
338 |
339 |
340 |
341 |
342 | CloudWatch metrics list discovery ELB
343 | 10
344 |
345 |
346 | cloudwatch_zabbix.py[elb,"-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST}]
347 | 3600
348 | 0
349 |
350 |
351 |
352 | 0
353 | 0
354 |
355 | 0
356 |
357 |
358 |
359 |
360 | 0
361 |
362 |
363 |
364 |
365 |
366 | :
367 | 30
368 |
369 |
370 |
371 | ELB CloudWatch Metric stats (Average) [{#METRIC.NAME}]
372 | 2
373 |
374 | 0
375 |
376 | cloudwatch.metric[{#METRIC.NAME}]
377 | 0
378 | 90
379 | 365
380 | 0
381 | 0
382 |
383 |
384 | 0
385 |
386 |
387 | 0
388 | 0
389 |
390 | 0
391 |
392 | 1
393 |
394 |
395 |
396 | 0
397 | 0
398 |
399 |
400 |
401 |
402 |
403 |
404 | 0
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 | {$KEY}
417 |
418 |
419 |
420 | {$REGION}
421 | ap-northeast-1
422 |
423 |
424 | {$SECRET}
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 | Template AWS RDS
433 | Template AWS RDS
434 |
435 |
436 | TIS Templates
437 |
438 |
439 |
440 |
441 | -
442 | Collect CloudWatch metric stats RDS
443 | 10
444 |
445 | 0
446 |
447 | cloudwatch_zabbix.py[rds,"-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST},"-m","True"]
448 | 300
449 | 90
450 | 365
451 | 0
452 | 1
453 |
454 |
455 | 0
456 |
457 |
458 | 0
459 | 0
460 |
461 | 0
462 |
463 | 1
464 |
465 |
466 |
467 | 0
468 | 0
469 |
470 |
471 |
472 |
473 |
474 |
475 | 0
476 |
477 |
478 |
479 |
480 |
481 |
482 | CloudWatch metrics list discovery RDS
483 | 10
484 |
485 |
486 | cloudwatch_zabbix.py[rds,"-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST}]
487 | 3600
488 | 0
489 |
490 |
491 |
492 | 0
493 | 0
494 |
495 | 0
496 |
497 |
498 |
499 |
500 | 0
501 |
502 |
503 |
504 |
505 |
506 | :
507 | 30
508 |
509 |
510 |
511 | RDS CloudWatch Metric stats (Average) [{#METRIC.NAME}]
512 | 2
513 |
514 | 0
515 |
516 | cloudwatch.metric[{#METRIC.NAME}]
517 | 0
518 | 90
519 | 365
520 | 0
521 | 0
522 |
523 |
524 | 0
525 |
526 |
527 | 0
528 | 0
529 |
530 | 0
531 |
532 | 1
533 |
534 |
535 |
536 | 0
537 | 0
538 |
539 |
540 |
541 |
542 |
543 |
544 | 0
545 |
546 |
547 |
548 |
549 |
550 |
551 |
552 |
553 |
554 |
555 |
556 | {$KEY}
557 |
558 |
559 |
560 | {$REGION}
561 | ap-northeast-1
562 |
563 |
564 | {$SECRET}
565 |
566 |
567 |
568 |
569 |
570 |
571 |
572 |
573 |
574 |
--------------------------------------------------------------------------------
/templates/3.0/AWS_Service_Health_Dashboard_template.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 3.0
4 | 2016-07-07T08:19:08Z
5 |
6 |
7 | TIS Templates
8 |
9 |
10 |
11 |
12 | Template AWS Service Health Dashboard
13 | Template AWS Service Health Dashboard
14 |
15 |
16 |
17 | TIS Templates
18 |
19 |
20 |
21 |
22 | -
23 | health stats
24 | 10
25 |
26 | 0
27 |
28 | AWS_Service_Health_Dashboard.py["-i","3600","-b",{HOST.HOST},"-m","True"]
29 | 3600
30 | 90
31 | 0
32 | 0
33 | 4
34 |
35 |
36 | 0
37 |
38 |
39 | 0
40 | 0
41 |
42 | 0
43 |
44 | 1
45 |
46 |
47 |
48 | 0
49 | 0
50 |
51 |
52 |
53 |
54 |
55 |
56 | 0
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 | Service Health Dashboard
65 | 10
66 |
67 |
68 | AWS_Service_Health_Dashboard.py["-i","3600","-b",{HOST.HOST},"-m","False"]
69 | 3600
70 | 0
71 |
72 |
73 |
74 | 0
75 | 0
76 |
77 | 0
78 |
79 |
80 |
81 |
82 | 0
83 |
84 |
85 |
86 |
87 |
88 |
89 | 0
90 |
91 |
92 |
93 | 30
94 |
95 |
96 |
97 | AWS Service Health Dashboard {#SERVICE.NAME} status ({#REGION})
98 | 2
99 |
100 | 0
101 |
102 | health.status[{#SERVICE.NAME}.{#REGION}]
103 | 0
104 | 90
105 | 0
106 | 0
107 | 2
108 |
109 |
110 | 0
111 |
112 |
113 | 0
114 | 0
115 |
116 | 0
117 |
118 | 1
119 |
120 |
121 |
122 | 0
123 | 0
124 |
125 |
126 |
127 |
128 |
129 |
130 | 0
131 |
132 |
133 |
134 |
135 |
136 | {#REGION}
137 |
138 |
139 |
140 |
141 |
142 |
143 | {Template AWS Service Health Dashboard:health.status[{#SERVICE.NAME}.{#REGION}].regexp(Informational message)}=1
144 | Informational message
145 |
146 | 0
147 | 1
148 |
149 | 1
150 |
151 |
152 |
153 | {Template AWS Service Health Dashboard:health.status[{#SERVICE.NAME}.{#REGION}].regexp(Performance issues)}=1
154 | Performance issues
155 |
156 | 0
157 | 2
158 |
159 | 1
160 |
161 |
162 |
163 | {Template AWS Service Health Dashboard:health.status[{#SERVICE.NAME}.{#REGION}].regexp(Service disruption)}=1
164 | Service disruption
165 |
166 | 0
167 | 4
168 |
169 | 1
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
--------------------------------------------------------------------------------
/templates/3.0/AmazonSNS_AWSLambda_Zabbix_template.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 3.0
4 | 2016-08-21T11:06:17Z
5 |
6 |
7 | TIS Templates
8 |
9 |
10 |
11 |
12 | Template AWS SNS EVENT AutoScaling
13 | Template AWS SNS EVENT AutoScaling
14 |
15 |
16 |
17 | TIS Templates
18 |
19 |
20 |
21 |
22 | -
23 | sns.event
24 | 2
25 |
26 | 0
27 |
28 | sns.event
29 | 0
30 | 90
31 | 0
32 | 0
33 | 4
34 |
35 |
36 | 0
37 |
38 |
39 | 0
40 | 0
41 |
42 | 0
43 |
44 | 1
45 |
46 |
47 |
48 | 0
49 | 0
50 |
51 |
52 |
53 |
54 |
55 |
56 | 0
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | {$KEY}
66 |
67 |
68 |
69 | {$REGION}
70 | ap-northeast-1
71 |
72 |
73 | {$SECRET}
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | Template AWS SNS EVENT EC2
82 | Template AWS SNS EVENT EC2
83 |
84 |
85 |
86 | TIS Templates
87 |
88 |
89 |
90 |
91 | -
92 | sns.event
93 | 2
94 |
95 | 0
96 |
97 | sns.event
98 | 0
99 | 90
100 | 0
101 | 0
102 | 4
103 |
104 |
105 | 0
106 |
107 |
108 | 0
109 | 0
110 |
111 | 0
112 |
113 | 1
114 |
115 |
116 |
117 | 0
118 | 0
119 |
120 |
121 |
122 |
123 |
124 |
125 | 0
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 | {$KEY}
135 |
136 |
137 |
138 | {$REGION}
139 | ap-northeast-1
140 |
141 |
142 | {$SECRET}
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 | Template AWS SNS EVENT Other
151 | Template AWS SNS EVENT Other
152 |
153 |
154 |
155 | TIS Templates
156 |
157 |
158 |
159 |
160 | -
161 | sns.event
162 | 2
163 |
164 | 0
165 |
166 | sns.event
167 | 0
168 | 90
169 | 0
170 | 0
171 | 4
172 |
173 |
174 | 0
175 |
176 |
177 | 0
178 | 0
179 |
180 | 0
181 |
182 | 1
183 |
184 |
185 |
186 | 0
187 | 0
188 |
189 |
190 |
191 |
192 |
193 |
194 | 0
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 | Template AWS SNS EVENT RDS
207 | Template AWS SNS EVENT RDS
208 |
209 |
210 |
211 | TIS Templates
212 |
213 |
214 |
215 |
216 | -
217 | sns.event
218 | 2
219 |
220 | 0
221 |
222 | sns.event
223 | 0
224 | 90
225 | 0
226 | 0
227 | 4
228 |
229 |
230 | 0
231 |
232 |
233 | 0
234 | 0
235 |
236 | 0
237 |
238 | 1
239 |
240 |
241 |
242 | 0
243 | 0
244 |
245 |
246 |
247 |
248 |
249 |
250 | 0
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 | {Template AWS SNS EVENT AutoScaling:sns.event.regexp(INSTANCE_LAUNCH_ERROR)}=1
265 | AutoScaling_Instance_Launch_Error
266 |
267 | 0
268 | 3
269 |
270 | 1
271 |
272 |
273 |
274 | {Template AWS SNS EVENT AutoScaling:sns.event.regexp(INSTANCE_TERMINATE_ERROR)}=1
275 | AutoScaling_Instance_Terminate_Error
276 |
277 | 0
278 | 3
279 |
280 | 1
281 |
282 |
283 |
284 | {Template AWS SNS EVENT EC2:sns.event.regexp(ALARM)}=1
285 | EC2_Alarm
286 |
287 | 0
288 | 3
289 |
290 | 1
291 |
292 |
293 |
294 | {Template AWS SNS EVENT EC2:sns.event.regexp(INSUFFICIENT_DATA)}=1
295 | EC2_InsufficientData
296 |
297 | 0
298 | 2
299 |
300 | 1
301 |
302 |
303 |
304 | {Template AWS SNS EVENT Other:sns.event.regexp(ALARM)}=1
305 | Other_Service_Alarm
306 |
307 | 0
308 | 3
309 |
310 | 1
311 |
312 |
313 |
314 | {Template AWS SNS EVENT Other:sns.event.regexp(INSUFFICIENT_DATA)}=1
315 | Other_Service_InsufficientData
316 |
317 | 0
318 | 2
319 |
320 | 1
321 |
322 |
323 |
324 | {Template AWS SNS EVENT RDS:sns.event.regexp(ALARM)}=1
325 | RDS_Alarm
326 |
327 | 0
328 | 3
329 |
330 | 1
331 |
332 |
333 |
334 | {Template AWS SNS EVENT RDS:sns.event.regexp("^EventId.*RDS-EVENT-(0022|0031|0034|0035|0036|0045|0069)")}=1
335 | RDS_Failure_notification
336 |
337 | 0
338 | 4
339 |
340 | 1
341 |
342 |
343 |
344 | {Template AWS SNS EVENT RDS:sns.event.regexp(INSUFFICIENT_DATA)}=1
345 | RDS_InsufficientData
346 |
347 | 0
348 | 2
349 |
350 | 1
351 |
352 |
353 |
354 |
355 |
356 |
--------------------------------------------------------------------------------
/templates/3.0/autoscaling_template.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 3.0
4 | 2016-07-19T23:56:21Z
5 |
6 |
7 | TIS Templates
8 |
9 |
10 |
11 |
12 | Template AWS Auto Scaling
13 | Template AWS Auto Scaling
14 |
15 |
16 |
17 | TIS Templates
18 |
19 |
20 |
21 |
22 | -
23 | Collect Auto Scaling Instances
24 | 10
25 |
26 | 0
27 |
28 | autoscaling_zabbix.py["-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-z","{$ZBX_URL}","-u","{$ZBX_USER}","-p","{$ZBX_PASS}","-m","{$SET_MACRO}","-P","{$PREFFER_IF}"]
29 | 1800
30 | 90
31 | 0
32 | 0
33 | 2
34 |
35 |
36 | 0
37 |
38 |
39 | 0
40 | 0
41 |
42 | 0
43 |
44 | 1
45 |
46 |
47 |
48 | 0
49 | 0
50 |
51 |
52 |
53 |
54 |
55 |
56 | 0
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | {$KEY}
66 |
67 |
68 |
69 | {$PREFFER_IF}
70 | Private
71 |
72 |
73 | {$REGION}
74 |
75 |
76 |
77 | {$SECRET}
78 |
79 |
80 |
81 | {$SET_MACRO}
82 | False
83 |
84 |
85 | {$ZBX_PASS}
86 | zabbix
87 |
88 |
89 | {$ZBX_URL}
90 | http://localhost/zabbix
91 |
92 |
93 | {$ZBX_USER}
94 | Admin
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/templates/3.0/awsbilling_template.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 3.0
4 | 2016-06-17T07:42:54Z
5 |
6 |
7 | TIS Templates
8 |
9 |
10 |
11 |
12 | Template AWS Billing
13 | Template AWS Billing
14 |
15 |
16 |
17 | TIS Templates
18 |
19 |
20 |
21 |
22 | -
23 | Collect AWS Billing
24 | 10
25 |
26 | 0
27 |
28 | cloudwatch_zabbix.py["billing","-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST},"-t",{$TIMERANGE},"-m","True"]
29 | 3600
30 | 90
31 | 0
32 | 0
33 | 1
34 |
35 |
36 | 0
37 |
38 |
39 | 0
40 | 0
41 |
42 | 0
43 |
44 | 1
45 |
46 |
47 |
48 | 0
49 | 0
50 |
51 |
52 |
53 |
54 |
55 |
56 | 0
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 | Billing metrics list discovery services
65 | 10
66 |
67 |
68 | cloudwatch_zabbix.py["billing","-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST},"-t",{$TIMERANGE}]
69 | 3600
70 | 0
71 |
72 |
73 |
74 | 0
75 | 0
76 |
77 | 0
78 |
79 |
80 |
81 |
82 | 0
83 |
84 |
85 |
86 |
87 |
88 |
89 | 0
90 |
91 |
92 |
93 | 30
94 |
95 |
96 |
97 | Billing stats (Average) [{#METRIC.NAME}.{#METRIC.SERVICENAME}]
98 | 2
99 |
100 | 0
101 |
102 | cloudwatch.metric[{#METRIC.NAME}.{#METRIC.SERVICENAME}]
103 | 0
104 | 90
105 | 365
106 | 0
107 | 0
108 |
109 | USD
110 | 0
111 |
112 |
113 | 0
114 | 0
115 |
116 | 0
117 |
118 | 1
119 |
120 |
121 |
122 | 0
123 | 0
124 |
125 |
126 |
127 |
128 |
129 |
130 | 0
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 | {$KEY}
145 |
146 |
147 |
148 | {$REGION}
149 | us-east-1
150 |
151 |
152 | {$SECRET}
153 |
154 |
155 |
156 | {$TIMERANGE}
157 | 400
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
--------------------------------------------------------------------------------
/templates/3.0/cloudwatch_template.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 3.0
4 | 2016-05-21T23:23:55Z
5 |
6 |
7 | TIS Templates
8 |
9 |
10 |
11 |
12 | Template AWS EBS
13 | Template AWS EBS
14 |
15 |
16 |
17 | TIS Templates
18 |
19 |
20 |
21 |
22 | -
23 | Collect CloudWatch metric stats EBS
24 | 10
25 |
26 | 0
27 |
28 | cloudwatch_zabbix.py[ebs,"-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST},"-m","True"]
29 | 300
30 | 90
31 | 0
32 | 0
33 | 1
34 |
35 |
36 | 0
37 |
38 |
39 | 0
40 | 0
41 |
42 | 0
43 |
44 | 1
45 |
46 |
47 |
48 | 0
49 | 0
50 |
51 |
52 |
53 |
54 |
55 |
56 | 0
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 | CloudWatch metrics list discovery EBS
65 | 10
66 |
67 |
68 | cloudwatch_zabbix.py[ebs,"-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST}]
69 | 3600
70 | 0
71 |
72 |
73 |
74 | 0
75 | 0
76 |
77 | 0
78 |
79 |
80 |
81 |
82 | 0
83 |
84 |
85 |
86 |
87 |
88 |
89 | 0
90 |
91 |
92 |
93 | 30
94 |
95 |
96 |
97 | EBS CloudWatch Metric stats (Average) [{#METRIC.NAME}]
98 | 2
99 |
100 | 0
101 |
102 | cloudwatch.metric[{#METRIC.NAME}]
103 | 0
104 | 90
105 | 365
106 | 0
107 | 0
108 |
109 | {#METRIC.UNIT}
110 | 0
111 |
112 |
113 | 0
114 | 0
115 |
116 | 0
117 |
118 | 1
119 |
120 |
121 |
122 | 0
123 | 0
124 |
125 |
126 |
127 |
128 |
129 |
130 | 0
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 | {$KEY}
145 |
146 |
147 |
148 | {$REGION}
149 | ap-northeast-1
150 |
151 |
152 | {$SECRET}
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 | Template AWS EC2
161 | Template AWS EC2
162 |
163 |
164 |
165 | TIS Templates
166 |
167 |
168 |
169 |
170 | -
171 | Collect CloudWatch metric stats EC2
172 | 10
173 |
174 | 0
175 |
176 | cloudwatch_zabbix.py[ec2,"-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST},"-m","True"]
177 | 300
178 | 90
179 | 0
180 | 0
181 | 1
182 |
183 |
184 | 0
185 |
186 |
187 | 0
188 | 0
189 |
190 | 0
191 |
192 | 1
193 |
194 |
195 |
196 | 0
197 | 0
198 |
199 |
200 |
201 |
202 |
203 |
204 | 0
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 | CloudWatch metrics list discovery EC2
213 | 10
214 |
215 |
216 | cloudwatch_zabbix.py[ec2,"-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST}]
217 | 3600
218 | 0
219 |
220 |
221 |
222 | 0
223 | 0
224 |
225 | 0
226 |
227 |
228 |
229 |
230 | 0
231 |
232 |
233 |
234 |
235 |
236 |
237 | 0
238 |
239 |
240 |
241 | 30
242 |
243 |
244 |
245 | EC2 CloudWatch Metric stats (Average) [{#METRIC.NAME}]
246 | 2
247 |
248 | 0
249 |
250 | cloudwatch.metric[{#METRIC.NAME}]
251 | 0
252 | 90
253 | 365
254 | 0
255 | 0
256 |
257 | {#METRIC.UNIT}
258 | 0
259 |
260 |
261 | 0
262 | 0
263 |
264 | 0
265 |
266 | 1
267 |
268 |
269 |
270 | 0
271 | 0
272 |
273 |
274 |
275 |
276 |
277 |
278 | 0
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 | {$REGION}
293 | ap-northeast-1
294 |
295 |
296 | {$KEY}
297 |
298 |
299 |
300 | {$SECRET}
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 | Template AWS ELB
309 | Template AWS ELB
310 |
311 |
312 |
313 | TIS Templates
314 |
315 |
316 |
317 |
318 | -
319 | Collect CloudWatch metric stats ELB
320 | 10
321 |
322 | 0
323 |
324 | cloudwatch_zabbix.py[elb,"-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST},"-m","True"]
325 | 300
326 | 90
327 | 0
328 | 0
329 | 1
330 |
331 |
332 | 0
333 |
334 |
335 | 0
336 | 0
337 |
338 | 0
339 |
340 | 1
341 |
342 |
343 |
344 | 0
345 | 0
346 |
347 |
348 |
349 |
350 |
351 |
352 | 0
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 | CloudWatch metrics list discovery ELB
361 | 10
362 |
363 |
364 | cloudwatch_zabbix.py[elb,"-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST}]
365 | 3600
366 | 0
367 |
368 |
369 |
370 | 0
371 | 0
372 |
373 | 0
374 |
375 |
376 |
377 |
378 | 0
379 |
380 |
381 |
382 |
383 |
384 |
385 | 0
386 |
387 |
388 |
389 | 30
390 |
391 |
392 |
393 | ELB CloudWatch Metric stats (Average) [{#METRIC.NAME}]
394 | 2
395 |
396 | 0
397 |
398 | cloudwatch.metric[{#METRIC.NAME}]
399 | 0
400 | 90
401 | 365
402 | 0
403 | 0
404 |
405 | {#METRIC.UNIT}
406 | 0
407 |
408 |
409 | 0
410 | 0
411 |
412 | 0
413 |
414 | 1
415 |
416 |
417 |
418 | 0
419 | 0
420 |
421 |
422 |
423 |
424 |
425 |
426 | 0
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 | {$KEY}
441 |
442 |
443 |
444 | {$REGION}
445 | ap-northeast-1
446 |
447 |
448 | {$SECRET}
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 | Template AWS RDS
457 | Template AWS RDS
458 |
459 |
460 |
461 | TIS Templates
462 |
463 |
464 |
465 |
466 | -
467 | Collect CloudWatch metric stats RDS
468 | 10
469 |
470 | 0
471 |
472 | cloudwatch_zabbix.py[rds,"-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST},"-m","True"]
473 | 300
474 | 90
475 | 0
476 | 0
477 | 1
478 |
479 |
480 | 0
481 |
482 |
483 | 0
484 | 0
485 |
486 | 0
487 |
488 | 1
489 |
490 |
491 |
492 | 0
493 | 0
494 |
495 |
496 |
497 |
498 |
499 |
500 | 0
501 |
502 |
503 |
504 |
505 |
506 |
507 |
508 | CloudWatch metrics list discovery RDS
509 | 10
510 |
511 |
512 | cloudwatch_zabbix.py[rds,"-r",{$REGION},"-a",{$KEY},"-s",{$SECRET},"-i",{HOST.HOST}]
513 | 3600
514 | 0
515 |
516 |
517 |
518 | 0
519 | 0
520 |
521 | 0
522 |
523 |
524 |
525 |
526 | 0
527 |
528 |
529 |
530 |
531 |
532 |
533 | 0
534 |
535 |
536 |
537 | 30
538 |
539 |
540 |
541 | RDS CloudWatch Metric stats (Average) [{#METRIC.NAME}]
542 | 2
543 |
544 | 0
545 |
546 | cloudwatch.metric[{#METRIC.NAME}]
547 | 0
548 | 90
549 | 365
550 | 0
551 | 0
552 |
553 | {#METRIC.UNIT}
554 | 0
555 |
556 |
557 | 0
558 | 0
559 |
560 | 0
561 |
562 | 1
563 |
564 |
565 |
566 | 0
567 | 0
568 |
569 |
570 |
571 |
572 |
573 |
574 | 0
575 |
576 |
577 |
578 |
579 |
580 |
581 |
582 |
583 |
584 |
585 |
586 |
587 |
588 | {$KEY}
589 |
590 |
591 |
592 | {$REGION}
593 | ap-northeast-1
594 |
595 |
596 | {$SECRET}
597 |
598 |
599 |
600 |
601 |
602 |
603 |
604 |
605 |
--------------------------------------------------------------------------------