Monitoring AWS Health Dashboard RSS with Zabbix

Posted: August 27, 2018 in Amazon Web Services (AWS)

Next procedure will enable monitoring AWS status RSS feeds https://status.aws.amazon.com/

I modified this template and added troubleshooting steps for issues i experienced.

All files can be downloaded from here.

copy AWS_Service_Health_Dashboard.py script to /lib/zabbix//usr/lib/zabbix/externalscripts

pip install feedparser
pip install python-dateutil
 
#need to change System time zone to PDT, otherwise error occurs
 
#/usr/lib/python2.7/site-packages/dateutil/parser/_parser.py:1204: UnknownTimezoneWarning: tzname PDT identified but not understood.  Pass `tzinfos` argument in order to correctly return a timezone-aware datetime.  In a #future version, this will raise an exception.
  #category=UnknownTimezoneWarning)
#/usr/lib/python2.7/site-packages/dateutil/parser/_parser.py:1204: UnknownTimezoneWarning: tzname PST identified but not understood.  Pass `tzinfos` argument in order to correctly return a timezone-aware datetime.  In a #future version, this will raise an exception.
  #category=UnknownTimezoneWarning) 
 
#set PDT time zone to avoid above errors

timedatectl set-timezone America/Chicago

chmod +x AWS_Service_Health_Dashboard.py
chown zabbix:zabix WS_Service_Health_Dashboard.py

./AWS_Service_Health_Dashboard.py "-i" "3600" "-b" NA '-m' "TRUE"
#Output:
 
{"response":"success","info":"processed: 0; failed: 0; total: 0; seconds spent: 0.000005"}
{"response":"success","info":"processed: 0; failed: 0; total: 0; seconds spent: 0.000004"}
{"response":"success","info":"processed: 0; failed: 0; total: 0; seconds spent: 0.000005"}
{"response":"success","info":"processed: 0; failed: 0; total: 0; seconds spent: 0.000005"}
{"response":"success","info":"processed: 0; failed: 0; total: 0; seconds spent: 0.000004"}
{"response":"success","info":"processed: 0; failed: 0; total: 0; seconds spent: 0.000004"}

Create 4 hosts (one for each Region) :NA,SA,EU and AP

Set Visible name same as host name and add host to TIS Templates group

10.PNG

Attach template to all 4 hosts

If needed, disable items for services you don’t want to monitor
If full errors can’t be seen in Zabbix dashboard edit following file (CentOS 7)

vi /usr/share/zabbix/include/items.inc.php
apply value mapping
switch ($item['value_type']) {
case ITEM_VALUE_TYPE_STR:
$mapping = getMappedValue($value, $item['valuemapid']);
// break; is not missing here
case ITEM_VALUE_TYPE_TEXT:
case ITEM_VALUE_TYPE_LOG:
if ($trim && mb_strlen($value) > 80) {
$value = mb_substr($value, 0, 80).'...';

#restart Zabbix service

systemctl restart zabbix-service

If all is OK you should see something like this

11.PNG

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s