Hi all,
I am publishing simple external check script to get running/stopped state of EC2 instances from AWS API. It may be useful for general monitoring of instances, count of running instances using aggregation (grpsum) and setting dependencies to silent other triggers while instance is in stopped state.
Instructions:
1. Put script to /usr/local/share/zabbix/externalscripts and set permissions
2. Edit script to set correct region and AWS keys
3. Create external check item in template or host with following key: ec2.us.east.get.state.py[{$AWSID}]
4. Set macro {$AWSID} on EC2 instance host in Zabbix with EC2 instance id
5. Set triggers and grpsum items. When EC2 instance is running script output is 1, when stopped - 0.
Script:
I am publishing simple external check script to get running/stopped state of EC2 instances from AWS API. It may be useful for general monitoring of instances, count of running instances using aggregation (grpsum) and setting dependencies to silent other triggers while instance is in stopped state.
Instructions:
1. Put script to /usr/local/share/zabbix/externalscripts and set permissions
2. Edit script to set correct region and AWS keys
3. Create external check item in template or host with following key: ec2.us.east.get.state.py[{$AWSID}]
4. Set macro {$AWSID} on EC2 instance host in Zabbix with EC2 instance id
5. Set triggers and grpsum items. When EC2 instance is running script output is 1, when stopped - 0.
Script:
Comment