Skip to content

Instantly share code, notes, and snippets.

@yokota-shinsuke
Last active December 31, 2023 09:01
Show Gist options
  • Save yokota-shinsuke/7350559 to your computer and use it in GitHub Desktop.
Save yokota-shinsuke/7350559 to your computer and use it in GitHub Desktop.
Zabbix template for AWS/RDS and Ruby script for external check. The template includes Item definitions(all CloudWatch metrics), Graph definitions and Screen definition. Zabbix server needs role with to enough permissions to read CloudWatch and rubygem-aws-sdk. Put script "cloud_watch" at zabbix-server:/usr/lib/zabbix/externalscripts, add excite …
#!/usr/bin/ruby
require 'rubygems'
require 'aws-sdk'
require 'optparse'
params = ARGV.getopts(
"",
"region:",
"service:",
"metric:",
"dimension_name:",
"dimension_value:",
"statistics:"
)
AWS.config({
:cloud_watch_endpoint => "monitoring.#{params['region']}.amazonaws.com",
})
metric = AWS::CloudWatch::Metric.new(
"AWS/#{params['service']}",
params['metric'],
:dimensions => [{
:name => params['dimension_name'],
:value => params['dimension_value']
}]
)
stats = metric.statistics(
:start_time => Time.now - 300,
:end_time => Time.now,
:statistics => params['statistics']
)
last_stats = stats.sort_by{|stat| stat[:timestamp]}.last
exit if last_stats.nil?
puts last_stats[params['statistics'].downcase.to_sym]
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2013-11-07T06:59:42Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
<template>
<template>Template AWS RDS</template>
<name>Template AWS RDS</name>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<applications/>
<items>
<item>
<name>BinLogDiskUsage</name>
<type>10</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>cloud_watch[&quot;--metric&quot;,&quot;BinLogDiskUsage&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
<delay>60</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>Bytes</units>
<delta>0</delta>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authpassphrase/>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications/>
<valuemap/>
</item>
<item>
<name>CPUUtilization</name>
<type>10</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>cloud_watch[&quot;--metric&quot;,&quot;CPUUtilization&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
<delay>60</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>%</units>
<delta>0</delta>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authpassphrase/>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications/>
<valuemap/>
</item>
<item>
<name>DatabaseConnections</name>
<type>10</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>cloud_watch[&quot;--metric&quot;,&quot;DatabaseConnections&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
<delay>60</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>3</value_type>
<allowed_hosts/>
<units>Count</units>
<delta>0</delta>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authpassphrase/>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications/>
<valuemap/>
</item>
<item>
<name>DiskQueueDepth</name>
<type>10</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>cloud_watch[&quot;--metric&quot;,&quot;DiskQueueDepth&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
<delay>60</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>Count</units>
<delta>0</delta>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authpassphrase/>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications/>
<valuemap/>
</item>
<item>
<name>FreeableMemory</name>
<type>10</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>cloud_watch[&quot;--metric&quot;,&quot;FreeableMemory&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
<delay>60</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>Bytes</units>
<delta>0</delta>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authpassphrase/>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications/>
<valuemap/>
</item>
<item>
<name>FreeStorageSpace</name>
<type>10</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>cloud_watch[&quot;--metric&quot;,&quot;FreeStorageSpace&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
<delay>60</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>Bytes</units>
<delta>0</delta>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authpassphrase/>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications/>
<valuemap/>
</item>
<item>
<name>ReadIOPS</name>
<type>10</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>cloud_watch[&quot;--metric&quot;,&quot;ReadIOPS&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
<delay>60</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>Count/Second</units>
<delta>0</delta>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authpassphrase/>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications/>
<valuemap/>
</item>
<item>
<name>ReadLatency</name>
<type>10</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>cloud_watch[&quot;--metric&quot;,&quot;ReadLatency&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
<delay>60</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>Seconds</units>
<delta>0</delta>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authpassphrase/>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications/>
<valuemap/>
</item>
<item>
<name>ReadThroughput</name>
<type>10</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>cloud_watch[&quot;--metric&quot;,&quot;ReadThroughput&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
<delay>60</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>Bytes/Second</units>
<delta>0</delta>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authpassphrase/>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications/>
<valuemap/>
</item>
<item>
<name>ReplicaLag</name>
<type>10</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>cloud_watch[&quot;--metric&quot;,&quot;ReplicaLag&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
<delay>60</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>Seconds</units>
<delta>0</delta>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authpassphrase/>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications/>
<valuemap/>
</item>
<item>
<name>SwapUsage</name>
<type>10</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>cloud_watch[&quot;--metric&quot;,&quot;SwapUsage&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
<delay>60</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>Bytes</units>
<delta>0</delta>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authpassphrase/>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications/>
<valuemap/>
</item>
<item>
<name>WriteIOPS</name>
<type>10</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>cloud_watch[&quot;--metric&quot;,&quot;WriteIOPS&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
<delay>60</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>Count/Second</units>
<delta>0</delta>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authpassphrase/>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications/>
<valuemap/>
</item>
<item>
<name>WriteLatency</name>
<type>10</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>cloud_watch[&quot;--metric&quot;,&quot;WriteLatency&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
<delay>60</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>Seconds</units>
<delta>0</delta>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authpassphrase/>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications/>
<valuemap/>
</item>
<item>
<name>WriteThroughput</name>
<type>10</type>
<snmp_community/>
<multiplier>0</multiplier>
<snmp_oid/>
<key>cloud_watch[&quot;--metric&quot;,&quot;WriteThroughput&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
<delay>60</delay>
<history>90</history>
<trends>365</trends>
<status>0</status>
<value_type>0</value_type>
<allowed_hosts/>
<units>Bytes/Second</units>
<delta>0</delta>
<snmpv3_securityname/>
<snmpv3_securitylevel>0</snmpv3_securitylevel>
<snmpv3_authpassphrase/>
<snmpv3_privpassphrase/>
<formula>1</formula>
<delay_flex/>
<params/>
<ipmi_sensor/>
<data_type>0</data_type>
<authtype>0</authtype>
<username/>
<password/>
<publickey/>
<privatekey/>
<port/>
<description/>
<inventory_link>0</inventory_link>
<applications/>
<valuemap/>
</item>
</items>
<discovery_rules/>
<macros/>
<templates/>
<screens>
<screen>
<name>RDS Metrics</name>
<hsize>2</hsize>
<vsize>7</vsize>
<screen_items>
<screen_item>
<resourcetype>0</resourcetype>
<width>500</width>
<height>100</height>
<x>0</x>
<y>0</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<style>0</style>
<url/>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<resource>
<name>CPUUtilization</name>
<host>Template AWS RDS</host>
</resource>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<width>500</width>
<height>100</height>
<x>1</x>
<y>0</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<style>0</style>
<url/>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<resource>
<name>FreeableMemory</name>
<host>Template AWS RDS</host>
</resource>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<width>500</width>
<height>100</height>
<x>0</x>
<y>1</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<style>0</style>
<url/>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<resource>
<name>ReadIOPS</name>
<host>Template AWS RDS</host>
</resource>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<width>500</width>
<height>100</height>
<x>1</x>
<y>1</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<style>0</style>
<url/>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<resource>
<name>WriteIOPS</name>
<host>Template AWS RDS</host>
</resource>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<width>500</width>
<height>100</height>
<x>0</x>
<y>2</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<style>0</style>
<url/>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<resource>
<name>ReadThroughput</name>
<host>Template AWS RDS</host>
</resource>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<width>500</width>
<height>100</height>
<x>1</x>
<y>2</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<style>0</style>
<url/>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<resource>
<name>WriteThroughput</name>
<host>Template AWS RDS</host>
</resource>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<width>500</width>
<height>100</height>
<x>0</x>
<y>3</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<style>0</style>
<url/>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<resource>
<name>ReadLatency</name>
<host>Template AWS RDS</host>
</resource>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<width>500</width>
<height>100</height>
<x>1</x>
<y>3</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<style>0</style>
<url/>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<resource>
<name>WriteLatency</name>
<host>Template AWS RDS</host>
</resource>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<width>500</width>
<height>100</height>
<x>0</x>
<y>4</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<style>0</style>
<url/>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<resource>
<name>FreeStorageSpace</name>
<host>Template AWS RDS</host>
</resource>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<width>500</width>
<height>100</height>
<x>1</x>
<y>4</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<style>0</style>
<url/>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<resource>
<name>SwapUsage</name>
<host>Template AWS RDS</host>
</resource>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<width>500</width>
<height>100</height>
<x>0</x>
<y>5</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<style>0</style>
<url/>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<resource>
<name>DatabaseConnections</name>
<host>Template AWS RDS</host>
</resource>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<width>500</width>
<height>100</height>
<x>1</x>
<y>5</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<style>0</style>
<url/>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<resource>
<name>DiskQueueDepth</name>
<host>Template AWS RDS</host>
</resource>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<width>500</width>
<height>100</height>
<x>0</x>
<y>6</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<style>0</style>
<url/>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<resource>
<name>BinLogDiskUsage</name>
<host>Template AWS RDS</host>
</resource>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<width>500</width>
<height>100</height>
<x>1</x>
<y>6</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<style>0</style>
<url/>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<resource>
<name>ReplicaLag</name>
<host>Template AWS RDS</host>
</resource>
</screen_item>
</screen_items>
</screen>
</screens>
</template>
</templates>
<graphs>
<graph>
<name>BinLogDiskUsage</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>1</show_work_period>
<show_triggers>1</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>0</drawtype>
<color>C80000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template AWS RDS</host>
<key>cloud_watch[&quot;--metric&quot;,&quot;BinLogDiskUsage&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>CPUUtilization</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>1</show_work_period>
<show_triggers>1</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>0</drawtype>
<color>C80000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template AWS RDS</host>
<key>cloud_watch[&quot;--metric&quot;,&quot;CPUUtilization&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>DatabaseConnections</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>1</show_work_period>
<show_triggers>1</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>0</drawtype>
<color>C80000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template AWS RDS</host>
<key>cloud_watch[&quot;--metric&quot;,&quot;DatabaseConnections&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>DiskQueueDepth</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>1</show_work_period>
<show_triggers>1</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>0</drawtype>
<color>C80000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template AWS RDS</host>
<key>cloud_watch[&quot;--metric&quot;,&quot;DiskQueueDepth&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>FreeableMemory</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>1</show_work_period>
<show_triggers>1</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>0</drawtype>
<color>C80000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template AWS RDS</host>
<key>cloud_watch[&quot;--metric&quot;,&quot;FreeableMemory&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>FreeStorageSpace</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>1</show_work_period>
<show_triggers>1</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>0</drawtype>
<color>C80000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template AWS RDS</host>
<key>cloud_watch[&quot;--metric&quot;,&quot;FreeStorageSpace&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>ReadIOPS</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>1</show_work_period>
<show_triggers>1</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>0</drawtype>
<color>C80000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template AWS RDS</host>
<key>cloud_watch[&quot;--metric&quot;,&quot;ReadIOPS&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>ReadLatency</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>1</show_work_period>
<show_triggers>1</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>0</drawtype>
<color>C80000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template AWS RDS</host>
<key>cloud_watch[&quot;--metric&quot;,&quot;ReadLatency&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>ReadThroughput</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>1</show_work_period>
<show_triggers>1</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>0</drawtype>
<color>C80000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template AWS RDS</host>
<key>cloud_watch[&quot;--metric&quot;,&quot;ReadThroughput&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>ReplicaLag</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>1</show_work_period>
<show_triggers>1</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>0</drawtype>
<color>C80000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template AWS RDS</host>
<key>cloud_watch[&quot;--metric&quot;,&quot;ReplicaLag&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>SwapUsage</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>1</show_work_period>
<show_triggers>1</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>0</drawtype>
<color>C80000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template AWS RDS</host>
<key>cloud_watch[&quot;--metric&quot;,&quot;SwapUsage&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>WriteIOPS</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>1</show_work_period>
<show_triggers>1</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>0</drawtype>
<color>C80000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template AWS RDS</host>
<key>cloud_watch[&quot;--metric&quot;,&quot;WriteIOPS&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>WriteLatency</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>1</show_work_period>
<show_triggers>1</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>0</drawtype>
<color>C80000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template AWS RDS</host>
<key>cloud_watch[&quot;--metric&quot;,&quot;WriteLatency&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>WriteThroughput</name>
<width>900</width>
<height>200</height>
<yaxismin>0.0000</yaxismin>
<yaxismax>100.0000</yaxismax>
<show_work_period>1</show_work_period>
<show_triggers>1</show_triggers>
<type>0</type>
<show_legend>1</show_legend>
<show_3d>0</show_3d>
<percent_left>0.0000</percent_left>
<percent_right>0.0000</percent_right>
<ymin_type_1>0</ymin_type_1>
<ymax_type_1>0</ymax_type_1>
<ymin_item_1>0</ymin_item_1>
<ymax_item_1>0</ymax_item_1>
<graph_items>
<graph_item>
<sortorder>0</sortorder>
<drawtype>0</drawtype>
<color>C80000</color>
<yaxisside>0</yaxisside>
<calc_fnc>2</calc_fnc>
<type>0</type>
<item>
<host>Template AWS RDS</host>
<key>cloud_watch[&quot;--metric&quot;,&quot;WriteThroughput&quot;,&quot;--dimension_name&quot;,&quot;DBInstanceIdentifier&quot;,&quot;--dimension_value&quot;,&quot;{HOST.NAME}&quot;,&quot;--statistics&quot;,&quot;Average&quot;,&quot;--service&quot;,&quot;RDS&quot;,&quot;--region&quot;,&quot;ap-northeast-1&quot;]</key>
</item>
</graph_item>
</graph_items>
</graph>
</graphs>
</zabbix_export>
@geoffreyprice
Copy link

Looks like the constant in 'aws-sdk' has changed from AWS to Aws, after making this change was able to pull data. Thank you!!!

@vukomir
Copy link

vukomir commented Sep 28, 2015

Hi g-price,

Thanks for the info, i have change AWS to Aws but i get the following error in zabbix server log

cloud_watch["--metric","BinLogDiskUsage","--dimension_name","DBInstanceIdentifier","--dimension_value","{HOST.NAME}","--statistics","Average","--service","RDS","--region","ap-northeast-1"]" became not supported: Received value [/usr/lib/zabbix/externalscripts/cloud_watch:17:in `

': wrong number of arguments (1 for 0) (ArgumentError)] is not suitable for value type [Numeric (float)]

@khoi-thinh
Copy link

Can someone tell me how to use this?
I downloaded the XML file and imported into Zabbix but when adding a new host how can i deal with the IP address? The RDS dont have IP, right?
In case i use the IP of my EC2 instance and use RDS template it still show up but i dont know what is it?

@pratapsingh
Copy link

Anyone have solution for the error ?

[/usr/lib/zabbix/externalscripts/cloud_watch:17:in `

': wrong number of arguments (1 for 0) (ArgumentError)] is not suitable for value type [Numeric (float)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment