[ZBX-5027] Once monitoring a log file more than 2GB, the log will be never monitored. Created: 2012 May 21 Updated: 2017 May 30 Resolved: 2012 May 22 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Agent (G), Proxy (P), Server (S) |
Affects Version/s: | 1.8.13 |
Fix Version/s: | 1.8.14rc1 |
Type: | Incident report | Priority: | Major |
Reporter: | Takanori Suzuki | Assignee: | dimir |
Resolution: | Fixed | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Agent: Linux x86_64 |
Issue Links: |
|
Description |
Almost same issue with However I think following behavior is a problem. ------------------------------------------------------------ branches/1.8 (r27653)------------------------------------------------------- Then if agent restart, agent will monitor the log file from negative value "lastlogsize". ------------------------------------------------------------ branches/1.8 (r27653)------------------------------------------------------- I suggest Zabbix 1.8.x to return NOTSUPPORTED if the log file is over 2GB. BTW, I think |
Comments |
Comment by dimir [ 2012 May 22 ] |
Could not reproduce it with: Agent Linux x86_64 In that case DB gets INT_MAX (2147483647) stored as "lastlogsize" and if the log file shrinks after that the log monitoring continues from 0. I was using MySQL. Which DB were you using? |
Comment by Takanori Suzuki [ 2012 May 22 ] |
I also use MySQL. Following code is easy to understand what occurs. (Please execute it in x86_64 environment.) int main() { int i; i = atoi("2147483647"); printf("%d\n",i); //if over 2147483647, atoi() returns negative value in x86_64 //Finally, the negative value will be stored in MySQL. i = atoi("2147483648"); printf("%d\n",i); i = atoi("3333333333"); printf("%d\n",i); }---------------------------------------------------------------------------------------------- The output is following. ---------------------------------------------------------------------------------------------- |
Comment by Takanori Suzuki [ 2012 May 22 ] |
Your Zabbix Server should be x86_64 for reproduce the case. To be strictly, if the string cannot be represented as integer, the behavior is undefined. It looks work good in x86_32. |
Comment by dimir [ 2012 May 22 ] |
Exactly, just tested it. By the way the place in the code is not really src/zabbix_server/trapper/trapper.c:369 (this is to handle old XML protocol) but $ sed -n '1476,1477p' src/libs/zbxdbhigh/proxy.c But this doesn't matter. The problem is indeed atoi(). We decided to fix agent. 1.8 agent will always fail and return ZBX_NOTSUPPORTED if log file size is over 2 GB. |
Comment by Takanori Suzuki [ 2012 May 22 ] |
> By the way the place in the code is not really > But this doesn't matter. The problem is indeed atoi(). We decided to fix agent. 1.8 agent will always fail and return ZBX_NOTSUPPORTED if log file size is over 2 GB. |
Comment by dimir [ 2012 May 22 ] |
Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-5027. |
Comment by Alexander Vladishev [ 2012 Jun 03 ] |
Successfully tested! |
Comment by dimir [ 2012 Jun 04 ] |
Fixed in pre-1.8.14 r28029. |
Comment by dimir [ 2012 Jun 04 ] |
NOTE! In order to apply the fix please follow these steps: 1) recompile Zabbix agent UPDATE items SET lastlogsize=0 WHERE lastlogsize<0; 4) start freshly compiled Zabbix agent |