[ZBX-23136] AWS EC2 template is not showing EBS volumes Created: 2023 Jul 21 Updated: 2024 Apr 10 Resolved: 2023 Oct 03 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Templates (T) |
Affects Version/s: | 6.0.19 |
Fix Version/s: | None |
Type: | Problem report | Priority: | Major |
Reporter: | Jiri Mikes | Assignee: | Alexander Bakaldin |
Resolution: | Fixed | Votes: | 1 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
AWS EC2 (over 100 instances), EBS volumes (over 500) |
Attachments: |
![]() ![]() ![]() ![]() ![]() ![]() |
Team: |
Description |
Steps to reproduce:
Result: Expected: Solution: payload['MaxResults'] = 100, By tests: AWS API is getting first 100 volumes, after this is applying filter on this result |
Comments |
Comment by Jiri Mikes [ 2023 Jul 21 ] |
Part of Javascript before: payload['Action'] = 'DescribeVolumes', payload['Version'] = '2016-11-15', payload['Filter.1.Name'] = 'attachment.instance-id', payload['Filter.1.Value'] = AwsEbs.params.instance_id; Part of Javascript after modification: payload['Action'] = 'DescribeVolumes', payload['MaxResults'] = 100, payload['Version'] = '2016-11-15', payload['Filter.1.Name'] = 'attachment.instance-id', payload['Filter.1.Value'] = AwsEbs.params.instance_id; Item: aws.ec2.get_volumes Similar problem is in item: aws.ec2.get_alarms |
Comment by Evgenii Gordymov [ 2023 Aug 02 ] |
Hello, jirimikes! I was unable to reproduce the issue in 6.0.19. 1. Create AWS EC2 with 9 vol. 2. Reduced the number to 5 in JS
payload['MaxResults'] = 5
Can you show the logs and the test result in the web interface add this string in JS to see raw data
Zabbix.log(3, '[ AWS EBS ] VOL: ' + JSON.stringify(volumes))
example logs
|
Comment by Riaan Olivier [ 2023 Aug 23 ] |
Please note that I spend allot of time with Amazon on this and found out that there documentation (DescribeVolumes - Amazon Elastic Compute Cloud) states the following: nextToken The token to include in another request to get the next page of items. This value is null when there are no more items to return.
This basically means that you need to loop until the nextToken is null. I have made an update to the code to accommodate this with the MaxResults still set to 100 and it returns the results correctly now. Please note that this is the way every AWS API works. I also fixed the fact that nextToken was spelled as NextToken in this loopkup: volumes.DescribeVolumesResponse.nextToken Reference to pull request that fixes this template |
Comment by Alexander Bakaldin [ 2023 Oct 03 ] |
It was resolved during ZBXNEXT-8283. |