[ZBX-1054] zabbix agent cannot treat 0 byte log file properly and doesn't reset 'lastlogsize' to 0. As a result, some data will be lost. Created: 2009 Sep 23 Updated: 2019 Apr 04 Resolved: 2009 Sep 29 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Agent (G) |
Affects Version/s: | 1.6 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Major |
Reporter: | Takanori Suzuki | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
LInux and Windows (maybe also other environments) |
Attachments: | zabbix-1.6.6-check_0bytelog.patch |
Description |
zabbix agent cannot treat 0 byte log file properly and doesn't reset 'lastlogsize' to 0. Usually, when zabbix monitor a log file after logrotated, the log filesize is smaller than that last zabbix monitored and zabbix reset 'lastlogsize' to the new filesize. detail: So, following 'value' will be NULL and go to break at src/zabbix_agent/active.c:672. How to reproduce: Type: "ZABBIX agent (active)" (step 2)
(step 3) mysql> select lastlogsize from items where key_='log[/var/log/test.log]';
-------------
------------- (step 4)
(step 5) mysql> select lastlogsize from items where key_='log[/var/log/test.log]';
-------------
------------- (step 6)
(step 7) mysql> select lastlogsize from items where key_='log[/var/log/test.log]';
-------------
------------- |
Comments |
Comment by Takanori Suzuki [ 2009 Sep 23 ] | ||||||
Solution: I'll attatch a patch "zabbix-1.6.6-check_0bytelog.patch". After patching: Type: "ZABBIX agent (active)" (step 2)
(step 3) mysql> select lastlogsize from items where key_='log[/var/log/test.log]';
-------------
------------- (step 4)
(step 5) mysql> select lastlogsize from items where key_='log[/var/log/test.log]';
-------------
------------- (step 6)
(step 7) mysql> select lastlogsize from items where key_='log[/var/log/test.log]';
-------------
------------- | ||||||
Comment by richlv [ 2009 Sep 28 ] | ||||||
confirming in trunk, rev 7973 | ||||||
Comment by richlv [ 2009 Sep 29 ] | ||||||
confirming the fix in trunk, rev 7985 | ||||||
Comment by Takanori Suzuki [ 2009 Sep 30 ] | ||||||
Hey richlv, I just saw svn repository. richlv, how did you checked it with rev 7985? And, Though I know my patch was not good at sending empty data('\0'), I'd like to know why Dmitry made fix to become lastlogsize empty only on the agent side. | ||||||
Comment by richlv [ 2009 Sep 30 ] | ||||||
sorry about that - some copy/paste error, actual testing was performed with revision 7994 |