[ZBX-12497] vmware.eventlog only get latest 10 logs in one collection process Created: 2017 Aug 10  Updated: 2024 Apr 10  Resolved: 2017 Nov 28

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: 2.2.20
Fix Version/s: 3.0.14rc1, 3.2.11rc1, 3.4.5rc1, 4.0.0alpha1, 4.0 (plan)

Type: Problem report Priority: Minor
Reporter: Daisuke Ikeda Assignee: Glebs Ivanovskis (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

VMware ESXi 5.5, vCenter 5.5 (only check this version but other VMware version maybe same)


Attachments: File ZBX-12497-quickfix.patch    
Issue Links:
Causes
causes ZBX-13441 Zabbix Server stopped Closed
causes ZBX-16915 Memory leak when vmware.eventlog is c... Closed
Team: Team C
Sprint: Sprint 18, Sprint 19, Sprint 20, Sprint 21, Sprint 22
Story Points: 3

 Description   

I noticed that vmware.eventlog item can only get latest 10 logs in one collection process.
If more than 10 event logs are outputted during the check interval of VMwareCollector (VMwareFrequency), over 10 event logs will not be monitored in Zabbix history data.

Are there planning to fix this issue?

VMware EventHistoryCollector object has SetCollectorPageSize method.
By using this method, EventHistoryCollector returns more than 10 event logs.(1000 is limit as VMware specification)

e.g. (set 100)

curl -X POST -s -k -b vmware_soap_session=${session_id} -H "Soapaction:urn:vim25/4.1" -H "Content-Type:text/xml; charset=utf-8" -d "\
<?xml version=\"1.0\" encoding=\"UTF-8\"?>\
<SOAP-ENV:Envelope xmlns:ns0=\"urn:vim25\"\
 xmlns:ns1=\"http://schemas.xmlsoap.org/soap/envelope/\"\
 xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\
 xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">\
<SOAP-ENV:Header/>\
<ns1:Body>\
<ns0:SetCollectorPageSize>\
<ns0:_this type=\"EventHistoryCollector\">${history_collector_session_name(session[xxx-xxx-xx..]yy-yy-...)}</ns0:_this>\
<ns0:maxCount>100</ns0:maxCount>\
</ns0:SetCollectorPageSize>\
</ns1:Body>\
</SOAP-ENV:Envelope>" https://esxi-server/sdk

By this change, load and data size may increase, but the possibility of lost logs will be low.

please consider.
best regards



 Comments   
Comment by Glebs Ivanovskis (Inactive) [ 2017 Oct 03 ]

Maybe I am looking at wrong place, but VMware documentation says that default limit is 1000, not 10.

Comment by Glebs Ivanovskis (Inactive) [ 2017 Oct 03 ]

Aha, seems I've got the point... We get 1000 in pages of 10 and we need to use ContinueRetrievePropertiesEx like we do in vmware_service_get_hv_list(). I believe SetCollectorPageSize suggested in issue description can only be used to limit 1000 to something smaller.

Comment by Glebs Ivanovskis (Inactive) [ 2017 Nov 15 ]

I'm attaching ZBX-12497-quickfix.patch which basically implements what ike-dai has suggested — increasing size of latestPage of EventHistoryCollector‍'s PropertyCollector to 100.

This is by far not the most elegant solution because:

  • amount of memory consumed by events increases manyfold;
  • events still may be lost if they are generated at a higher rate.

Unfortunately, I've spent a lot of time figuring out how we can get more from PropertyCollector. It was a false lead. There is only one property in EventHistoryCollector‍'s PropertyCollectorlatestPage and it naturally fits within one response.

Luckily, today I found a good read which implies that PropertyCollector should not be used at all. We probably should ResetCollector to the newest events and then ReadPreviousEvents as many times as we need until we encounter events that have already been processed.

Comment by Glebs Ivanovskis (Inactive) [ 2017 Nov 16 ]

Fix for version 3.0 is available for testing in development branch svn://svn.zabbix.com/branches/dev/ZBX-12497 revision 74710.

Comment by Andris Zeila [ 2017 Nov 24 ]

Successfully tested, please review minor refactoring/renaming in r74999

glebs.ivanovskis Thank you for your input! Looks nice!

Comment by Glebs Ivanovskis (Inactive) [ 2017 Nov 27 ]

Fixed in:

  • pre-3.0.14rc1 r75053;
  • pre-3.2.11rc1 r75056;
  • pre-3.4.5rc1 r75057;
  • pre-4.0.0alpha1 (trunk) r75058.
Generated at Tue Apr 23 09:32:27 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.