[ZBX-12527] Inconsistent 'mode' parameter check in vfs.dir.size() code Created: 2017 Aug 18  Updated: 2024 Apr 10  Resolved: 2017 Sep 04

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 3.4.0rc1
Fix Version/s: 3.4.2rc1, 4.0.0alpha1, 4.0 (plan)

Type: Patch request Priority: Trivial
Reporter: MATSUDA Daiki Assignee: Andris Mednis
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File vfs_dir_size_unbalanced_code.patch    
Team: Team A
Story Points: 0.7

 Description   

I checked the new function vfs.dir.size and its code has the unbalanced judgement for mode option.

prepare_parameters() decides the mode option to SIZE_MODE_APPARENT, SIZE_MODE_DISK and others and in others returns FAIL.
In such a situation its caller vfs_dir_size() stops to monitor. In addition, first judgement has no care for others. But second cares.



 Comments   
Comment by MATSUDA Daiki [ 2017 Aug 18 ]

In addition, in https://www.zabbix.com/documentation/3.4/manual/config/items/itemtypes/zabbix_agent it is written that counting is for file and regular expression is for file, but not only file but file, directory and symbolic link in source code reading.

Comment by Andris Mednis [ 2017 Aug 21 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-12527 .

Comment by Andris Mednis [ 2017 Aug 21 ]

Thanks, [email protected], for reporting and patch !

One question about your documentation remark "...it is written that counting is for file and regular expression is for file, but not only file but file, directory and symbolic link in source code reading.".
Do You mean that 'vfs.dir.size' 'regex_incl' parameter documentation should be fixed ? (Currently it says "regex_incl - regex describing the file name pattern for inclusion (include all files if empty; empty string is default value)) ?

Comment by MATSUDA Daiki [ 2017 Aug 23 ]

Yes. e.g. 'all files' means regular file, directory and symbolic link.

Comment by Andris Mednis [ 2017 Aug 30 ]

Available in versions:

  • pre-3.4.2rc1 r71910
  • pre-4.0.0alpha1 (trunk) r71913
Comment by Andris Mednis [ 2017 Aug 31 ]

(1) Corrected documentation https://www.zabbix.com/documentation/3.4/manual/config/items/itemtypes/zabbix_agent (descriptions of regex_incl, regex_excl parameters of vfs.dir.size[] item).

martins-v CLOSED

Generated at Fri Apr 26 10:03:20 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.