Hey there,
we are working with AWS mainly and use burstable EC2 instances at some points. Burstable EC2 instances are virtual machines with CPU credits, which needs to be monitored, due giving an inoperable system if exhausted. We are obtaining this value with a cronjob-script from the AWS API sent to zabbix trapper and having a calculated item based on this trapper for the triggers. As not all instances are burstable those calculated items are extending my not supported items list unnecessary - so I would prefer establishing a discovery rule for this.
I got a template with an item
giving back t2.medium, t3.medium or t3a.medium for a medium sized, burstable instance for example.
I created discovery rule being dependent on this item but as discovery rules can be fed with JSON only, I added a preprocessing step with JavaScript
This preprocessed JSON is passed to the LDD macro
and finally filtered by
Finally I added a prototype item dependent on the item mentioned at the beginning associating the appropiate maximum available CPU credits

with JavaScript preprocessing
The discoery rule is reporting no errors although there is no item created.
Please let me know how to proceed.
Greetings,
Plex
we are working with AWS mainly and use burstable EC2 instances at some points. Burstable EC2 instances are virtual machines with CPU credits, which needs to be monitored, due giving an inoperable system if exhausted. We are obtaining this value with a cronjob-script from the AWS API sent to zabbix trapper and having a calculated item based on this trapper for the triggers. As not all instances are burstable those calculated items are extending my not supported items list unnecessary - so I would prefer establishing a discovery rule for this.
I got a template with an item
Code:
system.run[curl -s -f http://169.254.169.254/latest/meta-data/instance-type]
I created discovery rule being dependent on this item but as discovery rules can be fed with JSON only, I added a preprocessing step with JavaScript
Code:
return '{"data": {"name": "' + value + '"}}';
Code:
{#INSTANCE_TYPE} pickup from JSONpath $.name
Code:
{#INSTANCE_TYPE} matches ^t(2|3a?)\.(nano|micro|small|medium|large|xlarge|2xlarge)$
with JavaScript preprocessing
Code:
if (/^t2.nano$/.test(value)) {return 72};
if (/^t(2\.micro|3a?\.nano)$/.test(value)) {return 144};
if (/^t(2\.small|3a?\.micro)$/.test(value)) {return 288};
if (/^t((2|3a?)\.medium|3a?\.small)$/.test(value)) {return 576};
if (/^t(2|3a?).large$/.test(value)) {return 864};
if (/^t2.xlarge$/.test(value)) {return 1296};
if (/^t2.2xlarge$/.test(value)) {return 1958.4};
if (/^t3a?.xlarge$/.test(value)) {return 2304};
if (/^t3a?.2xlarge$/.test(value)) {return 4608};
Please let me know how to proceed.
Greetings,
Plex
Comment